httomo.method_wrappers.rotation.RotationWrapper

httomo.method_wrappers.rotation.RotationWrapper#

class httomo.method_wrappers.rotation.RotationWrapper(method_repository: MethodRepository, module_path: str, method_name: str, comm: mpi4py.MPI.Comm, save_result: bool | None = None, output_mapping: Dict[str, str] = {}, **kwargs)[source]#

Wraps rotation (centering) methods, which output the original dataset untouched, but have a side output for the center of rotation data (handling both 180 and 360 degrees scans).

It wraps the actual algorithm to find the center and does more. In particular: - extracts a single sinogram from the projections set (across all MPI processes) - normalises it - calls the center-finding algorithm on this normalised data slice - outputs the center of rotation as a side output and broadcast the value

For block-wise processing support, it aggregates the sinogram in-memory in the method until the sinogram is complete for the current process. Then it uses MPI to add the data from the other processes to it.

Methods

__init__(method_repository, module_path, ...)

Constructs a MethodWrapper for a method located in module_path with the name method_name.

normalize_sino(sino, flats, darks)

should_select_this_class(module_path, ...)

Method to dermine if this class should be used for wrapper instantiation, given the module path and method name.

Attributes

task_id

pattern

normalize_sino(sino: ndarray, flats: ndarray | None, darks: ndarray | None) ndarray[source]#
classmethod should_select_this_class(module_path: str, method_name: str) bool[source]#

Method to dermine if this class should be used for wrapper instantiation, given the module path and method name.

The make_method_wrapper function will iterate through all subclasses and evaluate this condition in the order of declaration, falling back to GenericMethodWrapper if all evaluate to False.

Therefore, deriving classes should override this method to indicate the criteria when they should be instantiated.