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
a41271eb
Commit
a41271eb
authored
Feb 13, 2020
by
Julia Garriga Ferrer
Browse files
[gui] Modified signals name for code cross coherence
parent
43246115
Changes
10
Hide whitespace changes
Inline
Side-by-side
darfix/core/dataset.py
View file @
a41271eb
...
...
@@ -74,7 +74,7 @@ class Dataset(qt.QObject):
after the creation of the file_series. It waits until the load_data()
method is called.
"""
sig
nal
Progress
=
qt
.
Signal
(
int
)
sigProgress
Changed
=
qt
.
Signal
(
int
)
def
__init__
(
self
,
raw_filename
=
None
,
dark_filename
=
None
,
filenames
=
None
,
filter_data
=
False
,
load_data
=
True
):
...
...
@@ -89,6 +89,7 @@ class Dataset(qt.QObject):
self
.
dark_filename
=
dark_filename
self
.
filenames
=
filenames
self
.
__dims
=
AcquisitionDims
()
# Keys: dimensions names, values: dimensions values
self
.
_dimensions_values
=
{}
# Initialize data
...
...
@@ -119,7 +120,7 @@ class Dataset(qt.QObject):
data_urls
.
append
(
DataUrl
(
file_path
=
frame
.
filename
,
scheme
=
'fabio'
).
path
())
self
.
metadata
.
append
(
fabioh5
.
EdfFabioReader
(
fabio_image
=
frame
))
self
.
sig
nal
Progress
.
emit
(
int
(
percentage
*
iFrame
/
self
.
_file_series
.
nframes
*
100
))
self
.
sigProgress
Changed
.
emit
(
int
(
percentage
*
iFrame
/
self
.
_file_series
.
nframes
*
100
))
self
.
data_urls
=
numpy
.
array
(
data_urls
)
...
...
@@ -137,7 +138,7 @@ class Dataset(qt.QObject):
intensity
=
[]
for
i
,
frame
in
enumerate
(
self
.
data
):
intensity
+=
[
cv2
.
GaussianBlur
(
frame
,
(
3
,
3
),
20
).
var
()]
self
.
sig
nal
Progress
.
emit
(
int
(
start
+
percentage
*
i
/
len
(
self
.
data
)
*
100
))
self
.
sigProgress
Changed
.
emit
(
int
(
start
+
percentage
*
i
/
len
(
self
.
data
)
*
100
))
values
,
bins
=
numpy
.
histogram
(
intensity
,
int
(
self
.
_data
.
shape
[
0
]))
self
.
threshold
=
numpy
.
array
(
intensity
)
>=
bins
[
1
]
...
...
@@ -172,7 +173,7 @@ class Dataset(qt.QObject):
percentage
/=
2
for
i
,
url
in
enumerate
(
self
.
data_urls
):
data
+=
[
utils
.
get_data
(
url
)]
self
.
sig
nal
Progress
.
emit
(
int
(
start
+
((
percentage
*
i
)
/
len
(
self
.
data_urls
)
*
100
)))
self
.
sigProgress
Changed
.
emit
(
int
(
start
+
((
percentage
*
i
)
/
len
(
self
.
data_urls
)
*
100
)))
self
.
_data
=
numpy
.
array
(
data
)
if
self
.
_filter_data
:
self
.
compute_intensity_threshold
(
percentage
/
2
,
start
=
start
+
(
percentage
*
100
))
...
...
darfix/gui/PCAWidget.py
View file @
a41271eb
...
...
@@ -42,7 +42,7 @@ class PCAWidget(qt.QMainWindow):
"""
Widget to apply PCA to a set of images and plot the eigenvalues found.
"""
sig
nal
Computed
=
qt
.
Signal
()
sigComputed
=
qt
.
Signal
()
def
__init__
(
self
,
parent
=
None
):
qt
.
QWidget
.
__init__
(
self
,
parent
)
...
...
@@ -102,4 +102,4 @@ class PCAWidget(qt.QMainWindow):
vals
=
[
item
for
sublist
in
vals
for
item
in
sublist
]
self
.
_plot
.
show
()
self
.
_plot
.
addCurve
(
numpy
.
arange
(
len
(
vals
)),
vals
,
symbol
=
'.'
,
linestyle
=
' '
)
self
.
sig
nal
Computed
.
emit
()
self
.
sigComputed
.
emit
()
darfix/gui/blindSourceSeparationWidget.py
View file @
a41271eb
...
...
@@ -41,7 +41,6 @@ class BSSWidget(qt.QMainWindow):
"""
Widget to apply blind source separation.
"""
signalComputed
=
qt
.
Signal
()
def
__init__
(
self
,
parent
=
None
):
qt
.
QMainWindow
.
__init__
(
self
,
parent
)
...
...
darfix/gui/datasetSelectionWidget.py
View file @
a41271eb
...
...
@@ -45,7 +45,7 @@ class DatasetSelectionWidget(qt.QTabWidget):
If both options are filled up, only the files in the list of filenames
are read.
"""
sig
nal
Progress
=
qt
.
Signal
(
int
)
sigProgress
Changed
=
qt
.
Signal
(
int
)
def
__init__
(
self
,
parent
=
None
):
qt
.
QTabWidget
.
__init__
(
self
,
parent
)
...
...
@@ -90,7 +90,7 @@ class DatasetSelectionWidget(qt.QTabWidget):
self
.
_dataset
=
Dataset
(
filenames
=
self
.
_rawFilesData
.
getFiles
(),
dark_filename
=
self
.
_darkFilenameData
.
getFilename
(),
load_data
=
False
,
filter_data
=
self
.
_filterData
)
self
.
_dataset
.
sig
nal
Progress
.
connect
(
self
.
updateProgress
)
self
.
_dataset
.
sigProgress
Changed
.
connect
(
self
.
updateProgress
)
_logger
.
info
(
"Loading data urls"
)
self
.
_dataset
.
load_data
(
0.3
)
_logger
.
info
(
"Loading data"
)
...
...
@@ -102,7 +102,7 @@ class DatasetSelectionWidget(qt.QTabWidget):
return
self
.
_dataset
def
updateProgress
(
self
,
progress
):
self
.
sig
nal
Progress
.
emit
(
progress
)
self
.
sigProgress
Changed
.
emit
(
progress
)
def
__filterData
(
self
,
filterData
):
self
.
_filterData
=
filterData
...
...
darfix/gui/displayComponentsWidget.py
View file @
a41271eb
...
...
@@ -44,7 +44,6 @@ class DisplayComponentsWidget(qt.QMainWindow):
"""
Widget to apply blind source separation.
"""
signalComputed
=
qt
.
Signal
()
def
__init__
(
self
,
parent
=
None
):
qt
.
QMainWindow
.
__init__
(
self
,
parent
)
...
...
darfix/gui/roiSelectionWidget.py
View file @
a41271eb
...
...
@@ -50,7 +50,7 @@ class ROISelectionWidget(qt.QWidget):
"""
Widget that allows the user to pick a ROI in any image of the dataset.
"""
sig
nal
Computed
=
qt
.
Signal
(
list
,
list
)
sigComputed
=
qt
.
Signal
(
list
,
list
)
def
__init__
(
self
,
parent
=
None
):
qt
.
QWidget
.
__init__
(
self
,
parent
)
...
...
@@ -178,9 +178,9 @@ class ROISelectionWidget(qt.QWidget):
if
len
(
self
.
dataset
.
dark_frames
):
self
.
dataset
.
dark_frames
=
apply_3D_ROI
(
self
.
dataset
.
dark_frames
,
self
.
roi
.
getSize
()
/
2
,
numpy
.
flip
(
self
.
roi
.
getCenter
()))
self
.
sig
nal
Computed
.
emit
(
self
.
roi
.
getOrigin
().
tolist
(),
self
.
roi
.
getSize
().
tolist
())
self
.
sigComputed
.
emit
(
self
.
roi
.
getOrigin
().
tolist
(),
self
.
roi
.
getSize
().
tolist
())
else
:
self
.
sig
nal
Computed
.
emit
([],
[])
self
.
sigComputed
.
emit
([],
[])
def
resetROI
(
self
):
"""
...
...
darfix/gui/shiftCorrectionWidget.py
View file @
a41271eb
...
...
@@ -46,8 +46,8 @@ class ShiftCorrectionWidget(qt.QMainWindow):
"""
A widget to apply shift correction to a stack of images
"""
sig
nal
Computed
=
qt
.
Signal
()
sig
nal
Progress
=
qt
.
Signal
(
int
)
sigComputed
=
qt
.
Signal
()
sigProgress
Changed
=
qt
.
Signal
(
int
)
def
__init__
(
self
,
parent
=
None
):
qt
.
QMainWindow
.
__init__
(
self
,
parent
)
...
...
@@ -120,7 +120,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
self
.
thread_correction
.
start
()
def
updateProgress
(
self
,
progress
):
self
.
sig
nal
Progress
.
emit
(
progress
)
self
.
sigProgress
Changed
.
emit
(
progress
)
def
_changeDataShiftFlag
(
self
,
state
):
self
.
_shift2dataset
=
state
...
...
@@ -145,7 +145,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
data
=
self
.
thread_correction
.
data
assert
data
is
not
None
self
.
setStack
(
data
)
self
.
sig
nal
Computed
.
emit
()
self
.
sigComputed
.
emit
()
if
self
.
_shift2dataset
:
self
.
dataset
.
hi_dataset
=
data
...
...
orangecontrib/darfix/widgets/dataselection.py
View file @
a41271eb
...
...
@@ -70,7 +70,7 @@ class DataSelectionWidgetOW(OWWidget):
self
.
controlArea
.
layout
().
addWidget
(
_buttons
)
self
.
_progressBar
=
gui
.
ProgressBar
(
self
,
100
)
self
.
_widget
.
sig
nal
Progress
.
connect
(
self
.
_updateProgress
)
self
.
_widget
.
sigProgress
Changed
.
connect
(
self
.
_updateProgress
)
_buttons
.
accepted
.
connect
(
self
.
_getDataset
)
self
.
__updatingData
=
False
...
...
orangecontrib/darfix/widgets/roiselection.py
View file @
a41271eb
...
...
@@ -64,7 +64,7 @@ class RoiSelectionWidgetOW(OWWidget):
# self._button.setEnabled(False)
self
.
controlArea
.
layout
().
addWidget
(
self
.
_widget
)
# self.controlArea.layout().addWidget(self._button)
self
.
_widget
.
sig
nal
Computed
.
connect
(
self
.
_sendSignal
)
self
.
_widget
.
sigComputed
.
connect
(
self
.
_sendSignal
)
# self._button.pressed.connect(self._createRoi)
...
...
orangecontrib/darfix/widgets/shiftcorrection.py
View file @
a41271eb
...
...
@@ -61,8 +61,8 @@ class ShiftCorrectionWidgetOW(OWWidget):
self
.
_widget
=
ShiftCorrectionWidget
(
parent
=
self
)
self
.
_progressBar
=
gui
.
ProgressBar
(
self
,
100
)
self
.
_widget
.
sig
nal
Computed
.
connect
(
self
.
_sendSignal
)
self
.
_widget
.
sig
nal
Progress
.
connect
(
self
.
_updateProgress
)
self
.
_widget
.
sigComputed
.
connect
(
self
.
_sendSignal
)
self
.
_widget
.
sigProgress
Changed
.
connect
(
self
.
_updateProgress
)
self
.
controlArea
.
layout
().
addWidget
(
self
.
_widget
)
if
self
.
shift
:
...
...
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