rockverse.voxel_image.create#
- rockverse.voxel_image.create(shape, dtype, chunks='nprocs', store=None, path=None, overwrite=False, field_name='', field_unit='', description='', voxel_origin=None, voxel_length=None, voxel_unit='', **kwargs)[source]#
Create empty voxel image.
- Parameters:
shape (tuple) – Desired image shape.
dtype (string or dtype) – NumPy dtype. Type must be numeric (unsigned integer, integer, float, complex) or boolean. Ex:
dtype=int,dtype='u2',dtype='f4',dtype=complex.chunks (iterable of ints | int | 'nprocs' | None, optional) – If iterable of integers, define the chunk shape. If integer, chunks will be as close as possible to cubic shapes, and the number of chunks will match this input number. If ‘nprocs’, the number of chunks will match the number of MPI processes. If None, False, empty tuple or any other object that makes
not chunksTrue, chunk shape will be set to the array shape, i.e., single chunk for the whole array. Default is ‘nprocs’.store (str | zarr.storage.StoreLike | None, optional) – A string with the file path in the local file disk, or any valid Zarr store, or
Noneto use Memory store. Default is None.path (str or None, optional) – The path of the array within the store. If path is None, the array will be located at the root of the store.
overwrite (bool, optional) – If True, delete all pre-existing data in the store at the specified path before creating the new image. Default value is False.
field_name (str, optional) – Name for the stored image or scalar field.
field_unit (str, optional) – Unit for the stored image or scalar field.
description (str, optional) – Description for the stored image or scalar field.
voxel_origin (list or tuple, optional) – Image voxel coordinate origin in units of voxel_unit. This is the spatial coordinate for the voxel with lowest (x, y, z) coordinates. If
None, defaults to a tuple of zeros for each image dimension.voxel_length (list or tuple, optional) – Image voxel length in each dimension. If
None, defaults to a tuple of ones for each image dimension.voxel_unit (str, optional) – Image voxel length unit.
**kwargs – Additional keyword arguments to be passed to the underlying Zarr.create_array function.
- Returns:
The created
VoxelImageobject.- Return type: