spatialdata.models.Labels3DModel#
- class spatialdata.models.Labels3DModel(*args, **kwargs)#
Attributes table#
Methods table#
|
Validate (or parse) raster data. |
|
|
|
Validate data. |
Attributes#
- Labels3DModel.array_type = <xarray_schema.components.ArrayTypeSchema object>#
- Labels3DModel.attrs = <xarray_schema.components.AttrsSchema object>#
- Labels3DModel.checks#
- Labels3DModel.chunks#
- Labels3DModel.coords#
- Labels3DModel.dims = <xarray_schema.components.DimsSchema object>#
- Labels3DModel.dtype#
- Labels3DModel.json#
- Labels3DModel.name#
- Labels3DModel.shape#
Methods#
- classmethod Labels3DModel.parse(data, dims=None, transformations=None, scale_factors=None, method=None, chunks=None, **kwargs)#
Validate (or parse) raster data.
- Parameters:
data (
ndarray
[Any
,dtype
[float64
]] |DataArray
|Array
) – Data to validate (or parse). The shape of the data should be c(z)yx for 2D (3D) images and (z)yx for 2D ( 3D) labels. If you have a 2D image with shape yx, you can usenumpy.expand_dims()
(or an equivalent function) to add a channel dimension.dims (
Optional
[Sequence
[str
]] (default:None
)) – Dimensions of the data.transformations (
Optional
[dict
[str
,BaseTransformation
]] (default:None
)) – Transformations to apply to the data.scale_factors (
Optional
[Sequence
[Union
[dict
[str
,int
],int
]]] (default:None
)) – Scale factors to apply for multiscale. If not None, amultiscale_spatial_image.MultiscaleSpatialImage
is returned.method (
Optional
[Methods
] (default:None
)) – Method to use for multiscale.chunks (
Union
[int
,tuple
[int
,...
],tuple
[tuple
[int
,...
],...
],Mapping
[Any
,Union
[None
,int
,tuple
[int
,...
]]],None
] (default:None
)) – Chunks to use for dask array.
- Return type:
SpatialImage
|MultiscaleSpatialImage
- Returns:
:
spatial_image.SpatialImage
ormultiscale_spatial_image.MultiscaleSpatialImage
.
- Labels3DModel.to_json(**dumps_kws)#
- Return type:
str
- Labels3DModel.validate(data)#
Validate data.
- Parameters:
data (
Any
) – Data to validate.- Raises:
ValueError – If data is not valid.
- Return type:
None