ImageUtils#
- class ddd_pylib.ImageUtils[source]#
Bases:
objectMethods
- static completeCalibrationFrom(imA, imB)[source]#
Completes the calibration of image B from image A. Only the axes present in image B will be completed. If an axis already has a scale or unit in image B, it will not be overwritten.
- static copyCalibrationTo(imA, imB)[source]#
Copies the calibration (scale and units) from image A to image B. Only the axes present in image B will be copied. If an axis is not present in image A, it will not be copied.
- static ensureAxes(da, axes=['T', 'Z', 'Y', 'X'])[source]#
Forces the DataArray to have the specified axes. If an axis is missing, it is added with size 1.
- static ensureCalibration(img)[source]#
Ensures that the image has calibration information (scale and units) for valid axes. If not present, it sets default values.
- Parameters:
img (DataArray)
- static getAnisotropy(img)[source]#
Computes the anisotropy factor Z/X for a given image. Return 1.0 if the image does not have a Z dimension. Handles different units for Z and X.
- static removeExtraAxes(da, axes=['T', 'Z', 'Y', 'X'])[source]#
Removes any axes from the DataArray that are not in the specified list of axes.
- static scaleToTuple(img)[source]#
Returns the scale of the image as a tuple, in the order of the image’s dimensions. If a dimension does not have a scale, it defaults to _DEFAULT_SCALING.
- Parameters:
img (DataArray)
- static unitsToTuple(img)[source]#
Returns the units of the image as a tuple, in the order of the image’s dimensions. If a dimension does not have a unit, it defaults to _DEFAULT_UNITS.
- Parameters:
img (DataArray)