Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
d9213f62
Commit
d9213f62
authored
Jun 04, 2021
by
Julia Garriga Ferrer
Browse files
[orangecontrib] Add single transformation widget and remove rsm and magnification widgets
parent
82718d99
Changes
2
Hide whitespace changes
Inline
Side-by-side
orangecontrib/darfix/widgets/rsm.py
deleted
100644 → 0
View file @
82718d99
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__
=
[
"J. Garriga"
]
__license__
=
"MIT"
__date__
=
"31/05/2021"
from
Orange.widgets.widget
import
OWWidget
,
Input
,
Output
from
darfix.gui.rsmWidget
import
RSMWidget
class
RSMWidgetOW
(
OWWidget
):
"""
Widget that sums a stack of images by the z axis.
"""
name
=
"rsm"
icon
=
"icons/grainplot.png"
want_main_area
=
False
# Inputs
class
Inputs
:
dataset
=
Input
(
"dataset"
,
tuple
)
# Outputs
class
Outputs
:
dataset
=
Output
(
"dataset"
,
tuple
)
def
__init__
(
self
):
super
().
__init__
()
self
.
_widget
=
RSMWidget
(
parent
=
self
)
self
.
controlArea
.
layout
().
addWidget
(
self
.
_widget
)
@
Inputs
.
dataset
def
setDataset
(
self
,
dataset
):
if
dataset
:
self
.
_widget
.
setDataset
(
*
dataset
)
self
.
Outputs
.
dataset
.
send
(
dataset
)
self
.
open
()
orangecontrib/darfix/widgets/
magnific
ation.py
→
orangecontrib/darfix/widgets/
transform
ation.py
View file @
d9213f62
...
...
@@ -26,19 +26,21 @@
__authors__
=
[
"J. Garriga"
]
__license__
=
"MIT"
__date__
=
"0
2
/06/2021"
__date__
=
"0
4
/06/2021"
from
silx.gui
import
qt
from
Orange.widgets.widget
import
OWWidget
,
Input
,
Output
from
darfix.gui.magnificationWidget
import
MagnificationWidget
from
darfix.gui.rsmWidget
import
RSMWidget
class
Magnific
ationWidgetOW
(
OWWidget
):
class
Transform
ationWidgetOW
(
OWWidget
):
"""
Widget that computes the background substraction from a dataset
"""
name
=
"
magnific
ation"
name
=
"
transform
ation"
# icon = "icons/pca.png"
want_main_area
=
False
...
...
@@ -53,14 +55,23 @@ class MagnificationWidgetOW(OWWidget):
def
__init__
(
self
):
super
().
__init__
()
self
.
_widget
=
MagnificationWidget
(
parent
=
self
)
self
.
_widget
.
sigComputed
.
connect
(
self
.
_sendSignal
)
self
.
controlArea
.
layout
().
addWidget
(
self
.
_widget
)
@
Inputs
.
dataset
def
setDataset
(
self
,
dataset
):
if
dataset
:
self
.
_widget
.
setDataset
(
*
dataset
)
if
not
dataset
[
0
].
dims
.
ndim
:
msg
=
qt
.
QMessageBox
()
msg
.
setIcon
(
qt
.
QMessageBox
.
Warning
)
msg
.
setText
(
"This widget has to be used before selecting any region of
\
interest and after selecting the dimensions"
)
msg
.
exec_
()
else
:
if
dataset
[
0
].
dims
.
ndim
==
1
:
self
.
_widget
=
RSMWidget
(
parent
=
self
)
else
:
self
.
_widget
=
MagnificationWidget
(
parent
=
self
)
self
.
_widget
.
sigComputed
.
connect
(
self
.
_sendSignal
)
self
.
controlArea
.
layout
().
addWidget
(
self
.
_widget
)
self
.
_widget
.
setDataset
(
*
dataset
)
else
:
# Emit None
self
.
Outputs
.
dataset
.
send
(
dataset
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment