darsia.AffineCorrection#

class AffineCorrection(coordinatesystem_src, coordinatesystem_dst, pts_src, pts_dst, fit_options={})[source]#

Bases: TransformationCorrection

Affine correction (translation, scaling, rotation).

Set up the affine correction.

Parameters:
coordinatesystem_srcdarsia.CoordinateSystem

Coordinate system of pts_src.

coordinatesystem_dstdarsia.CoordinateSystem

Coordinate system of pts_dst.

pts_srcCoordinateArray, VoxelArray or VoxelCenterArray

Source points.

pts_dstCoordinateArray, VoxelArray or VoxelCenterArray

Target points.

fit_optionsdict, optional

"isometry" (bool) – whether the transformation is an isometry; if so it operates in Coordinate space.

Methods

correct_array(array_src)

Correction routine of array data.

correct_metadata([metadata])

Correction routine on metadata level.

load(path)

Load the correction from npz file.

save(path)

Save the correction to npz file.

Attributes

coordinatesystem_src

Coordinate system corresponding to the input.

coordinatesystem_dst

Coordinate system corresponding to the output/target.

dim

Dimension of the underlying Euclidean spaces.

transformation

Transformation to apply as correction.

load(path)[source]#

Load the correction from npz file.

Parameters:
pathPath

Path to the file.

save(path)[source]#

Save the correction to npz file.

Parameters:
pathPath

Path to the file.

coordinatesystem_dst#

Coordinate system corresponding to the output/target.

coordinatesystem_src#

Coordinate system corresponding to the input.

dim#

Dimension of the underlying Euclidean spaces.