Skip to content

Commit

Permalink
Merge pull request #117 from SciKit-Surgery/115-final-release-2.0.0
Browse files Browse the repository at this point in the history
115 - final release 1.0.0
  • Loading branch information
mxochicale committed Jun 27, 2023
2 parents e6cf31d + 57c70c0 commit 3a4ec2f
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
sudo apt-get update
sudo apt-get install xvfb
sudo apt-get install libegl-dev
sudo apt-get install libxcb-cursor-dev
## Qt for X11 Requirements> https://doc.qt.io/qt-6/linux-requirements.html
sudo apt-get install libfontconfig1-dev libfreetype6-dev
sudo apt-get install libx11-dev libx11-xcb-dev
Expand All @@ -99,6 +100,7 @@ jobs:
export DISPLAY=:1
sudo Xvfb $DISPLAY -screen 0 1024x768x24 </dev/null &
export QT_DEBUG_PLUGINS=0
export QT_QPA_PLATFORM=xcb
export LD_LIBRARY_PATH=$pythonLocation"/lib/python${{ matrix.python-version }}/site-packages/PySide6/Qt/plugins/platforms"
coverage erase
coverage run -a --source ./sksurgerybard -m pytest -v -s
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ build/
dist/
tests/output/
pointer_positions/

# Generated bard models with tox
bard_model2modelref.txt
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: doc/conf.py
fail_on_warning: false

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements-docs.txt
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Basic Augmented Reality Demo.
:alt: Follow scikit_surgery on twitter


Author(s): Stephen Thompson and Matt Clarkson;
Contributor(s): Miguel Xochicale, Thomas Dowrick, and Mian Ahmad.
Author(s): Miguel Xochicale, Thomas Dowrick, Stephen Thompson and Matt Clarkson;
Contributor(s): Mian Ahmad.

