sksurgerysurfacematch.algorithms.goicp_registration module

Go ICP implementation of RigidRegistration interface.

class sksurgerysurfacematch.algorithms.goicp_registration.RigidRegistration(dt_size: int = 200, dt_factor: float = 2.0, normalise: bool = True, num_moving_points: int = 1000, rotation_limits=[-45, 45], trans_limits=[-0.5, 0.5])[source]

Bases: sksurgerysurfacematch.interfaces.rigid_registration.RigidRegistration

Class that uses GoICP implementation to register fixed/moving clouds.

Parameters:
  • dt_size (int, optional) – Distance transform size, defaults to 200
  • dt_factor (float, optional) – Distance transform scale factor, defaults to 2.0
  • normalise (bool, optional) – Normalsie data before GoICP (recommended), the resultant transform is given back in ‘normal’ space, i.e. the noramlisation is reversed, defaults to True
  • num_moving_points (int, optional) – How many points to sample from moving point cloud (fewer is faster), defaults to 1000
  • rotation_limits (list, optional) – Limits on how much the moving cloud can rotate to find a good solution, defaults to [-45, 45]
  • trans_limits (list, optional) – Limits on how much the moving cloud can translate to find a good solution. If normalise=True, this translation is in [-1 1] space, defaults to [-0.5, 0.5]
register(moving_cloud: numpy.ndarray, fixed_cloud: numpy.ndarray) → numpy.ndarray[source]

Uses GoICP library, wrapped in scikit-surgerygoicp.

Parameters:
  • fixed_cloud – [Nx3] fixed point cloud.
  • moving_cloud – [Mx3] moving point cloud.
  • normalise – If true, data will be centred around 0 and normalised.
  • num_moving_points – How many points to sample from moving cloud if 0, use all points
Returns:

[4x4] transformation matrix, moving-to-fixed space.

sksurgerysurfacematch.algorithms.goicp_registration.create_scaling_matrix(scale: float) → numpy.ndarray[source]

Create a scaling matrix, with the same value in each axis.

sksurgerysurfacematch.algorithms.goicp_registration.create_translation_matrix(translate: numpy.ndarray) → numpy.ndarray[source]

Create translation matrix from 3x1 translation vector.

sksurgerysurfacematch.algorithms.goicp_registration.demean_and_normalise(points_a: numpy.ndarray, points_b: numpy.ndarray)[source]

Independently centre each point cloud around 0,0,0, then normalise both to [-1,1].

Parameters:
  • points_a (np.ndarray) – 1st point cloud
  • points_b (np.ndarray) – 2nd point cloud
Returns:

normalised points clouds, scale factor & translations

sksurgerysurfacematch.algorithms.goicp_registration.numpy_to_POINT3D_array(numpy_pointcloud)[source]

Covert numpy array to POINT3D array suitable for GoICP algorithm.

sksurgerysurfacematch.algorithms.goicp_registration.set_rotnode(limits_degrees) → sksurgerygoicppython.ROTNODE[source]

Setup a ROTNODE with upper/lower rotation limits

sksurgerysurfacematch.algorithms.goicp_registration.set_transnode(trans_limits) → sksurgerygoicppython.TRANSNODE[source]

Setup a TRANSNODE with upper/lower limits