Skip to content

Commit

Permalink
Merge pull request #22 from SciKit-Surgery/20-docs
Browse files Browse the repository at this point in the history
20 docs
  • Loading branch information
thompson318 authored Jan 6, 2022
2 parents 6fa6bad + f95c16d commit 43aeb36
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 104 deletions.
63 changes: 41 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ glenoidplanefitting
:target: https://github.com/SciKit-Surgery/glenoidplanefitting
:alt: Logo


|
.. image:: https://github.com/SciKit-Surgery/glenoidplanefitting/workflows/.github/workflows/ci.yml/badge.svg
:target: https://github.com/SciKit-Surgery/glenoidplanefitting/actions
:alt: GitLab-CI test status
Expand All @@ -19,22 +22,49 @@ glenoidplanefitting
:target: http://glenoidplanefitting.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://img.shields.io/badge/Cite-SciKit--Surgery-informational
:target: https://doi.org/10.1007/s11548-020-02180-5
:alt: The SciKit-Surgery paper

.. image:: https://img.shields.io/badge/-SciKit%20Surgery-blueviolet?style=flat&logo=youtube
:target: https://youtu.be/0z8eIjqAbzQ
:alt: SciKit-Surgery on YouTube

.. image:: https://img.shields.io/twitter/url?style=social&url=http%3A%2F%2Fscikit-surgery.org
:target: https://twitter.com/intent/tweet?screen_name=scikit_surgery&ref_src=twsrc%5Etfw
:alt: Get in touch via twitter

Author: Asta Olafsdottir
.. image:: https://img.shields.io/twitter/follow/scikit_surgery?style=social
:target: https://twitter.com/scikit_surgery?ref_src=twsrc%5Etfw
:alt: Follow scikit_surgery on twitter

glenoidplanefitting 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)`_.
.. image:: https://img.shields.io/badge/-See%20us%20at%20SPIE%20202-yellow?style=flat
:target: https://spie.org/conferences-and-exhibitions/medical-imaging/program
:alt: SPIE Medical Imaging 2022

glenoidplanefitting supports Python 2.7 and Python 3.6.
Authors: Asta Olafsdottir, Stephen Thompson

glenoidplanefitting is currently a demo project, which will add/multiply two numbers. Example usage:
glenoidplanefitting provides tools for measuring the Glenoid version, useful when
planning reconstructive shoulder surgery.
glenoidplanefitting 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)`_, in collaboration with surgeons at the
Royal National Orthopaedic Hospital

glenoidplanefitting is tested on Python 3.x, but may work with other versions of Python

glenoidplanefitting currently requires the user to manually identify relevant anatomical
landmarks on the scapula and glenoid dish. These points can then be passed to
glenoidplanefitting to calculate the Glenoid version using multiple methods. Example usage:

::

python glenoidplanefitting.py 5 8
python glenoidplanefitting.py 3 6 --multiply
python glenoidplanefitting.py --fried_points landmark_friedman.fcsv --output friedman.vtp --visualise glenoid.vtp

Please explore the project structure, and implement your own functionality.
glenoidplanefitting is a work in progress with plans to automate the point picking to create
software to enable a large scale comparison of different methods of Glenoid version
methods on a clinical data set. If you are interested in contributing to this work
please get in touch or follow the guides below.

Developing
----------
Expand All @@ -51,22 +81,11 @@ You can clone the repository using the following command:

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:

We use tox to run tests and run static code analysis using Lint.
::

pip install pylint
pylint --rcfile=tests/pylintrc glenoidplanefitting
pip install tox
python -m tox


