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
0876e502
Commit
0876e502
authored
Dec 01, 2020
by
Edward Andò
Browse files
[skip-ci] spam-pixelSearch with initial guess
parent
a6ab9bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/spam-pixelSearch
View file @
0876e502
...
...
@@ -56,7 +56,7 @@ halfWindowSize = numpy.array(args.HWS)
greyThreshold
=
[
args
.
GREY_LOW_THRESH
,
args
.
GREY_HIGH_THRESH
]
# Fill in search range
as a dictionary
# Fill in search range
searchRange
=
numpy
.
array
([
args
.
SEARCH_RANGE
[
0
],
args
.
SEARCH_RANGE
[
1
],
args
.
SEARCH_RANGE
[
2
],
args
.
SEARCH_RANGE
[
3
],
args
.
SEARCH_RANGE
[
4
],
args
.
SEARCH_RANGE
[
5
]])
# Load reference image
...
...
@@ -130,14 +130,14 @@ if args.PHIFILE is not None:
# 1. by copying the registration's little F to the Fs of all points
# 2. by calling the decomposePhi function to compute the translation of each point
for
node
in
range
(
nodePositions
.
shape
[
0
]):
PhiField
[
node
]
=
reg
Phi
.
copy
()
PhiField
[
node
][
0
:
3
,
-
1
]
=
spam
.
deformation
.
decomposePhi
(
reg
Phi
.
copy
(),
PhiCentre
=
regCentre
,
PhiPoint
=
nodePositions
[
node
])[
"t"
]
PhiField
[
node
]
=
Phi
Init
.
copy
()
PhiField
[
node
][
0
:
3
,
-
1
]
=
spam
.
deformation
.
decomposePhi
(
Phi
Init
.
copy
(),
PhiCentre
=
PhiFromFile
[
"fieldCoords"
][
0
]
,
PhiPoint
=
nodePositions
[
node
])[
"t"
]
## Now recompute F to be only rigid, and calculate rigid-body translations for each point
#if args.REGSUB:
#
reg
PhiRigid = spam.deformation.computeRigidPhi(
reg
Phi.copy())
#Phi
Init
Rigid = spam.deformation.computeRigidPhi(Phi
Init
.copy())
#for node in range(nodePositions.shape[0]):
#rigidDisp[node] = spam.deformation.decomposePhi(
reg
PhiRigid.copy(),
#rigidDisp[node] = spam.deformation.decomposePhi(Phi
Init
Rigid.copy(),
#PhiCentre=regCentre,
#PhiPoint=nodePositions[node])["t"]
...
...
@@ -239,6 +239,7 @@ Returns
For each node, the NCC score obtained
"""
# WARNING ------------------------- VVVVVVVVVVV--- gets easily overwritten, pass a .copy()!
def
getImagettes
(
nodePosition
,
Phi
,
searchRange
,
boundingBox
,
im1
,
im2
,
im1mask
,
minMaskCoverage
,
greyThreshold
):
returnStatus
=
2
...
...
@@ -379,7 +380,7 @@ while finishedNodes != numberOfNodes:
# Get the next node off the queue
nodeNumber
=
q
.
get
()
imagetteReturns
=
getImagettes
(
nodePositions
[
nodeNumber
],
PhiField
[
nodeNumber
],
searchRange
,
boundingBoxes
[
nodeNumber
],
im1
,
im2
,
im1mask
,
args
.
MASK_COVERAGE
,
greyThreshold
)
imagetteReturns
=
getImagettes
(
nodePositions
[
nodeNumber
],
PhiField
[
nodeNumber
],
searchRange
.
copy
()
,
boundingBoxes
[
nodeNumber
],
im1
,
im2
,
im1mask
,
args
.
MASK_COVERAGE
,
greyThreshold
)
if
imagetteReturns
[
'returnStatus'
]
==
2
:
if
mpi
:
...
...
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