darsia.BaseTransformation#

class BaseTransformation[source]#

Bases: ABC

Base class for geometrical transformations of images.

Methods

call_array(x)

Apply transformation to array.

fit(pts_src, pts_dst, **kwargs)

Fit parameters of transformation.

inverse(x)

Apply inverse transformation to array.

inverse_array(x)

Apply inverse transformation to array.

set_dtype(pts_src, pts_dst)

Set array input and output type for generalized perspective transformation.

set_parameters_as_vector(parameters)

Set parameters of transformation as vector.

Attributes

input_dtype

Type of input for generalized perspective transformation

output_dtype

Type of output for generalized perspective transformation

input_array_dtype

Type of input arrays for generalized perspective transformation

output_array_dtype

Type of output arrays for generalized perspective transformation

abstractmethod call_array(x)[source]#

Apply transformation to array.

Parameters:
xnp.ndarray

Array to transform (type depends on input type of transformation).

Returns:
np.ndarray

Transformed array.

abstractmethod fit(pts_src, pts_dst, **kwargs)[source]#

Fit parameters of transformation.

Required for parameter fitting through optimization.

inverse(x)[source]#

Apply inverse transformation to array.

Parameters:
xnp.ndarray

Array to transform (type depends on input type of transformation).

Returns:
np.ndarray

Transformed array.

abstractmethod inverse_array(x)[source]#

Apply inverse transformation to array.

Parameters:
xnp.ndarray

Array to transform (type depends on input type of transformation).

Returns:
np.ndarray

Transformed array.

set_dtype(pts_src, pts_dst)[source]#

Set array input and output type for generalized perspective transformation.

Parameters:
pts_srcUnion[darsia.Coordinate, darsia.Voxel, darsia.VoxelCenter]

Source points.

pts_dstUnion[darsia.Coordinate, darsia.Voxel, darsia.VoxelCenter]

Target points.

abstractmethod set_parameters_as_vector(parameters)[source]#

Set parameters of transformation as vector.

Required for parameter fitting through optimization.

Parameters:
parametersnp.ndarray

Parameters of transformation.

input_array_dtype#

Type of input arrays for generalized perspective transformation

input_dtype#

Type of input for generalized perspective transformation

output_array_dtype#

Type of output arrays for generalized perspective transformation

output_dtype#

Type of output for generalized perspective transformation