Installing
Expand Down Expand Up @@ -109,7 +128,7 @@ Supported by `Wellcome`_ and `EPSRC`_.
.. _`Wellcome EPSRC Centre for Interventional and Surgical Sciences`: http://www.ucl.ac.uk/weiss
.. _`source code repository`: https://github.com/SciKit-Surgery/glenoidplanefitting
.. _`Documentation`: https://glenoidplanefitting.readthedocs.io
.. _`scikit-surgery`: https://github.com/UCL/scikit-surgery/wiki
.. _`scikit-surgery`: http://scikit-surgery.github.io/scikit-surgery/
.. _`University College London (UCL)`: http://www.ucl.ac.uk/
.. _`Wellcome`: https://wellcome.ac.uk/
.. _`EPSRC`: https://www.epsrc.ac.uk/
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
root_dir_abs = os.path.abspath(root_dir_rel)
module_path = root_dir_abs
sys.path.insert(0, module_path)
logo_file = 'project-icon.png'
logo_file = 'skglenoid_logo.png'
logo_path = os.path.join('..', logo_file)

# List of patterns, relative to source directory, that match files and
Expand Down Expand Up @@ -90,7 +90,7 @@ def setup(app):
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.imgmath', 'nbsphinx']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.imgmath', 'nbsphinx', 'sphinx.ext.graphviz']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
25 changes: 25 additions & 0 deletions docs/dependency_graph.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
digraph prof {
ratio = fill;
node [style=filled];
"SciKit-SurgeryGlenoid" -> "NumPy";
"SciKit-SurgeryGlenoid" -> "SciKit-SurgeryVTK" [color="0.515 0.762 0.762"];
"SciKit-SurgeryGlenoid" -> "VTK";

"SciKit-SurgeryVTK" -> "NumPy";
"SciKit-SurgeryVTK" -> "VTk";
"SciKit-SurgeryVTK" -> "PySide2";
"SciKit-SurgeryVTK" -> "OpenCV-contrib-python";
"SciKit-SurgeryVTK" -> "SciKit-SurgeryCore" [color="0.515 0.762 0.762"];
"SciKit-SurgeryVTK" -> "SciKit-SurgeryImage" [color="0.515 0.762 0.762"];

"SciKit-SurgeryImage" -> "NumPy";
"SciKit-SurgeryImage" -> "OpenCV-contrib-python";
"SciKit-SurgeryImage" -> "SciKit-SurgeryCore" [color="0.515 0.762 0.762"];
"SciKit-SurgeryCore" -> "NumPy";

"SciKit-SurgeryGlenoid" [color="0.515 0.762 0.762"];
"SciKit-SurgeryVTK"[color="0.515 0.762 0.762"];
"SciKit-SurgeryImage"[color="0.515 0.762 0.762"];
"SciKit-SurgeryCore"[color="0.515 0.762 0.762"];
}

12 changes: 12 additions & 0 deletions docs/dependency_graph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. highlight:: shell

.. _Dependency Graph:

===============================================
Dependency Graph
===============================================

.. graphviz:: dependency_graph.dot
:caption: glenoidplanefitting's Dependencies
:align: center

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Contents
.. toctree::
:maxdepth: 1

dependency_graph
Module Contents <modules>
notebooks/first_notebook

* :ref:`modindex`
* :ref:`genindex`
Expand Down
66 changes: 0 additions & 66 deletions docs/notebooks/first_notebook.ipynb

This file was deleted.

