scikit-surgeryopencvcpp
scikit-surgeryopencvcpp implements image guided surgery algorithms, using OpenCV, in C++ and wrapped in Python.
scikit-surgeryopencvcpp is part of the
SNAPPY software project,
developed at the Wellcome EPSRC Centre for Interventional and Surgical Sciences,
part of University College London (UCL).
Features
Installing
You can pip install the latest Python package as follows:
pip install scikit-surgeryopencvcpp
Examples
Surface Reconstruction
pip install pptk opencv-python scikit-surgeryopencvcpp
python
import sksurgeryopencvpython as skscv
import pptk
import numpy as np
import cv2
left_image = cv2.imread('Testing/Data/reconstruction/f7_dynamic_deint_L_0100.png')
right_image = cv2.imread('Testing/Data/reconstruction/f7_dynamic_deint_R_0100.png')
left_intrinsics = np.loadtxt('Testing/Data/reconstruction/calib.left.intrinsic.txt')
right_intrinsics = np.loadtxt('Testing/Data/reconstruction/calib.right.intrinsic.txt')
l2r = np.loadtxt('Testing/Data/reconstruction/calib.l2r.4x4')
rotation_matrix = l2r[0:3, 0:3]
translation_vector = l2r[0:3, 3:4]
points = skscv.reconstruct_points_using_stoyanov(left_image, left_intrinsics, right_image, right_intrinsics, rotation_matrix, translation_vector, False)
points_3d = points[:,0:3]
v = pptk.viewer(points_3d)
Developing
Cloning
You can clone the repository using the following command:
git clone https://github.com/UCL/scikit-surgeryopencvcpp.git
Build instructions
Still not for the faint-hearted. It depends if you are a C++ developer familiar
with CMake or a hybrid C++/Python developer primarily interested in writing
Python extensions.
The simplest advice really is to read appveyor.yml
, as this will always
be up to date.
Preferred Branching Workflow for Contributions.
We welcome contributions to this project. Please use the following workflow.
- Raise issue in this project's Github Issue Tracker.
- Fork repository.
- Create a feature branch called
<issue-number>-<some-short-description>
replacing <issue-number>
with the Github issue number
and <some-short-description>
with your description of the thing you are implementing. - Code on that branch.
- Push to your remote when ready.
- Create pull request.
- We will review code, suggest and required changes and merge to master when it is ready.
Dashboards
In addition to Travis and Appveyor builds, C++ results are also
submitted to a public CDash dashboard.
Licensing and copyright
Copyright 2018 University College London.
scikit-surgeryopencvcpp is released under the BSD-3 license.
Please see the license file for details.
Acknowledgements
Supported by Wellcome and the EPSRC.
The project was generated, using
CMakeCatchTemplate
and CMakeTemplateRenamer.