Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 894bf309 authored by Olga Stamati's avatar Olga Stamati
Browse files

closes #193 implement grid poinr gradient update option in spam-ldic

parent dc5bde15
Pipeline #53049 passed with stages
in 24 minutes and 18 seconds
......@@ -330,6 +330,7 @@ if mpiRank == boss or not mpi:
margin=args.GRID_POINT_MARGIN,
maxIterations=args.GRID_POINT_MAX_ITERATIONS,
deltaPhiMin=args.GRID_POINT_MIN_PHI_CHANGE,
updateGradient=args.GRID_POINT_UPDATE_GRADIENT,
im1mask=im1mask,
minMaskCoverage = args.GRID_POINT_MASK_COVERAGE,
interpolationOrder=args.GRID_POINT_INTERPOLATION_ORDER,
......@@ -478,14 +479,15 @@ elif mpi: # We are not the mpi boss, so we are a lukasKanade worker
elif tag == 3:
# print "\n\n\t\tI am worker {} working on node {}".format( mpiRank, m )
lukasKanadeReturns = spam.DIC.correlate.register(m['im1'],
m['im2'],
im1mask=m['im1mask'],
PhiInit=m['PhiInit'],
margin=m['margin'],
maxIterations=m['maxIterations'],
deltaPhiMin=m['deltaPhiMin'],
interpolationOrder=m['interpolationOrder'],
interpolator=m['interpolator'])
m['im2'],
im1mask=m['im1mask'],
PhiInit=m['PhiInit'],
margin=m['margin'],
maxIterations=m['maxIterations'],
deltaPhiMin=m['deltaPhiMin'],
updateGradient=m['updateGradient'],
interpolationOrder=m['interpolationOrder'],
interpolator=m['interpolator'])
# print "\t\tI am worker {} Sending result for node {}".format( mpiRank, node )
mpiComm.send([mpiRank, m['nodeNumber'], lukasKanadeReturns, m['nodeDisplacement']], dest=boss, tag=4)
......
......@@ -349,7 +349,7 @@ def pixelSearchOnGrid(im1, im2, nodePositions, halfWindowSize, searchRange, PhiF
'pixelSearchCC': pixelSearchCC}
def registerOnGrid(im1, im2, nodePositions, halfWindowSize, PhiField=None, margin=None, maxIterations=None, deltaPhiMin=None, interpolationOrder=None, minMaskCoverage=0.5, im1mask=None, greyThreshold=[-numpy.inf, numpy.inf], mpi=False, killWorkersWhenDone=True):
def registerOnGrid(im1, im2, nodePositions, halfWindowSize, PhiField=None, margin=None, maxIterations=None, deltaPhiMin=None, updateGradient=None, interpolationOrder=None, minMaskCoverage=0.5, im1mask=None, greyThreshold=[-numpy.inf, numpy.inf], mpi=False, killWorkersWhenDone=True):
"""
This function handles grid-based local correlation, performing a "register" subpixel refinement.
Here we minimise a residual which is the difference between im1 and im2.
......@@ -384,6 +384,10 @@ def registerOnGrid(im1, im2, nodePositions, halfWindowSize, PhiField=None, margi
deltaPhiMin : float, optional
Stop iterating when norm of F gets below this value
Default = None (use ``register``'s default)
updateGradient : bool, optional
Should the gradient of the image be computed (and updated) on the deforming im2?
Default = None (use ``register``'s default)
interpolationOrder : int, optional
Greyscale interpolation order
......@@ -607,6 +611,7 @@ def registerOnGrid(im1, im2, nodePositions, halfWindowSize, PhiField=None, margi
'margin': 1, # see top of this file for compensation
'maxIterations': maxIterations,
'deltaPhiMin': deltaPhiMin,
'updateGradient': updateGradient,
'interpolationOrder': interpolationOrder,
'interpolator': interpolator,
'nodeDisplacement': imagetteReturns['nodeDisplacement']
......@@ -628,6 +633,7 @@ def registerOnGrid(im1, im2, nodePositions, halfWindowSize, PhiField=None, margi
margin=1, # see top of this file for compensation
maxIterations=maxIterations,
deltaPhiMin=deltaPhiMin,
updateGradient=updateGradient,
interpolationOrder=interpolationOrder,
verbose=False,
imShowProgress=False)
......
......@@ -235,6 +235,12 @@ def ldicParser(parser):
dest='GRID_POINT_MASK_COVERAGE',
help="In case a mask is defined, tolerance for a subvolume's pixels to be masked before it is skipped with RS=-5. Default = 0.5")
parser.add_argument('-gpug',
'--grid-point-update-gradient',
action="store_true",
dest='GRID_POINT_UPDATE_GRADIENT',
help='Update gradient in grid-point registration? More computation time but more robust and possibly fewer iterations.')
parser.add_argument('-sef',
'--series-Ffile',
action="store_true",
......
Markdown is supported
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