5 changes: 3 additions & 2 deletions glenoidplanefitting/algorithms/friedman.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
This is an implentation of Friedman's method, see
Friedman RJ, Hawthorne KB and Genez BM.
The use of computerized tomography in the measurement
of glenoid version. J Bone and Joint Surg Am 1992; 74: 1032–7.
`The use of computerized tomography in the measurement
of glenoid version. <https://pubmed.ncbi.nlm.nih.gov/1522089/>`_
J Bone and Joint Surg Am 1992; 74: 1032–7.
"""

Expand Down
7 changes: 5 additions & 2 deletions glenoidplanefitting/algorithms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def make_plane_model(plane_centre, normal_vector, resolution = 10,
plane_size = 200.0):
"""
Makes a vtk plane source, with centre and normal vector
:param plane_centre: a point on the plane
:param normal_vector: the plane normal vector
Expand All @@ -26,7 +27,8 @@ def make_plane_model(plane_centre, normal_vector, resolution = 10,
def make_friedman_model(point1, point2):

"""
Makese a vtk line source from two set points
Makes a vtk line source from two set points
:param point1: one end of the line
:param point2: other end of the line
Expand All @@ -42,7 +44,8 @@ def make_friedman_model(point1, point2):
def make_vault_model(point1,point2):

"""
Makese a vtk line source from two set points
Makes a vtk line source from two set points
:param point1: one end of the line
:param point2: other end of the line
Expand Down
3 changes: 2 additions & 1 deletion glenoidplanefitting/algorithms/plane_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
This is an implementation of a two plane method, see
A. Ganapathi, J. McCarron, Chen, J. Iannotti.
Predicting normal glenoid version from the pathologic scapula:
`Predicting normal glenoid version from the pathologic scapula:
a comparison of 4 methods in 2- and 3-dimensional models
<https://doi.org/10.1016/j.jse.2010.05.024>`_
J Shoulder Elbow Surg (2011) 20, 234-244
"""
Expand Down
3 changes: 2 additions & 1 deletion glenoidplanefitting/algorithms/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
This is an implentation of the vault method, see
Matsumura N et al.
Computed tomography measurement of glenoid vault version
`Computed tomography measurement of glenoid vault version
as an alternative measuring method for glenoid version.
<https://doi.org/10.1186/1749-799x-9-17>`_
Journal of Orthopaedic Surgery and Research 2014, 9:17
"""
Expand Down
17 changes: 11 additions & 6 deletions glenoidplanefitting/widgets/visualisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def renderer_common(bone):
def render_window_common(renderer, window_name):
"""
Creates and starts a render window and interactor.
:param renderer: A vtk renderer to add to the render window
:param window_name: A name for the window
"""
Expand All @@ -43,8 +44,9 @@ def render_window_common(renderer, window_name):
def add_vtk_source(renderer, source):
"""
simplifies adding a vtk geometry source to a renderer
:params renderer: a vtk renderer to add to
:params source: a vtk geometry source
:param renderer: a vtk renderer to add to
:param source: a vtk geometry source
"""
mapper = vtk.vtkPolyDataMapper() #pylint:disable=no-member
mapper.SetInputConnection(source.GetOutputPort())
Expand All @@ -55,6 +57,7 @@ def add_vtk_source(renderer, source):
def vis_planes(bone, planes):
"""
Visualisation for plane fitting methods
:param bone: The model surface model
:param planes: a list of planes, as returned by the
plane fitting methods in algorithms.plane_fitting
Expand All @@ -71,8 +74,9 @@ def vis_fried(bone, cross1, cross2, glenoid1, result):
"""
Visualise the lines resulting from the friedman
method.
:params cross1, cross2: The end points of the line crossing the glenoid
:params glenoid1, result: The end points of the line defining the glenoid
:param cross1, cross2: The end points of the line crossing the glenoid
:param glenoid1, result: The end points of the line defining the glenoid
version
"""
renderer = renderer_common(bone)
Expand All @@ -90,8 +94,9 @@ def vis_vault(bone, cross1, cross2, glenoid1, result):
"""
Visualise the lines resulting from the vault
method.
:params cross1, cross2: The end points of the line crossing the glenoid
:params glenoid1, result: The end points of the line defining the glenoid
:param cross1, cross2: The end points of the line crossing the glenoid
:param glenoid1, result: The end points of the line defining the glenoid
version
"""
renderer = renderer_common(bone)
Expand Down
Binary file removed project-icon.png
Binary file not shown.
Binary file modified skglenoid_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ commands=pylint --rcfile=tests/pylintrc glenoidplanefitting tests

[testenv:docs]
basepython=python3.8
changedir = doc
changedir = docs
commands = sphinx-build -M html . build

[testenv:installer]
Expand Down

0 comments on commit 43aeb36

Please sign in to comment.