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
8843f807
Commit
8843f807
authored
Feb 11, 2020
by
Julia Garriga Ferrer
Browse files
[components] Save W matrix with all images shape
parent
741a2764
Pipeline
#21094
passed with stage
in 3 minutes and 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/dataset.py
View file @
8843f807
...
...
@@ -359,9 +359,6 @@ class Dataset(qt.QObject):
"""
if
not
self
.
_dimensions_values
:
data
=
self
.
metadata
# Use only metadata of high intensity data
if
self
.
_filter_data
:
data
=
numpy
.
array
(
self
.
metadata
)[
self
.
threshold
]
for
dimension
in
self
.
__dims
:
values
=
numpy
.
empty
((
len
(
data
)))
for
row
,
metadata_frame
in
enumerate
(
data
):
...
...
darfix/gui/blindSourceSeparationWidget.py
View file @
8843f807
...
...
@@ -148,6 +148,13 @@ class BSSWidget(qt.QMainWindow):
self
.
_displayComponentsWidget
.
show
()
self
.
computeButton
.
setEnabled
(
True
)
self
.
nComponentsLE
.
setEnabled
(
True
)
if
numpy
.
any
(
self
.
dataset
.
li_data
):
# If filter data is activated, the matrix W has reduced dimensionality, so reshaping is not possible
# Create empty array with shape the total number of frames
W
=
numpy
.
zeros
((
self
.
dataset
.
nframes
,
n_comp
))
# Set actual values of W where threshold of filter is True
W
[
self
.
dataset
.
threshold
]
=
self
.
W
self
.
W
=
W
self
.
_displayComponentsWidget
.
setComponents
(
self
.
comp
,
self
.
W
,
self
.
dataset
.
get_dimensions_values
())
def
_detectComp
(
self
):
...
...
darfix/gui/displayComponentsWidget.py
View file @
8843f807
...
...
@@ -218,20 +218,6 @@ class DisplayComponentsWidget(qt.QMainWindow):
self
.
_plot_rocking_curves
.
getBrowser
().
setRange
(
0
,
len
(
self
.
dimensions
[
text
])
-
1
)
self
.
_plot_rocking_curves
.
getBrowser
().
setValue
(
0
)
for
i
in
range
(
len
(
self
.
W
.
T
)):
"""
if numpy.any(self.dataset.li_data):
# If filter data is activated, the matrix W has reduced dimensionality, so reshaping is not possible
# Create empty array with shape the total number of frames
W = numpy.empty(self.dataset.threshold.shape)
# Set actual values of W where threshold of filter is True
W[self.dataset.threshold] = self.W.T[i]
# Take only the thresholds for the dimension
threshold = numpy.take(self.dataset.threshold.reshape(self.dataset.dims.shape), 0, axis=self.dimension)
# Reshape W into the dimensions and take the first element of the chosen dimension
W = numpy.take(W.reshape(self.dataset.dims.shape), 0, self.dimension)
# Take only the values of W that correspond to high intensity data
W = W[threshold]
else:"""
dimensions_shape
=
numpy
.
array
(
self
.
dimensions
.
values
()).
shape
W
=
numpy
.
take
(
self
.
W
.
T
[
i
].
reshape
(
dimensions_shape
),
self
.
index
,
self
.
dimension
)
self
.
_plot_rocking_curves
.
addCurve
(
numpy
.
arange
(
len
(
W
)),
W
,
legend
=
str
(
i
))
...
...
@@ -246,19 +232,6 @@ class DisplayComponentsWidget(qt.QMainWindow):
self
.
index
=
index
self
.
_plot_rocking_curves
.
clear
()
for
i
in
range
(
len
(
self
.
W
.
T
)):
"""if numpy.any(self.dataset.li_data):
# If filter data is activated, the matrix W has reduced dimensionality, so reshaping is not possible
# Create empty array with shape the total number of frames
W = numpy.empty(self.dataset.threshold.shape)
# Set actual values of W where threshold of filter is True
W[self.dataset.threshold] = self.W.T[i]
# Take only the thresholds for the dimension
threshold = numpy.take(self.dataset.threshold.reshape(self.dataset.dims.shape), self.index, axis=self.dimension)
# Reshape W into the dimensions and take the chosen element and dimension
W = numpy.take(W.reshape(self.dataset.dims.shape), self.index, self.dimension)
# Take only the values of W that correspond to high intensity data
W = W[threshold]
else:"""
dimensions_shape
=
numpy
.
array
(
self
.
dimensions
.
values
()).
shape
W
=
numpy
.
take
(
self
.
W
.
T
[
i
].
reshape
(
dimensions_shape
),
self
.
index
,
self
.
dimension
)
self
.
_plot_rocking_curves
.
addCurve
(
numpy
.
arange
(
len
(
W
)),
W
,
legend
=
str
(
i
))
...
...
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