ome_zarr.OMEZarrConverter
bioimg.converters.ome_zarr.OMEZarrConverter()
Converter of Zarr-supported images to TileDB Groups of Arrays
Methods
Name | Description |
---|---|
from_tiledb | Convert a TileDB Group of Arrays back to other format images, one per level |
to_tiledb | Convert an image to a TileDB Group of Arrays, one per level. |
from_tiledb
bioimg.converters.ome_zarr.OMEZarrConverter.from_tiledb(input_path, output_path, *, level_min=0, attr=ATTR_NAME, config=None, output_config=None, scratch_space=DEFAULT_SCRATCH_SPACE, log=None, **writer_kwargs)
Convert a TileDB Group of Arrays back to other format images, one per level
Parameters
Name | Type | Description | Default |
---|---|---|---|
input_path |
str | path to the TileDB group of arrays | required |
output_path |
str | path to the image | required |
level_min |
int | minimum level of the image to be converted. By default set to 0 to convert all levels | 0 |
attr |
str | attribute name for backwards compatibility support | ATTR_NAME |
config |
Union[tiledb.Config, Mapping[str, Any]] | tiledb configuration either a dict or a tiledb.Config of source | None |
output_config |
Union[tiledb.Config, Mapping[str, Any]] | tiledb configuration either a dict or a tiledb.Config of destination | None |
scratch_space |
str | shared memory or cache space for cloud random access export support | DEFAULT_SCRATCH_SPACE |
log |
Optional[Union[bool, logging.Logger]] | verbose logging, defaults to None. Allows passing custom logging.Logger or boolean. If None or bool=False it initiates an INFO level logging. If bool=True then a logger is instantiated in DEBUG logging level. | None |
to_tiledb
bioimg.converters.ome_zarr.OMEZarrConverter.to_tiledb(source, output_path, *, level_min=0, tiles=None, tile_scale=1, preserve_axes=False, chunked=False, max_workers=0, exclude_metadata=None, experimental_reader=False, experimental_queue_limit=(10, 20), compressor=None, log=None, reader_kwargs=None, pyramid_kwargs=None)
Convert an image to a TileDB Group of Arrays, one per level.
:param source: path to the input image or ImageReader object
:param output_path: path to the TileDB group of arrays
:param level_min: minimum level of the image to be converted. By default set to 0
to convert all levels.
:param tiles: A mapping from dimension name (one of 'T', 'C', 'Z', 'Y', 'X') to
the (maximum) tile for this dimension.
:param tile_scale: The scaling factor applied to each tile during I/O.
Larger scale factors will result in less I/O operations.
:param preserve_axes: If true, preserve the axes order of the original image.
:param chunked: If true, convert one tile at a time instead of the whole image.
**Note**: The OpenSlideConverter may not be 100% lossless with chunked=True
for levels>0, even though the converted images look visually identical to the
original ones.
:param max_workers: Maximum number of threads that can be used for conversion.
Applicable only if chunked=True.
:param exclude_metadata: An optional argument that specifies how to transform the original metadata.
It can be one of the following:
* A callable (function, method, etc.) that takes an OME-XML string and returns it as a string, while removing
some of the original metadata and excluding them from being ingested.
* A boolean value:
* ``True``: Indicates a specific built-in transformation should be applied. see: `remove_ome_image_metadata`
* ``False``: Indicates no transformation should be applied.
* ``None``: Indicates no transformation should be applied (same as ``False``).
:param experimental_reader: If true, use the experimental tiff reader optimized for s3 reads.
Experimental feature, use with caution
:param experimental_queue_limit: When using the experimental reader, define the minimum and maximum number of
pending tiles waiting to be written to TileDB.
:param compressor: TileDB compression filter mapping for each level
:param log: verbose logging, defaults to None. Allows passing custom logging.Logger or boolean.
If None or bool=False it initiates an INFO level logging. If bool=True then a logger is instantiated in
DEBUG logging level.
:param reader_kwargs: Keyword arguments passed to the _ImageReaderType constructor. Allows passing configuration
parameters like tiledb.Config or/and tiledb.Ctx.
See Also :param pyramid_kwargs: Keyword arguments passed to the scaler constructor for generating downsampled versions of the base level. Valid keyword arguments are: scale_factors (Required): The downsampling factor for each level scale_axes (Optional): Default “XY”. The axes which will be downsampled chunked (Optional): Default False. If true the image is split into chunks and each one is independently downsampled. If false the entire image is downsampled at once, but it requires more memory. progressive (Optional): Default False. If true each downsampled image is generated using the previous level. If false for every downsampled image the level_min is used, but it requires more memory. order (Optional): Default 1. The order of the spline interpolation. The order has to be in the range 0-5. See skimage.transform.warp
for detail. max_workers (Optional): Default None. The maximum number of workers for chunked downsampling. If None, it will default to the number of processors on the machine, multiplied by 5.