neuralib.scanner.czi.CziConfocalScanner

final class neuralib.scanner.czi.CziConfocalScanner[source]

Bases: AbstractConfocalScanner

czi confocal image data

czifile: CziFile

aicspylibczi.CziFile

filepath: Path
meta: dict[str, Any]

metadata dict

n_scenes: int

positions scan

consistent_scan_configs: bool

whether same configs (i.e., X, Y, C …) in different scenes

classmethod load(file)[source]
Parameters:

file (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader)

Return type:

Self

tile_info: dict[str, Any]
property tile_ncols: int

how many tiles for each column

property tile_nrows: int

how many tiles for each row

get_dim_code()[source]

get the DimCode

Dimension parameters (DimCode):

V - view

H - phase

I - illumination

S - scene

R - rotation

T - time

C - channel

Z - z plane (height)

M - mosaic tile, mosaic images only

Y - image height

X - image width

A - samples, BGR/RGB images only

Return type:

DIMCODE

property width: dict[int, int]

X

property height: dict[int, int]

Y

property n_phases: dict[int, int]

how many scanning face

property n_channels: dict[int, int]

number of fluorescence channels. C

property n_zstacks: dict[int, int]

number of stacks in z axis. Z

property n_tiles: dict[int, int]
property is_mosaic: bool
get_image(channel, scene=None, depth=None, zproj_type='max', norm=True)[source]

Get the image array

Parameters:
  • channel (int) – channel index

  • scene (int | None) – scanning position

  • depth (int | slice | ndarray | None) – z stacks index, if None, use all stacks

  • zproj_type (Literal['avg', 'max', 'min', 'std', 'median']) – which z projection type, refer to fiji

  • norm (bool) – normalization, for visualization

Returns:

(Y, X)

Return type:

ndarray

get_coordinates()[source]

(P, 2) with xy coordinates

Return type:

list[tuple[int, int]]

imshow(scene=None, add_scale_bar=True, output=None, position_only=False)[source]

Simple plot for specific config

Parameters:
  • scene (int | None)

  • add_scale_bar (bool)

  • output (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | None)

foreach_tif_output(output=None, combine_channels=False, combine_tiles=True)[source]
Parameters:
  • output (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | None) – output directory

  • combine_channels (bool)

  • combine_tiles (bool) – TODO overlap compensation?

Returns:

__init__(czifile, filepath, meta, n_scenes=Field(name=None, type=None, default=1, default_factory=<dataclasses._MISSING_TYPE object>, init=False, repr=True, hash=None, compare=True, metadata=mappingproxy({}), kw_only=<dataclasses._MISSING_TYPE object>, _field_type=None), consistent_scan_configs=Field(name=None, type=None, default=<dataclasses._MISSING_TYPE object>, default_factory=<dataclasses._MISSING_TYPE object>, init=False, repr=True, hash=None, compare=True, metadata=mappingproxy({}), kw_only=<dataclasses._MISSING_TYPE object>, _field_type=None))

Method generated by attrs for class CziConfocalScanner.

Parameters:
  • czifile (CziFile)

  • filepath (Path)

  • meta (dict[str, Any])

  • n_scenes (int)

  • consistent_scan_configs (bool)

Return type:

None

get_pixel2mm_factor()