aicsimageio.readers.sldy_reader package

Submodules

aicsimageio.readers.sldy_reader.sldy_image module

class aicsimageio.readers.sldy_reader.sldy_image.SldyImage(fs: AbstractFileSystem, image_directory: Path, data_file_prefix: str, channel_file_prefix: str = '_Ch', timepoint_file_prefix: str = '_TP')[source]

Bases: object

Representation of a single acquisition in a 3i slidebook (SLDY) image.

Parameters
  • fs (AbstractFileSystem) – The file system to used for reading.

  • image_directory (types.PathLike) – Path to the image directory this is meant to represent.

  • data_file_prefix (str, default = “ImageData”) – Prefix to the data files within this image directory to extract.

get_data(timepoint: Optional[int], channel: Optional[int], delayed: bool) ndarray[source]

Returns the image data for the given timepoint and channel if specified. If delayed, the data will be lazily read in.

Parameters
  • timepoint (Optional[int]) – Optional timepoint to get data about.

  • channel (Optional[int]) – Optional channel to get data about.

  • delayed (bool) – If True, the data will be lazily read in.

Returns

data – Numpy representation of the image data found.

Return type

np.ndarray

property metadata: Dict[str, Optional[dict]]

Returns a dictionary representing the metadata of this acquisition.

Returns

metadata – Simple mapping of metadata file names to the metadata extracted from them. Possibly different than the actual yaml due to mapping the yaml to Python dictionaries, specifically with duplicate keys.

Return type

Dict[str, dict]

Module contents

class aicsimageio.readers.sldy_reader.SldyReader(image: Union[str, Path], fs_kwargs: Dict[str, Any] = {}, data_file_prefix: str = 'ImageData', **kwargs: Any)[source]

Bases: Reader

Read 3i slidebook (SLDY) images

Parameters
  • image (Path or str) – path to file

  • fs_kwargs (Dict[str, Any]) – Any specific keyword arguments to pass down to the fsspec created filesystem. Default: {}

  • data_file_prefix (str, default = “ImageData”) – Prefix to the data files within the image directories to extract. By default this will be set to “ImageData”. However, specifying “HistogramData” would allow you to interact with the image’s histogram data instead.

Raises

exceptions.UnsupportedFileFormatError – If the file is not supported by this reader.

property physical_pixel_sizes: PhysicalPixelSizes
Returns

sizes – Using available metadata, the floats representing physical pixel sizes for dimensions Z, Y, and X.

Return type

PhysicalPixelSizes

Notes

We currently do not handle unit attachment to these values. Please see the file metadata for unit information.

property scenes: Tuple[str, ...]
Returns

scenes – A tuple of valid scene ids in the file.

Return type

Tuple[str, …]

Notes

Scene IDs are strings - not a range of integers.

When iterating over scenes please use:

>>> for id in image.scenes

and not:

>>> for i in range(len(image.scenes))