Commit 2ddb371d authored by Thomas Dowrick's avatar Thomas Dowrick

Merge branch 'add-reslice-demo' into 'master'

Add reslice demo

See merge request WEISS/SoftwareRepositories/SNAPPY/scikit-surgeryutils!9
parents 71fc875a 72af4bd6
Pipeline #4214 canceled with stages
......@@ -58,6 +58,7 @@ setup(
'scikit-surgerycore>=0.1.7',
'scikit-surgeryimage>=0.2.0',
'scikit-surgeryvtk>=0.12.2',
'scikit-surgeryarucotracker>=0.0.4'
],
entry_points={
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from sksurgeryutils.ui.sksurgeryreslice_command_line import main
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
# coding=utf-8
""" Command line processing for charucotest app. """
import argparse
from sksurgeryutils import __version__
from sksurgeryutils.ui.sksurgeryreslice_demo import run_demo
def main(args=None):
"""Entry point for sksurgerytextoverlay application"""
parser = argparse.ArgumentParser(description='sksurgerytextoverlay')
version_string = __version__
friendly_version_string = version_string if version_string else 'unknown'
parser.add_argument(
"-v", "--version",
action='version',
version='sksurgerytextoverlay version ' + friendly_version_string)
parser.add_argument(
"-t", "--tracked",
required=False,
action="store_true",
help="Enable tracked demo")
parser.add_argument(
"-d", "--dicom_dir",
required=False,
default='tests/data/dicom/LegoPhantom_10slices',
type=str,
help="DICOM Directory")
args = parser.parse_args(args)
run_demo(args.tracked,
args.dicom_dir)
""" VTK Reslice widget demo. """
from PySide2 import QtWidgets
from sksurgeryvtk.widgets.vtk_reslice_widget import TrackedSliceViewer, \
MouseWheelSliceViewer
from sksurgeryarucotracker.arucotracker import ArUcoTracker
def run_demo(tracked, dicom_dir):
""" Demo """
app = QtWidgets.QApplication([])
if tracked:
tracker = ArUcoTracker({})
tracker.start_tracking()
slice_viewer = TrackedSliceViewer(dicom_dir, tracker)
else:
slice_viewer = MouseWheelSliceViewer(dicom_dir)
slice_viewer.start()
app.exec_()
......@@ -11,7 +11,6 @@ def main(args=None):
parser = argparse.ArgumentParser(description='sksurgerytextoverlay')
version_string = __version__
friendly_version_string = version_string if version_string else 'unknown'
parser.add_argument(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment