Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ttk
spam
Commits
ffd659dc
Commit
ffd659dc
authored
Oct 23, 2020
by
Edward Andò
Browse files
Resolves
#186
by implementing spam.helpers.slicePadded in spam-ereg-discrete
parent
a20f3f85
Pipeline
#51286
failed with stages
in 56 minutes and 18 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
scripts/spam-ereg-discrete
View file @
ffd659dc
...
...
@@ -108,22 +108,24 @@ class MainWindow(QWidget):
Phi
[
0
:
3
,
-
1
]
-=
displacementInt
print
(
"
\t\t
Subtracted this displacement:"
,
displacementInt
)
#REFsubvol = REFgrey[REFlabBB[nonConvergedGrain,0]-args.margin : REFlabBB[nonConvergedGrain,1]+1+args.margin,
#REFlabBB[nonConvergedGrain,2]-args.margin : REFlabBB[nonConvergedGrain,3]+1+args.margin,
#REFlabBB[nonConvergedGrain,4]-args.margin : REFlabBB[nonConvergedGrain,5]+1+args.margin]
REFgl
=
spam
.
label
.
getLabel
(
REFlab
,
nonConvergedGrain
,
boundingBoxes
=
REFlabBB
,
centresOfMass
=
REFlabCOM
,
labelDilate
=
args
.
LABEL_DILATE
,
margin
=
args
.
margin
,
maskOtherLabels
=
args
.
MASK
)
REFsubvol
=
REFgrey
[
REFgl
[
'slice'
]]
# 2020-10-23: EA on Issue #186: using spam.helpers.slicePadded
REFsubvol
=
spam
.
helpers
.
slicePadded
(
REFgrey
,
REFgl
[
'boundingBox'
]
+
numpy
.
array
([
0
,
1
,
0
,
1
,
0
,
1
]))
if
args
.
MASK
:
# If mask asked, also flatten greylevels
REFsubvol
[
REFgl
[
'subvol'
]
==
0
]
=
0
DEFsubvol
=
DEFgrey
[
REFlabBB
[
nonConvergedGrain
,
0
]
+
displacementInt
[
0
]
-
args
.
margin
:
REFlabBB
[
nonConvergedGrain
,
1
]
+
1
+
displacementInt
[
0
]
+
args
.
margin
,
REFlabBB
[
nonConvergedGrain
,
2
]
+
displacementInt
[
1
]
-
args
.
margin
:
REFlabBB
[
nonConvergedGrain
,
3
]
+
1
+
displacementInt
[
1
]
+
args
.
margin
,
REFlabBB
[
nonConvergedGrain
,
4
]
+
displacementInt
[
2
]
-
args
.
margin
:
REFlabBB
[
nonConvergedGrain
,
5
]
+
1
+
displacementInt
[
2
]
+
args
.
margin
]
# 2020-10-23: EA on Issue #186: using spam.helpers.slicePadded
REFsubvol
=
spam
.
helpers
.
slicePadded
(
REFgrey
,
REFgl
[
'boundingBox'
]
+
numpy
.
array
([
0
,
1
,
0
,
1
,
0
,
1
]))
DEFsubvol
=
spam
.
helpers
.
slicePadded
(
DEFgrey
,
REFgl
[
'boundingBox'
]
+
numpy
.
array
([
0
,
1
,
0
,
1
,
0
,
1
])
+
numpy
.
array
([
displacementInt
[
0
],
displacementInt
[
0
],
displacementInt
[
1
],
displacementInt
[
1
],
displacementInt
[
2
],
displacementInt
[
2
]]))
self
.
eregWidget
=
visual
.
ereg
(
[
REFsubvol
,
DEFsubvol
],
Phi
,
1
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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