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 concatenate stdevs and a mask to separate channels. The default is False.

  • mask_name (Optional[str], default: None) – It will be ignored if the concat_stdevs_and_mask is False. The name of the mask to be concatenated as a separate channel. If None, it will try to find a single mask with the same size as the da. 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 save stdevs and mask for raw images but want to save them for normalized images, you can use concat_stdevs_and_mask_as_channels() function only for normalized images.

Warning

Interpretation of multi-channel images as intensities, stdevs and mask 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.