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
ef969c11
Commit
ef969c11
authored
Jun 14, 2021
by
Julia Garriga Ferrer
Browse files
[gui][grainplot] Make transformation origin and scale global and add it to mosaicity map
parent
00edc3fe
Pipeline
#48537
passed with stage
in 2 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/grainPlotWidget.py
View file @
ef969c11
...
...
@@ -114,6 +114,13 @@ class GrainPlotWidget(qt.QMainWindow):
for
i
in
range
(
len
(
Method
)):
self
.
_methodCB
.
model
().
item
(
i
).
setEnabled
(
False
)
scale
=
100
if
self
.
dataset
.
transformation
:
px
=
self
.
dataset
.
transformation
[
0
][
0
][
0
]
py
=
self
.
dataset
.
transformation
[
1
][
0
][
0
]
xscale
=
(
self
.
dataset
.
transformation
[
0
][
-
1
][
-
1
]
-
px
)
/
len
(
self
.
dataset
.
transformation
[
0
][
0
])
yscale
=
(
self
.
dataset
.
transformation
[
1
][
-
1
][
-
1
]
-
py
)
/
len
(
self
.
dataset
.
transformation
[
1
][
0
])
self
.
origin
=
(
px
,
py
)
self
.
scale
=
(
xscale
,
yscale
)
if
self
.
dataset
.
dims
.
ndim
>
1
:
self
.
ori_dist
,
self
.
hsv_key
=
self
.
dataset
.
compute_mosaicity_colorkey
()
xdim
=
self
.
dataset
.
dims
.
get
(
1
)
...
...
@@ -232,12 +239,8 @@ class GrainPlotWidget(qt.QMainWindow):
elif
method
==
Method
.
COM
:
self
.
_plotWidget
.
show
()
if
self
.
dataset
.
transformation
is
not
None
:
px
=
self
.
dataset
.
transformation
[
0
][
0
][
0
]
py
=
self
.
dataset
.
transformation
[
1
][
0
][
0
]
xscale
=
(
self
.
dataset
.
transformation
[
0
][
-
1
][
-
1
]
-
px
)
/
len
(
self
.
dataset
.
transformation
[
0
][
0
])
yscale
=
(
self
.
dataset
.
transformation
[
1
][
-
1
][
-
1
]
-
py
)
/
len
(
self
.
dataset
.
transformation
[
1
][
0
])
for
i
,
plot
in
enumerate
(
self
.
_plots
):
plot
.
addImage
(
self
.
_moments
[
i
][
0
],
origin
=
(
px
,
py
),
scale
=
(
xscale
,
y
scale
)
,
xlabel
=
'µm'
,
ylabel
=
'µm'
)
plot
.
addImage
(
self
.
_moments
[
i
][
0
],
origin
=
self
.
origin
,
scale
=
self
.
scale
,
xlabel
=
'µm'
,
ylabel
=
'µm'
)
else
:
for
i
,
plot
in
enumerate
(
self
.
_plots
):
plot
.
addImage
(
self
.
_moments
[
i
][
0
],
xlabel
=
'pixels'
,
ylabel
=
'pixels'
)
...
...
@@ -251,7 +254,13 @@ class GrainPlotWidget(qt.QMainWindow):
plot
.
addImage
(
self
.
_moments
[
i
][
3
])
elif
method
==
Method
.
MOSAICITY
:
self
.
_plotWidget
.
hide
()
self
.
_mosaicityPlot
.
addImage
(
hsv_to_rgb
(
self
.
_computeMosaicity
()))
if
self
.
dataset
.
transformation
:
self
.
_mosaicityPlot
.
addImage
(
hsv_to_rgb
(
self
.
_computeMosaicity
()),
origin
=
self
.
origin
,
scale
=
self
.
scale
,
xlabel
=
'µm'
,
ylabel
=
'µm'
)
else
:
self
.
_mosaicityPlot
.
addImage
(
hsv_to_rgb
(
self
.
_computeMosaicity
()))
self
.
_mosaicityPlot
.
show
()
def
_opticolor
(
self
,
img
,
minc
,
maxc
):
...
...
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