scitiff.io.save_scitiff#
- scitiff.io.save_scitiff(dg, file_path, *, concat_stdevs_and_mask=False, 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
x
andy
dimensions, the image will be broadcasted tox
,y
,c
,z
,t
dimensions 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,
c
dimension may not represent color channels.- Parameters:
dg (
DataGroup
|DataArray
) – The image data to save.concat_stdevs_and_mask (
bool
, default:False
) – If True,stdevs
and amask
will be concatenated into channel dimension. The default is 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_mask
isFalse
. IfNone
whileconcat_stdevs_and_mask
isTrue
, 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: