scitiff.io.concat_stdevs_and_mask_as_channels#
- scitiff.io.concat_stdevs_and_mask_as_channels(da, mask_name=None)[source]#
Concatenate intensities, stdevs and a mask into channel dimension.
- Parameters:
da (
DataArray
) – The DataArray to retrieve stdevs and a mask. If stdevs or a mask does not exist, it will be ignored.mask_name (
Optional
[str
], default:None
) – The name of the mask to repack 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.
- Returns:
DataArray
– The DataArray with thestdevs
and amask
concatenated as channels. The intensities will losevariances
and a matching mask as they are repacked and concatenated as channels. It will havec
coordinate with the size of corresponding channels.
Tip
If there are multiple masks with multi-dimensions, it cannot be saved in the
SciTiffMetadata
so you will have to either make them as multiple 1D masks or remove them before saving the image.