Basic Augmented Reality Demo (BARD) 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)`_.

Expand Down
8 changes: 8 additions & 0 deletions doc/02_0_Build_Your_Own_Systems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,51 @@ Build Your Own Image Guided Surgery System

3. Get B.A.R.D.
::

git clone https://github.com/SciKit-Surgery/scikit-surgerybard.git

or navigate to https://github.com/SciKit-Surgery/scikit-surgerybard
and use the download button

navigate to the scikit-surgerybard directory and run
::

pip install .

You may need to add
::

pip install --user

if you don't have administrative permissions.

**Another method to get BARD and all its dependant packages is the following**
::

git clone https://github.com/SciKit-Surgery/scikit-surgerybard.git

Change directory to the newly created `scikit-surgerybard` by
::

cd scikit-surgerybard

Run the tox commands
::

tox

If tox run successfully,
For Mac and Linux, activate the virtual environment using command
::

source .tox/py36/bin/activate

If all goes well the prompt should be preceded by (py36).


For Windows, activate the virtual environment using command
::

.tox\py36\Scripts\activate

If all goes well the prompt should be preceded by (py36).
Expand Down
7 changes: 5 additions & 2 deletions doc/02_1_Calibrate_Your_Camera.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ or write a script to make one.

Take 5-20 pictures of chessboard using:
::

python bardVideoCalibration.py -c config/video_calib_chessboard.json

Hit the 'c' key to capture an image. Press the 'q' key to quite the application.
Expand All @@ -48,12 +49,14 @@ in the terminal window.
Often, in a research setting, it is best to save the data for later
analysis. The same program can be used to save the data to a given folder.

Use the '-s' option to specify a directory to save to, and the
'-p' option to specify a filename prefix.
Use the '-o' option to specify a directory to save to, the
'-p' option to specify a filename prefix, and '-h' option to show help message and exit.

For example:
::

python bardVideoCalibration.py -c config/video_calib_chessboard.json -s tests/output -p myresults
#usage: bardVideoCalibration.py [-h] -c CONFIG [-s SOURCE] [-o OUTPUT] [-p PREFIX] [-ni] [-v]

Then, each time the program recalibrates, the results will be saved to the 'tests/output' folder, with the filename prefix 'myresults'.

Expand Down
4 changes: 3 additions & 1 deletion doc/02_2_Tracking_With_AuRcoTags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ OpenCV.

1. Try running the following, and check that the USB camera can track the reference marker
::

python sksurgerybard.py --config config/example_config.json


Expand All @@ -36,7 +37,8 @@ a registration to be performed once. Here we have glued the marker to the phanto
so model2reference should not change.

Now try running
::
::

python sksurgerybard.py --config config/reference_with_model.json

Move the webcam so that the reference markers are visible, and you should see
Expand Down
5 changes: 5 additions & 0 deletions doc/02_3_Make_Your_Own_Pointer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ can be reliably located in both the model (e.g. CT scan) and patient (i.e. physi
Within the data directory there are files based on a CT scan of the
pelvis phantom.
::

ls data/PelvisPhantom
CT_Fiduicial_Markers.txt
FullPelvis.vtk
Expand All @@ -36,6 +37,7 @@ pointer, using the "pointer" markers, a pen, some cardboard and some sort of adh

Now run this:
::

python sksurgerybard.py --config config/pointer_markers.json

Move the pointer around in front of the camera. You should be able to see that
Expand All @@ -49,6 +51,7 @@ move either the pointer tip or the tracking system (webcam).

When you have a directory of pointer matrices you can run this;
::

python bardPivotCalibration.py --help
python bardPivotCalibration.py --input pointer_positions/bard_pointer_matrices

Expand All @@ -63,13 +66,15 @@ less pointer poses.

Now edit config/pointer_markers.json to include the the pointer_tag_to_tip transform, within the pointerData entry:
::

"pointerData": {
"pointer_tag_file": "data/pointer.txt",
"pointer_tag_to_tip": "data/pointer_tip.txt"
},

Now run;
::

python sksurgerybard.py --config config/pointer_markers.json

When you place the pointer in front of the camera, you should now see an additional sphere
Expand Down
3 changes: 3 additions & 0 deletions doc/02_4_Register_And_Ovelay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ Create a plain text-file containing the coordinates of the prostate phantom fidu

Compute the registration of CT points in CT_Fiduicial_Markers.txt to your world points, run this;
::

python bardProcrustes.py -f world.txt -m data/PelvisPhantom/CT_Fiduicial_Markers.txt

So here -f stands for "fixed" points, also called "target" points in the literature, and -m stands for "moving" points, also called "source" points in the literature.
This will output a rotation, a translation, and Fiducial Registration Error.
Cut and paste the rotation and translation into a CT_to_world.txt file as
::

R11 R12 R13 T1
R21 R22 R23 T2
R31 R31 R33 T3
Expand All @@ -25,6 +27,7 @@ and edit config/reference_with_model.json to use this file instead of data/id.tx

Rerun BARD using this configuration file, using:
::

python sksurgerybard.py --config config/reference_with_model.json

and see what happens.
Expand Down
27 changes: 3 additions & 24 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,6 @@
html_static_path = [static_folder]


def generate_apidocs(*args):
"""Generate API docs automatically by trawling the available modules"""

global working_dir, module_path
output_path = working_dir
apidoc_command_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # called from a virtualenv
apidoc_command_path = os.path.join(sys.prefix, 'bin', 'sphinx-apidoc')
apidoc_command_path = os.path.abspath(apidoc_command_path)
subprocess.check_call(
[apidoc_command_path, '--force', '--separate'] +
['-o', output_path, module_path] +
[os.path.join(root_dir_abs, pattern) for pattern in exclude_patterns])


def setup(app):
# Hook to allow for automatic generation of API docs
# before doc deployment begins.
app.connect('builder-inited', generate_apidocs)


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -115,9 +94,9 @@ def setup(app):
# built documents.
#
# The short X.Y version.
version = u''
version = u'1.0.0'
# The full version, including alpha/beta/rc tags.
release = u''
release = u'1.0.0'

# The short X.Y version.
# version = sksurgerybard.__version__
Expand All @@ -129,7 +108,7 @@ def setup(app):
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# language = None

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand Down
2 changes: 0 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ mock
pyfakefs
parameterized
pylint<=2.17.0
sphinx
sphinx_rtd_theme
pyinstaller
pytest
tox
Expand Down
5 changes: 5 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements.txt
six
docutils
sphinx
sphinx_rtd_theme
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# doc/requirements.rst
numpy
glob2
pyside6>=6.4.2
pyside6>=6.5.1.1
scikit-surgerycalibration>=0.2.4
scikit-surgerycore>=0.6.10
scikit-surgeryutils==2.0rc0
scikit-surgeryvtk==2.0rc0
scikit-surgeryutils>=2.0.0
scikit-surgeryvtk>=2.0.1
scikit-surgeryarucotracker>=1.0.1
opencv-contrib-python-headless>=4.2.0.32
#scikit-surgeryspeech>=0.2.0 #uncomment this to use speech interface
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
'based on scikit-surgery (SNAPPY)',
long_description=long_description,
long_description_content_type='text/x-rst',
url='https://github.com/SciKit-Surgery/'
'scikit-surgerybard',
url='https://github.com/SciKit-Surgery/scikit-surgerybard',
# Authors: Miguel Xochicale, Thomas Dowrick, Stephen Thompson, Matt Clarkson
author='Stephen Thompson',
author_email='[email protected]',
license='BSD-3 license',
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 5 - Production/Stable',

'Intended Audience :: Developers',
'Intended Audience :: Healthcare Industry',
Expand All @@ -36,7 +36,7 @@


'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',

'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Scientific/Engineering :: Medical Science Apps.',
Expand All @@ -55,12 +55,12 @@
install_requires=[
'numpy',
'glob2',
'pyside6>=6.4.2',
'pyside6>=6.5.1.1',
'opencv-contrib-python-headless>=4.2.0.32',
'scikit-surgerycore>=0.6.10',
'scikit-surgerycalibration>=0.2.4',
'scikit-surgeryutils==2.0rc0',
'scikit-surgeryvtk==2.0rc0',
'scikit-surgeryutils>=2.0.0',
'scikit-surgeryvtk>=2.0.1',
'scikit-surgeryarucotracker>=1.0.1',
],

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ commands=pylint --rcfile=tests/pylintrc --extension-pkg-whitelist=PySide6,vtk,cv
[testenv:docs]
basepython=python3.8
changedir = doc
deps=-rrequirements-docs.txt
commands = sphinx-build -M html . build

[testenv:installer]
Expand Down

0 comments on commit 3a4ec2f

Please sign in to comment.