In Memory Image Stack
ImageStack implementation for in-memory data.
InMemoryImageStack
ImageStack with data already loaded in memory.
Parameters:
-
source(Path or array) –Origin of the data, either a path to a file or the string
"array"for numpy arrays. -
data(ndarray) –Array with axes SC(Z)YX.
-
original_axes(str or None, default:None) –Axis in original order.
-
original_data_shape(tuple of int or None, default:None) –Shape in original axis order.
original_axes
property
original_data_shape
property
Original shape of the data.
Returns:
-
tuple of int–Shape in original axis order.
__init__(source, data, original_axes=None, original_data_shape=None)
Constructor.
Parameters:
-
source(Path or array) –Origin of the data, either a path to a file or the string
"array"for numpy arrays. -
data(ndarray) –Array with axes SC(Z)YX.
-
original_axes(str or None, default:None) –Axis in original order.
-
original_data_shape(tuple of int or None, default:None) –Shape in original axis order.
extract_patch(sample_idx, channels, coords, patch_size)
Extract a patch for a given sample and channels within the image stack.
Parameters:
-
sample_idx(int) –Sample index.
-
channels(sequence of int or None) –Channel indices to extract. If
None, all channels will be extracted. -
coords(sequence of int) –Spatial coordinates of the top-left corner of the patch.
-
patch_size(sequence of int) –Size of the patch in each spatial dimension.
Returns:
-
ndarray–A patch of the image data from a particular sample with dimensions C(Z)YX.