scitiff.concat_stdevs_and_mask_as_channels#

scitiff.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. 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.

Returns:

DataArray – The DataArray with the stdevs and a mask concatenated as channels. The intensities will lose variances and a matching mask as they are repacked and concatenated as channels. It will have c 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.