darsia.CoordinateTransformation#
- class CoordinateTransformation(coordinatesystem_src, coordinatesystem_dst, pts_src, pts_dst, fit_options={})[source]#
Bases:
objectGeneral affine transformation (translation, scaling, rotation), applicable for general (up to 4d) images.
NOTE: Inherit from base correction to make use of the plain array correction routines but complement with meta corrections.
Constructor.
- Parameters:
- coordinatesystem_src
CoordinateSystem Source coordinate system.
- coordinatesystem_dst
CoordinateSystem Target coordinate system.
- pts_src
CoordinateArray,VoxelArray,VoxelCenterArray Source points.
- pts_dst
CoordinateArray,VoxelArray,VoxelCenterArray Target points.
- fit_options
dict Options for the affine fit.
- coordinatesystem_src
Methods
correct_metadata(image)Correction routine of metadata.
Determine the active canvas in coordinatesystem_dst, covered by coordinatesystem_src after transformed onto the target canvas.
Attributes
Coordinate system corresponding to the input.
Coordinate system corresponding to the output/target.
Dimension of the underlying Euclidean spaces.
Correction object for the array data.
- correct_metadata(image)[source]#
Correction routine of metadata.
- Parameters:
- image
darsia.Image Image corresponding to some source image.
- image
- Returns:
dictMetadata corresponding to a destination image.
- find_intersection()[source]#
Determine the active canvas in coordinatesystem_dst, covered by coordinatesystem_src after transformed onto the target canvas.
NOTE: Only supported for 2d. NOTE: Requires extra dependency.
- Returns:
tupleofslicesVoxel intervals ready to be used to extract subregions.
- Raises:
NotImplementedErrorIf dimension not 2.
ImportErrorIf Python package largestinteriorrectangle not installed.
- affine_correction#
Correction object for the array data.
- coordinatesystem_dst#
Coordinate system corresponding to the output/target.
- coordinatesystem_src#
Coordinate system corresponding to the input.
- dim#
Dimension of the underlying Euclidean spaces.