scikit-surgery-evaluation¶

Author: Stephen Thompson
scikit-surgery-evaluation provides an application to evaluate surgical skills. You can provide a set of unstructured grids representing a set of locations that the user is then expected to target using a tracked pointer, utilising a SciKit-Surgery tracking library (scikit-surgeryarucotracker, or scikit-surgerynditracker). You can specify paths for the user to follow, or let the system select target meshes automatically.
scikit-surgery-evaluation 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-surgery-evaluation supports Python 3.X.
python sksurgeryeval.py -c configuration.json
Developing¶
Cloning¶
You can clone the repository using the following command:
git clone https://github.com/SciKit-Surgery/scikit-surgery-evaluation
Linting¶
This code conforms to the PEP8 standard. Pylint can be used to analyse the code:
pip install pylint
pylint --rcfile=tests/pylintrc sksurgeryeval
Installing¶
You can pip install directly from the repository as follows:
pip install git+https://github.com/SciKit-Surgery/scikit-surgery-evaluation
Contributing¶
Please see the contributing guidelines.
Useful links¶
Licensing and copyright¶
Copyright 2019 University College London. scikit-surgery-evaluation is released under the BSD-3 license. Please see the license file for details.
Acknowledgements¶
Supported by Wellcome and EPSRC.
Requirements for scikit-surgery-evaluation¶
This is the software requirements file for scikit-surgery-evaluation, part of the SNAPPY project. The requirements listed below should define what scikit-surgery-evaluation 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. |
latest¶
sksurgeryeval package¶
Subpackages¶
sksurgeryeval.algorithms package¶
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
A class to provide the background image
sksurgeryeval.logging package¶
Class to handle logging
sksurgeryeval.shapes package¶
VTK pipeline to represent a surface model via a vtkPolyData.
sksurgeryeval.ui package¶
scikit-surgery-evaluation
sksurgeryeval.widgets package¶
Module contents¶
scikit-surgery-evaluation
First notebook¶
You can write up experiments in notebooks, and they can be generated into Sphinx docs using tox -e docs
, and for example set up to run on readthedocs.
NOTE:¶
Getting jupyter to run your code in this package relies on 3 things:
- You must ensure you start jupyter within the tox environment.
# If not already done.
source .tox/py36/bin/activate
# Then launch jupyter
jupyter notebook
- Then when you navigate to and run this notebook, select the right kernel (named after your project) from the kernel menu item, in the web browser.
- Add project folder to system path, as below.
[1]:
# Jupyter notebook sets the cwd to the folder containing the notebook.
# So, you want to add the root of the project to the sys path, so modules load correctly.
import sys
sys.path.append("../../")