mphy0026.ui.mphy0026_register_app module

Harness to run Point/Surface-based registration algorithms.

mphy0026.ui.mphy0026_register_app.load_file_of_points(file_name)[source]

Loads an MITK .mps file, or .txt file (rows of x y z). :param file_name: string containing path to a valid file :return: Nx3 ndarray

mphy0026.ui.mphy0026_register_app.load_points_and_register(fixed_points_file, moving_points_file, output_4x4_file=None, initialise_4x4_file=None)[source]

Loads points from file, registers, and optionally outputs transform.

Parameters:
  • fixed_points_file – .vtk, .mps or .txt file of fixed points.

  • moving_points_file – .vtk, .mps or .txt file of moving points.

  • output_4x4_file – output file, to write 4x4 transform to.

  • initialise_4x4_file – input file, to provide initialisation for ICP

Returns:

4x4 transform, FRE from point based, or residual from ICP.

mphy0026.ui.mphy0026_register_app.register_points(fixed_points, moving_points)[source]

Registers point sets and returns the 4x4 transformation and error measure. If the number of points is the same, will do Arun 1987, else, PCL’s ICP. The output transform transforms moving points into the coordinate space of the fixed points.

Parameters:
  • fixed_points – Nx3 ndarray of fixed points

  • moving_points – Mx3 ndarray of moving points

Returns:

4x4 ndarray transform, FRE from point based, or residual from ICP.