SciFiReaders.readers.generic.image.ImageReader

class SciFiReaders.readers.generic.image.ImageReader(*args, **kwargs)[source]

Bases: sidpy.sid.reader.Reader

Translates data from an image file to an HDF5 file

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

Tests whether or not the provided file has a .ndata extension

read

Translates the image in the provided file into a USID HDF5 file

can_read()[source]

Tests whether or not the provided file has a .ndata extension

read(bin_factor=None, interp_func=3, normalize=False, **image_args)[source]

Translates the image in the provided file into a USID HDF5 file

Parameters
  • bin_factor (uint or array-like of uint, optional) – Down-sampling factor for each dimension. Default is None. If specifying different binning for each dimension, please specify as (height binning, width binning)

  • interp_func (int, optional. Default = PIL.Image.BICUBIC) – How the image will be interpolated to provide the down-sampled or binned image. For more information see instructions for the resample argument for PIL.Image.resize()

  • normalize (boolean, optional. Default = False) – Should the raw image be normalized between the values of 0 and 1

  • image_args (dict) – Arguments to be passed to read_image. Arguments depend on the type of image.