sksurgeryeval.algorithms.algorithms module¶
Algorithms for the surgery evaluation application
-
sksurgeryeval.algorithms.algorithms.
add_map
(config)[source]¶ Loads vtk models from a directory and returns a list of vtk actors, with mesh visualisation
Param: configuration, may contain a “map” key Param: model_to_world: 4x4 matrix, of dtype float32 Returns: actors, None if no “map” key
-
sksurgeryeval.algorithms.algorithms.
configure_tracker
(config)[source]¶ Configures the tracking system. :param: A dictionary containing configuration data :return: The tracker object :raises: KeyError if no tracker entry in config
-
sksurgeryeval.algorithms.algorithms.
np2vtk
(mat)[source]¶ Converts a Numpy array to a vtk matrix :param: the number array, should be 4x4 :return: a vtk 4x4 matrix :raises: ValueError when matrix is not 4x4
-
sksurgeryeval.algorithms.algorithms.
point_in_locator
(point, point_locators, radius=1.0)[source]¶ Tests whether a point is within a set distance of any of a list of point locators.
Parameters: - point – the point to test, in 3D (x,y,z)
- point_locators – a list of vtkPointLocators
- radius – optional search radius in mm (default=1.0)
Return locator: the index of the nearest point locator,
-1 if no locators within radius) :return distance: distance to nearest point_locator
Raises: delegates to vtk
-
sksurgeryeval.algorithms.algorithms.
populate_models
(config)[source]¶ Loads vtk models from a directory and returns a list of vtk actors and associated vtkPointLocators
Param: configuration, should contain a target value Param: model_to_world: 4x4 matrix, of dtype float32 Returns: locators Returns: actors Raises: KeyError if target not in config