SciFiReaders.readers.microscopy.em.tem.dm_reader.DMReader

class SciFiReaders.readers.microscopy.em.tem.dm_reader.DMReader(file_path, verbose=False)[source]

Bases: sidpy.sid.reader.Reader

file_path: filepath to dm3 or dm4 file.

warn(‘This Reader will eventually be moved to the ScopeReaders package’

‘. Be prepared to change your import statements’, FutureWarning)

Parameters

file_path (str) – Path to the file that needs to be read

self._input_file_path

Path to the file that will be read

Type

str

Notes

  • This method will check to make sure that the provided file_path is indeed a string and a valid file path.

  • Consider calling can_read() within __init__() for validating the provided file

Raises

FileNotFoundError

Methods

can_read

Checks whether the provided file can be read by this reader.

close

get_filename

get_raw

Extracts data as np array

get_tags

read

Extracts the data and metadata from the provided file and embeds this information in one or more sidpy.Dataset objects that are returned from this method

set_data_type

set_dimensions

Attributes

data_cube

Extracts data as np array

filename

tags

can_read(*args, **kwargs)

Checks whether the provided file can be read by this reader.

This basic function compares the file extension against the extension keyword argument. If the extension matches, this function returns True

Parameters

extension (str or iterable of str, Optional. Default = None) – File extension for the input file.

Returns

file_path – Path to the file that needs to be provided to read() if the provided file was indeed a valid file Else, None

Return type

str

:raises NotImplementedError : if this function is called for this or a child: :raises class that does not provide the extension keyword argument:

Notes

It is recommended to add additional checks as necessary to ensure that the translator can indeed read the given file such as by validating the headers or similar metadata.

property data_cube

Extracts data as np array

get_raw()[source]

Extracts data as np array

read()[source]

Extracts the data and metadata from the provided file and embeds this information in one or more sidpy.Dataset objects that are returned from this method

Returns

objs

Return type

sidpy.Dataset or list of sidpy.Dataset objects

:raises NotImplementedError : if the child class does not implement this method:

Notes

Do not accept the file path at read. Use self._input_file_path when implementing this method