scitiff.io.to_scitiff_image#
- scitiff.io.to_scitiff_image(da, concat_stdevs_and_mask=False, mask_name=None)[source]#
Modify dimnesions and shapes to match the scitiff image schema.
The function will modify the dimensions and shapes of the DataArray. It also changes the order of the dimensions to match the HyperStack order. See
SciTiffMetadata
.- Parameters:
da (
DataArray
) – The DataArray to modify as scitiff image.concat_stdevs_and_mask (
bool
, default:False
) – If True, the function will concatenatestdevs
and amask
to separate channels. The default is False.mask_name (
Optional
[str
], default:None
) – It will be ignored if theconcat_stdevs_and_mask
isFalse
. The name of the mask to be concatenated as a separate channel. IfNone
, it will try to find a single mask with the same size as theda
. If there are multiple masks with the same size, masks will be ignored.
- Return type:
DataArray
Tip
You can explicitly concatenate the channels by using
concat_stdevs_and_mask_as_channels()
function. For example, if you do not want to savestdevs
andmask
for raw images but want to save them for normalized images, you can useconcat_stdevs_and_mask_as_channels()
function only for normalized images.Warning
Interpretation of multi-channel images as
intensities
,stdevs
andmask
is not officially supported by the scitiff schema.It may change in the future.
Tip
If there are multiple masks with multi-dimensions, it cannot be saved in the scitiff format so you will have to either make them as multiple 1D masks or remove them before saving the image.