scikit-surgerytrackervisualisation¶

Author: Stephen Thompson
scikit-surgerytrackervisualisation is part of the SciKit-Surgery software project, developed at the Wellcome EPSRC Centre for Interventional and Surgical Sciences, part of University College London (UCL).
scikit-surgerytrackervisualisation supports Python 2.7 and Python 3.6.
scikit-surgerytrackervisualisation implements a basic interface for showing tracking output from a SciKit-Surgery tracker.
python scikit-surgerytrackervisualisation.py
python scikit-surgerytrackervisualisation.py --config config.json
Please explore the project structure, and implement your own functionality.
Developing¶
Cloning¶
You can clone the repository using the following command:
git clone https://github.com/SciKit-Surgery/scikit-surgerytrackervisualisation
Linting¶
This code conforms to the PEP8 standard. Pylint can be used to analyse the code:
pip install pylint
pylint --rcfile=tests/pylintrc scikit-surgerytrackervisualisation
Installing¶
You can pip install directly from the repository as follows:
pip install git+https://github.com/SciKit-Surgery/scikit-surgerytrackervisualisation
Contributing¶
Please see the contributing guidelines.
Useful links¶
Licensing and copyright¶
Copyright 2019 University College London. scikit-surgerytrackervisualisation is released under the BSD-3 license. Please see the license file for details.
Acknowledgements¶
Supported by Wellcome and EPSRC.
Requirements for scikit-surgerytrackervisualisation¶
This is the software requirements file for scikit-surgerytrackervisualisation, part of the SNAPPY project. The requirements listed below should define what scikit-surgerytrackervisualisation does. Each requirement can be matched to a unit test that checks whether the requirement is met.
Requirements¶
ID | Description | Test |
---|---|---|
0000 | Module has a help page | pylint, see tests/pylint.rc and tox.ini |
0001 | Functions are documented | pylint, see tests/pylint.rc and tox.ini |
0002 | Package has a version number | No test yet, handled by git. |
stable¶
sksurgerytrackervisualisation package¶
Subpackages¶
sksurgerytrackervisualisation.algorithms package¶
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
A class to provide the background image
Algorithms for doing Iterative Closest Point
sksurgerytrackervisualisation.overlay_app package¶
Main loop for tracking visualisation
-
class
sksurgerytrackervisualisation.overlay_app.overlay.
OverlayApp
(config)[source]¶ Bases:
sksurgeryutils.common_overlay_apps.OverlayBaseApp
Inherits from OverlayBaseApp, adding code to move vtk models based on input from a scikitsurgery tracker. Adds a function to detect a key press event, (“g”) and add points to a point cloud.
sksurgerytrackervisualisation.shapes package¶
VTK pipeline to represent a surface model via a vtkPolyData.
Class to represent a point cloud via a vtkPolyData, with the ability to dynamically add points
-
class
sksurgerytrackervisualisation.shapes.dynamic_point_cloud.
VTKDynamicPointCloud
(colour, visibility=True, opacity=1.0)[source]¶ Bases:
sksurgeryvtk.models.vtk_base_model.VTKBaseModel
Class to represent a point cloud via a vtkPolyData, with the ability to dynamically add points
VTK pipeline to represent a surface model via a vtkPolyData.
Module contents¶
scikit-surgerytrackervisualisation