Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tomwer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olof Svensson
tomwer
Commits
7607f09e
Commit
7607f09e
authored
5 years ago
by
payno
Browse files
Options
Downloads
Patches
Plain Diff
[gui][axis] add an apply button
parent
26cde56b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
orangecontrib/tomwer/widgets/reconstruction/AxisOW.py
+17
-1
17 additions, 1 deletion
orangecontrib/tomwer/widgets/reconstruction/AxisOW.py
tomwer/app/axis.py
+10
-6
10 additions, 6 deletions
tomwer/app/axis.py
tomwer/gui/ftserie/axis/axis.py
+17
-1
17 additions, 1 deletion
tomwer/gui/ftserie/axis/axis.py
with
44 additions
and
8 deletions
orangecontrib/tomwer/widgets/reconstruction/AxisOW.py
+
17
−
1
View file @
7607f09e
...
...
@@ -37,7 +37,7 @@ from tomwer.core.process.reconstruction.axis import AxisProcess
from
tomwer.synctools.ftseries
import
QReconsParams
from
tomwer.gui.ftserie.axis
import
AxisWindow
from
tomwer.core.scan.scanbase
import
TomoBase
import
functools
import
logging
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -96,6 +96,21 @@ class AxisOW(widget.OWWidget, AxisProcess):
if
_connect_handler
:
self
.
settingsHandler
.
addCallback
(
self
.
_updateSettingsVals
)
# connect Signal / Slot
self
.
_widget
.
sigComputationRequested
.
connect
(
self
.
__compute
)
self
.
_widget
.
sigApply
.
connect
(
self
.
__validate
)
def
__compute
(
self
):
self
.
__lastAxisProcessParamsCache
=
self
.
recons_params
.
to_dict
()
AxisProcess
.
process
(
self
,
self
.
__scan
)
def
__validate
(
self
):
# if parameters has changed since last processing, reprocess axis method
if
self
.
recons_params
.
to_dict
()
!=
self
.
__lastAxisProcessParamsCache
:
self
.
__compute
()
self
.
signalReady
(
self
.
__scan
)
def
signalReady
(
self
,
scanID
):
assert
isinstance
(
scanID
,
TomoBase
)
self
.
send
(
"
data
"
,
scanID
)
...
...
@@ -110,6 +125,7 @@ class AxisOW(widget.OWWidget, AxisProcess):
assert
scan
.
tomo_recons_params
.
axis
is
not
None
self
.
signalReady
(
scan_res
)
else
:
self
.
__scan
=
scan
self
.
exec
()
def
_updateSettingsVals
(
self
):
...
...
This diff is collapsed.
Click to expand it.
tomwer/app/axis.py
+
10
−
6
View file @
7607f09e
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import
os
import
sys
import
argparse
from
silx.gui
import
qt
import
logging
import
signal
import
functools
from
tomwer.utils
import
getMainSplashScreen
from
tomwer.gui.ftserie.axis.axis
import
AxisWindow
from
tomwer.core.scan.scanfactory
import
ScanFactory
from
tomwer.synctools.ftseries
import
QReconsParams
import
os
import
sys
from
tomwer.core.process.reconstruction.axis
import
AxisProcess
class
_AxisProcessGUI
(
AxisProcess
,
AxisWindow
):
def
__init__
(
self
):
def
__init__
(
self
,
scan
):
recons_params
=
QReconsParams
()
AxisProcess
.
__init__
(
self
,
recons_params
=
recons_params
.
axis
)
AxisWindow
.
__init__
(
self
,
axis
=
recons_params
)
self
.
_lockBut
.
hide
()
self
.
_lockLabel
.
hide
()
self
.
_applyBut
.
hide
()
# connect Signal / Slot
callback
=
functools
.
partial
(
self
.
process
,
scan
)
self
.
sigComputationRequested
.
connect
(
callback
)
def
main
(
argv
):
...
...
@@ -59,8 +64,7 @@ def main(argv):
scan
=
ScanFactory
.
create_scan_object
(
scan_path
=
options
.
scan_path
)
window
=
_AxisProcessGUI
()
window
.
process
(
scan
=
scan
)
window
=
_AxisProcessGUI
(
scan
=
scan
)
splash
.
finish
(
window
)
window
.
show
()
app
.
exec_
()
...
...
This diff is collapsed.
Click to expand it.
tomwer/gui/ftserie/axis/axis.py
+
17
−
1
View file @
7607f09e
...
...
@@ -69,6 +69,13 @@ class AxisWindow(qt.QMainWindow):
widget.setImages(imgA=imgA, imgB=imgB, flipB=False)
widget.show()
"""
sigComputationRequested
=
qt
.
Signal
()
"""
signal emitted when a computation is requested
"""
sigApply
=
qt
.
Signal
()
"""
signal emitted when the axis reconstruction parameters are validated
"""
def
__init__
(
self
,
axis
,
parent
=
None
):
qt
.
QMainWindow
.
__init__
(
self
,
parent
)
if
isinstance
(
axis
,
_QAxisRP
):
...
...
@@ -110,7 +117,6 @@ class AxisWindow(qt.QMainWindow):
self
.
_buttons
.
layout
().
addWidget
(
self
.
_lockBut
)
self
.
_lockLabel
=
qt
.
QLabel
(
'
lock axis position
'
,
parent
=
self
)
self
.
_buttons
.
layout
().
addWidget
(
self
.
_lockLabel
)
self
.
_lockBut
.
toggled
.
connect
(
self
.
_lockAxisPosition
)
spacer
=
qt
.
QWidget
(
self
)
spacer
.
setSizePolicy
(
qt
.
QSizePolicy
.
Expanding
,
qt
.
QSizePolicy
.
Minimum
)
...
...
@@ -118,12 +124,19 @@ class AxisWindow(qt.QMainWindow):
self
.
_computeBut
=
qt
.
QPushButton
(
'
compute
'
,
parent
=
self
)
self
.
_buttons
.
layout
().
addWidget
(
self
.
_computeBut
)
style
=
qt
.
QApplication
.
style
()
applyIcon
=
style
.
standardIcon
(
qt
.
QStyle
.
SP_DialogApplyButton
)
self
.
_applyBut
=
qt
.
QPushButton
(
applyIcon
,
'
validate
'
,
parent
=
self
)
self
.
_buttons
.
layout
().
addWidget
(
self
.
_applyBut
)
self
.
_controlWidget
.
layout
().
addWidget
(
self
.
_buttons
)
# signal / slot connection
self
.
_controlWidget
.
sigShiftChanged
.
connect
(
self
.
_updateShift
)
self
.
_controlWidget
.
sigRoiChanged
.
connect
(
self
.
_updateShift
)
self
.
_controlWidget
.
sigAuto
.
connect
(
self
.
_updateAuto
)
self
.
_lockBut
.
toggled
.
connect
(
self
.
_lockAxisPosition
)
self
.
_computeBut
.
pressed
.
connect
(
self
.
_computationRequested
)
# expose API
self
.
getXShift
=
self
.
_controlWidget
.
getXShift
...
...
@@ -141,6 +154,9 @@ class AxisWindow(qt.QMainWindow):
# adapt gui to the axis value
self
.
setReconsParams
(
axis
=
self
.
__recons_params
)
def
_computationRequested
(
self
):
self
.
sigComputationRequested
.
emit
()
def
_lockAxisPosition
(
self
,
lock
):
raise
NotImplementedError
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment