sksurgerycalibration.algorithms.pivot module¶
Functions for pivot calibration.
-
sksurgerycalibration.algorithms.pivot.
pivot_calibration
(tracking_matrices, configuration=None)[source]¶ Performs pivot calibration on an array of tracking matrices
Parameters: - tracking_matrices – an Nx4x4 array of tracking matrices
- configuration – an optional configuration dictionary, if not the algorithm defaults to Algebraic One Step. Other options include ransac, and sphere_fitting
Returns: tuple containing; ‘pointer_offset’ The coordinate of the pointer tip relative to the tracking centre ‘pivot_point’ The location of the pivot point in world coordinates ‘residual_error’ The RMS pointer tip error, errors in each direction are treated as independent variables, so for a calibration with n matrices, RMS error is calculated using nx3 measurements.
Raises: TypeError, ValueError
-
sksurgerycalibration.algorithms.pivot.
pivot_calibration_aos
(tracking_matrices)[source]¶ Performs Pivot Calibration, using Algebraic One Step method, and returns Residual Error.
See Yaniv 2015.
Parameters: tracking_matrices – N x 4 x 4 ndarray, of tracking matrices. Returns: pointer offset, pivot point and RMS Error about centroid of pivot. Raises: ValueError if rank less than 6
-
sksurgerycalibration.algorithms.pivot.
pivot_calibration_sphere_fit
(tracking_matrices, init_parameters=None)[source]¶ Performs Pivot Calibration, using sphere fitting, based on
See Yaniv 2015.
Parameters: - tracking_matrices – N x 4 x 4 ndarray, of tracking matrices.
- init_parameters – 1X4 array of initial parameter for finding the pivot point in world coords and pivot radius. Default is to set to the mean x,y,z values and radius = 0.
Returns: pointer offset, pivot point and RMS Error about centroid of pivot.
-
sksurgerycalibration.algorithms.pivot.
pivot_calibration_with_ransac
(tracking_matrices, number_iterations, error_threshold, concensus_threshold, early_exit=False)[source]¶ Written as an exercise for implementing RANSAC.
Parameters: - tracking_matrices – N x 4 x 4 ndarray, of tracking matrices.
- number_iterations – the number of iterations to attempt.
- error_threshold – distance in millimetres from pointer position
- concensus_threshold – the minimum percentage of inliers to finish
- early_exit – If True, returns model as soon as thresholds are met
Returns: pointer offset, pivot point and RMS Error about centroid of pivot.
Raises: TypeError, ValueError