Fiducial Registration Educational Demonstration

Author: Stephen Thompson
This is the Fiducial Registration Educational Demonstration (SciKit-SurgeryFRED). This version uses a graphical user interface based on Matplotlib and has been superseded by the browser based version at SciKit-SurgeryFRED.
Fiducial Registration Educational Demonstration (SciKit-SurgeryFRED) 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).
Fiducial Registration Educational Demonstration is tested with Python 3.X
Fiducial Registration Educational Demonstration is intended to be used as part of an online tutorial in using fiducial based registration. The tutorial covers the basic theory of fiducial based registration, which is used widely in image guided interventions. The tutorial aims to help the students develop an intuitive understanding of key concepts in fiducial based registration, including Fiducial Localisation Error, Fiducial Registration Error, and Target Registration Error.
python sksurgeryfred.py
Please explore the project structure, and implement your own functionality.
Citing
If you use SciKit-SurgeryFRED in your research or teaching please cite it. Individual releases can be cited via the Zenodo tag. SciKit-Surgery should be cited as:
Thompson S, Dowrick T, Ahmad M, et al. “SciKit-Surgery: compact libraries for surgical navigation.” International Journal of Computer Assisted Radiology and Surgery. 2020 May. DOI: 10.1007/s11548-020-02180-5.
Developing
Cloning
You can clone the repository using the following command:
git clone https://github.com/SciKit-Surgery/scikit-surgeryfredmatplotlib
Running tests
Pytest is used for running unit tests:
pip install pytest
python -m pytest
Linting
This code conforms to the PEP8 standard. Pylint can be used to analyse the code:
pip install pylint
pylint --rcfile=tests/pylintrc sksurgeryfredmatplotlib
Installing
You can pip install directly from the repository as follows:
pip install git+https://github.com/SciKit-Surgery/scikit-surgeryfredmatplotlib
Contributing
Please see the contributing guidelines.
Useful links
Licensing and copyright
Copyright 2020 University College London. Fiducial Registration Educational Demonstration is released under the BSD-3 license. Please see the license file for details.
Acknowledgements
Supported by Wellcome and EPSRC.
Requirements for Fiducial Registration Educational Demonstration
This is the software requirements file for Fiducial Registration Educational Demonstration, part of the SNAPPY project. The requirements listed below should define what Fiducial Registration Educational Demonstration 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
sksurgeryfredmatplotlib package
Subpackages
sksurgeryfredmatplotlib.algorithms package
Functions for point based registration using Orthogonal Procrustes.
Functions to support MedPhys Taught Module workshop on calibration and tracking
Fit a contour to an image
- sksurgeryfredmatplotlib.algorithms.fit_contour.find_outer_contour(image, alpha=0.015, beta=10.0)[source]
Fits an active contour to the outer most edge in the image :params image: the image to fit to :params alpha: Snake length shape parameter. Higher values makes
snake contract faster (default 0.015)
- Params beta
Snake smoothness shape parameter. Higher values makes snake smoother (default 10.0)
- Returns
the resulting contour and the initialising contour
sksurgeryfredmatplotlib.logging package
Class to handle sksurgeryfred logging
- class sksurgeryfredmatplotlib.logging.fred_logger.Logger(config)[source]
Bases:
object
Implements logging functionality for sksurgeryfred. Configuration is done by passing a dictionary on construction. Subsequent calls to log(“message”) will write to log file.
- Parameters
config –
a dictionary containing configuration
parameters. If dictionary contains no “logger” entry then an empty logger is created and subsequent calls to log() will have no effect. Otherwise a logger is created according to the entries in the logger config dictionary. (“log file name”, “overwrite existing”
- Raises
IOError if the user can’t write to the named log file?
sksurgeryfredmatplotlib.plotting package
Functions to support MedPhys Taught Module workshop on calibration and tracking
- class sksurgeryfredmatplotlib.plotting.interactive_plots.PlotRegStatistics(plot)[source]
Bases:
object
writes the registration statistics
Plotting functions for scikit-surgeryFRED
sksurgeryfredmatplotlib.ui package
User interfaces for sksurgeryFRED
Command line processing
User interfaces for sksurgeryFRED
Command line processing
User interfaces for sksurgeryFRED
Command line processing
Fiducial Registration Educational Demonstration
sksurgeryfredmatplotlib.widgets package
The main widget for the interactive registration part of scikit-surgeryFRED
The main widget for the interactive registration part of scikit-surgeryFRED
- class sksurgeryfredmatplotlib.widgets.interactive_registration.InteractiveRegistration(image_file_name, headless=False)[source]
Bases:
sksurgeryfredmatplotlib.widgets.fred_common.FredCommon
an interactive window for doing live registration
The main widget for the interactive registration part of scikit-surgeryFRED
- class sksurgeryfredmatplotlib.widgets.registration_game.RegistrationGame(image_file_name, headless=False)[source]
Bases:
sksurgeryfredmatplotlib.widgets.fred_common.FredCommon
an interactive window for doing live registration
Module contents
FiducialRegistrationEducationalDemonstration
sksurgeryfredmatplotlib_game module
sksurgeryfredmatplotlib_plotter module
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("../../")