scitiff.save_scitiff#
- scitiff.save_scitiff(dg, file_path, *, concat_stdevs_and_mask=True, mask_name=None)[source]#
Save an image in scipp data structure to a SCITIFF format including metadata.
The image is transposed to the default HyperStack order before saving the image, which is
x,y,c,z,t. (From the innermost dimension to the outermost dimension)Note
Before the image is saved, it is broadcasted to match the HyperStack even if part of dimensions are not present. For example, if the image has only
xandydimensions, the image will be broadcasted tox,y,c,z,tdimensions with size of 1 for each dimension that is not present.Warning
load_scitiff()function will squeeze the dimensions with size 1 by default. Other image tools also may squeeze the image and drop the dimensions with size 1 by default.Note
Dimensions of the image stack# Name
Description
x
x-axis (width)
y
y-axis (height)
c
channel-axis
z
z-axis
t
time-axis(time-of-flight or other time-like dimension)
Warning
For neutron imaging,
cdimension may not represent color channels.- Parameters:
concat_stdevs_and_mask (
bool, default:True) – If True,stdevsand amaskwill be concatenated into channel dimension. The default is True.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. IfNonewhileconcat_stdevs_and_maskisTrue, it will try to find a single mask with the same size as the image. If there are multiple masks with the same size, masks will be ignored.
- Raises:
ValueError – If the image data has unexpected dimensions. The function does not understand any other names for the dimensions except
x,y,c,z,t.scipp.DTypeError – If the image data has unexpected dtype. ImageJ only supports float32, int8, and int16 dtypes.
- Return type: