Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
WEISS
Software Repositories
SNAPPY
scikit-surgerydavinci
Commits
ff702cd8
Commit
ff702cd8
authored
Mar 28, 2019
by
Thomas Dowrick
Browse files
Add button/callback to use cropping functions
parent
0b37b55e
Pipeline
#1847
failed with stages
in 20 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sksurgerydavinci/ui/gui.py
View file @
ff702cd8
...
...
@@ -42,6 +42,7 @@ class UI(QWidget):
self
.
layout
.
addLayout
(
self
.
other_buttons
)
self
.
add_exit_button
()
self
.
add_record_buttons
()
self
.
add_crop_buttons
()
self
.
screen
=
None
self
.
screen_geometry
=
None
...
...
@@ -95,6 +96,11 @@ class UI(QWidget):
self
.
record_buttons_layout
.
addWidget
(
self
.
record_button
)
self
.
other_buttons
.
addLayout
(
self
.
record_buttons_layout
)
def
add_crop_buttons
(
self
):
""" Add buttons to crop the video stream. """
self
.
crop_button
=
QPushButton
(
'Crop'
)
self
.
other_buttons
.
addWidget
(
self
.
crop_button
)
def
on_exit_clicked
(
self
):
""" Close the application when the exit button has been clicked"""
...
...
sksurgerydavinci/widgets/Viewers.py
View file @
ff702cd8
...
...
@@ -5,6 +5,7 @@ from PySide2 import QtWidgets
from
sksurgeryvtk.widgets.vtk_overlay_window
import
VTKOverlayWindow
from
sksurgeryutils.common_overlay_apps
import
OverlayOnVideoFeed
from
sksurgeryutils.utils.screen_utils
import
ScreenController
from
sksurgeryimage.processing.crop
import
ImageCropper
from
sksurgerydavinci.ui.gui
import
UI
LOGGER
=
logging
.
getLogger
(
__name__
)
...
...
@@ -58,6 +59,7 @@ class MonoViewer(QtWidgets.QWidget):
self
.
UI
=
UI
(
self
.
overlay_window
)
self
.
UI
.
screenshot_button
.
clicked
.
connect
(
self
.
on_screenshot_clicked
)
self
.
UI
.
record_button
.
clicked
.
connect
(
self
.
on_record_start_clicked
)
self
.
UI
.
crop_button
.
clicked
.
connect
(
self
.
on_crop_clicked
)
def
add_vtk_models
(
self
,
models
):
"""
...
...
@@ -90,6 +92,14 @@ class MonoViewer(QtWidgets.QWidget):
self
.
UI
.
record_button
.
clicked
.
disconnect
()
self
.
UI
.
record_button
.
clicked
.
connect
(
self
.
on_record_start_clicked
)
def
on_crop_clicked
(
self
):
""" Crop the incoming video stream using ImageCropper. """
roi
=
ImageCropper
().
crop
(
self
.
overlay_window
.
img
)
self
.
overlay_window
.
set_roi
(
roi
)
class
StereoViewerBase
(
QtWidgets
.
QWidget
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment