Commit 0876e502 authored by Edward Andò's avatar Edward Andò
Browse files

[skip-ci] spam-pixelSearch with initial guess

parent a6ab9bc8
......@@ -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] = regPhi.copy()
PhiField[node][0:3, -1] = spam.deformation.decomposePhi(regPhi.copy(), PhiCentre=regCentre, PhiPoint=nodePositions[node])["t"]
PhiField[node] = PhiInit.copy()
PhiField[node][0:3, -1] = spam.deformation.decomposePhi(PhiInit.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:
#regPhiRigid = spam.deformation.computeRigidPhi(regPhi.copy())
#PhiInitRigid = spam.deformation.computeRigidPhi(PhiInit.copy())
#for node in range(nodePositions.shape[0]):
#rigidDisp[node] = spam.deformation.decomposePhi(regPhiRigid.copy(),
#rigidDisp[node] = spam.deformation.decomposePhi(PhiInitRigid.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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment