zetastitcher.io.inputfile module

class zetastitcher.io.inputfile.InputFile(file_path=None)

Bases: zetastitcher.io.inputfile_mixin.InputFileMixin

Attributes
array_size

Size in bytes of the whole virtual array

channel
file
file_size
frame_size

Size in bytes of a single frame

shape

Shape of the whole image stack.

Methods

frame(index[, dtype, copy])

Convenience function to retrieve a single slice.

whole([dtype, copy])

Convenience function to retrieve the whole stack.

zslice(arg1[, arg2, step, dtype, copy])

Return a slice, i.e. a substack of frames.

zslice_idx(index[, frames_per_slice, dtype, ...])

Return a slice, i.e. a substack of frames, by index.

close

open

property channel
property file
property file_size
frame(index, dtype=None, copy=True)

Convenience function to retrieve a single slice.

Same as calling slice() and squeezing.

Parameters
indexint

slice index

dtype
Returns
numpy.ndarray

A numpy array, see slice().

open(file_path=None)
property shape

Shape of the whole image stack.

Returns
tuple

(nfrms, channels, ysize, xsize) where channels is the number of color channels in the image. If channel is set or if there is only one channel, the channels dimension is squeezed.

whole(dtype=None, copy=True)

Convenience function to retrieve the whole stack.

Equivalent to call slice_idx() with pandas documentation = 0 and frames_per_slice = nfrms

Parameters
dtype
Returns
numpy.ndarray

A numpy array, see slice().

zslice(arg1, arg2=None, step=None, dtype=None, copy=True)

Return a slice, i.e. a substack of frames.

Parameters
arg1int

Mandatory argument, will be passed to slice If arg2 and step are both None, it will be passed as slice(arg1), i.e. it would act as the stop argument.

arg2int

If not null, will be passed as slice(arg1, arg2, step)

stepint

If not null, will be passed as slice(arg1, arg2, step)

dtype
Returns
numpy.ndarray

A numpy array of the original type or of dtype, if specified. The shape of the array is (end_frame - start_frame, channels ysize, xsize, channels) where channels is the number of color channels in the image. If channel is set or if there is only one channel, the channels dimension is squeezed.

zslice_idx(index, frames_per_slice=1, dtype=None, copy=True)

Return a slice, i.e. a substack of frames, by index.

Parameters
indexint

slice index

frames_per_sliceint

number of frames per slice

dtype
Returns
numpy.ndarray

A numpy array, see slice().