sksurgerytrackervisualisation.algorithms.algorithms module

Algorithms used by the trackervisualisation module

sksurgerytrackervisualisation.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

sksurgerytrackervisualisation.algorithms.algorithms.make_offset_matrix(model_config)[source]

generates an offset (or handeye) matrix

Param:Model configuration
Returns:If valid offset specified, returns a 4x4 offset matrix, if no offset, returns identity.
Raises:ValueError
sksurgerytrackervisualisation.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

sksurgerytrackervisualisation.algorithms.algorithms.populate_models(model_config)[source]
Parses a model configuration dictionary, returning

a list of vtk actors and associated port handles

param:model config a list of dictionaries, one for each model dictionary entries are: name : a descriptive name port handle : the port handle of the associated tracker load : True if model is to be loaded from file filename : if load is true the filename to load from source : supported values are cylinder, sphere, cone colour : the rgb colour to use for the actor height : the height of the cylinder or cone radius : the diameter of the cylinder, cone, or sphere
Returns:a list of dictionaries, one for each model
Returns:port_handles
Returns:actors
Returns:transform_managers
Raises:KeyError if asked to load model without filename