scitiff.to_scitiff_image#
- scitiff.to_scitiff_image(da, *, concat_stdevs_and_mask=True, 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:True) – If True, the function will concatenatestdevsand amaskto separate channels. If not specified, it will default to True and try to concatenate unless the DataArray is already multi-channel image and have variances and masks. In that case, it will raise an error as it is not supported yet. In case of the error, set it to False.mask_name (
Optional[str], default:None) – The name of the mask to be concatenated as a separate channel. It will be ignored if theconcat_stdevs_and_maskisFalse. 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:
Tip
You can explicitly concatenate the channels by using
concat_stdevs_and_mask_as_channels()function. For example, if you do not want to savestdevsandmaskfor 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,stdevsandmaskis 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.