corrct.alignment.markers
Fiducial marker tracking routines.
@author: Nicola VIGANÒ, ESRF - The European Synchrotron, Grenoble, France, and CEA-IRIG, Grenoble, France
Module Contents
Classes
Plotting class to assess the marker tracking quality. |
Functions
Convert dimensions from centimeters to inches. |
|
Track marker position in a stack of images. |
|
Create a disk-shaped marker for tracking a calibration object’s movement. |
API
- corrct.alignment.markers.cm2inch(dims: collections.abc.Sequence[float] | numpy.typing.NDArray) tuple[float][source]
Convert dimensions from centimeters to inches.
Parameters
dims : Sequence[float] | NDArray The dimensions of the object in centimeters. Can be a sequence of floats or a NumPy array.
Returns
tuple[float] The converted dimensions in inches, as a tuple of floats.
- corrct.alignment.markers.track_marker(prj_data: numpy.typing.NDArray, marker_vu: numpy.typing.NDArray, stack_axis: int = -2) numpy.typing.NDArray[source]
Track marker position in a stack of images.
Parameters
prj_data_vwu : NDArray The projection data. marker_vu : NDArray The fiducial marker to track in VU. stack_axis : int, optional The axis along which the images are stacked. The default is -2.
Returns
NDArray List of positions for each image.
- corrct.alignment.markers.create_marker_disk(data_shape_vu: collections.abc.Sequence[int] | numpy.typing.NDArray, radius: float, super_sampling: int = 5, conv: bool = True) numpy.typing.NDArray[source]
Create a disk-shaped marker for tracking a calibration object’s movement.
Parameters
data_shape_vu : Sequence[int] | NDArray Shape of the images (vertical, horizontal). Can be a sequence of integers or a NumPy array. radius : float Radius of the marker in pixels. super_sampling : int, optional Super-sampling factor for the coordinates used in marker creation. Default is 5. conv : bool, optional Whether to convolve the initial marker with itself. Default is True.
Returns
NDArray An image of the same size as the input projections, with the marker centered.
- class corrct.alignment.markers.MarkerTrackingVisualizer(fitted_positions_vu: numpy.typing.NDArray, images: numpy.typing.NDArray, marker: numpy.typing.NDArray, trajectory: corrct.alignment.fitting.Trajectory | None = None)[source]
Plotting class to assess the marker tracking quality.
Initialization
Initialize the visualization utility for checking the marker position fitting.
Parameters
fitted_positions_vu : NDArray The fitted positions of the marker imgs : NDArray The original images disk : NDArray The marker image trajectory : Union[fitting.Trajectory, None], optional The trajectory object that the points are supposed to follow, by default None