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 ac2e202e authored by Olga Stamati's avatar Olga Stamati
Browse files

fix identation error in initial registration for spam-ldic

parent 344d6987
Pipeline #49761 passed with stages
in 23 minutes and 27 seconds
......@@ -165,44 +165,44 @@ if mpiRank == boss or not mpi:
else:
regMargin = int(args.REG_MARGIN*min(im1.shape))
# Run registration
regReturns = spam.DIC.correlate.registerMultiscale(im1, im2,
args.REG_BIN_BEGIN, binStop=args.REG_BIN_END,
margin=int(args.REG_MARGIN * min(im1.shape)),
im1mask=im1mask,
interpolationOrder=1,
maxIterations=500,
deltaPhiMin=0.0001,
updateGradient=args.REG_UPDATE,
interpolator='C',
verbose=True)
if regReturns['returnStatus'] != 2:
print("spam-ddic: Registration did not converge, try increasing the registration margin?")
else:
print("spam-ddic: Registration converged beautifully...")
registrationSuccessful = True
# Run registration
regReturns = spam.DIC.correlate.registerMultiscale(im1, im2,
args.REG_BIN_BEGIN, binStop=args.REG_BIN_END,
margin=int(args.REG_MARGIN * min(im1.shape)),
im1mask=im1mask,
interpolationOrder=1,
maxIterations=500,
deltaPhiMin=0.0001,
updateGradient=args.REG_UPDATE,
interpolator='C',
verbose=True)
if regReturns['returnStatus'] != 2:
print("spam-ddic: Registration did not converge, try increasing the registration margin?")
else:
print("spam-ddic: Registration converged beautifully...")
registrationSuccessful = True
print("\tTranslations (px)")
print("\t\t", spam.deformation.decomposePhi(regReturns['Phi'])['t'])
print("\tRotations (deg)")
print("\t\t", spam.deformation.decomposePhi(regReturns['Phi'])['r'])
print("\tTranslations (px)")
print("\t\t", spam.deformation.decomposePhi(regReturns['Phi'])['t'])
print("\tRotations (deg)")
print("\t\t", spam.deformation.decomposePhi(regReturns['Phi'])['r'])
regPhi = regReturns['Phi']
regCentre = (numpy.array(im1.shape)/args.REG_BIN_END - 1) / 2.0
regPhi = regReturns['Phi']
regCentre = (numpy.array(im1.shape)/args.REG_BIN_END - 1) / 2.0
# Not right in 100% of cases, but disactivate pixelSearch if the registration has converged
# args.PS = False
# Also disactive loading further guesses.
args.PHIFILE = None
# Not right in 100% of cases, but disactivate pixelSearch if the registration has converged
# args.PS = False
# Also disactive loading further guesses.
args.PHIFILE = None
# Make a copy and downscale displacements to final binning level
regReturnsOutput = regReturns.copy()
regReturnsOutput['Phi'][0:3,-1] /= float(args.REG_BIN_END)
# Make a copy and downscale displacements to final binning level
regReturnsOutput = regReturns.copy()
regReturnsOutput['Phi'][0:3,-1] /= float(args.REG_BIN_END)
# if args.TSV:
spam.helpers.tsvio.writeRegistrationTSV(args.OUT_DIR + "/" + args.PREFIX + "-bin{:d}".format(args.REG_BIN_END) + "-registration.tsv", regCentre, regReturnsOutput)
del regReturnsOutput
# if args.TSV:
spam.helpers.tsvio.writeRegistrationTSV(args.OUT_DIR + "/" + args.PREFIX + "-bin{:d}".format(args.REG_BIN_END) + "-registration.tsv", regCentre, regReturnsOutput)
del regReturnsOutput
# Option 2 - load previous DVC
#################################
......
"""
"""
Library of SPAM functions for plotting greyscale histogram
Copyright (C) 2020 SPAM Contributors
......@@ -20,7 +20,7 @@ this program. If not, see <http://www.gnu.org/licenses/>.
import matplotlib.pyplot as plt
import numpy
def plotGreyLevelHistogram(im, greyRange=None, bins=256, normed=False, series=False, showGraph=False):
def plotGreyLevelHistogram(im, greyRange=None, bins=256, density=False, series=False, showGraph=False):
"""
Computes a histogram and optionally shows it with matplotlib
......@@ -36,7 +36,7 @@ def plotGreyLevelHistogram(im, greyRange=None, bins=256, normed=False, series=Fa
bins : int, optional
Number of bins to split the range into
normed : bool, optional
density : bool, optional
Return a PDF or counts?
Default = False
......@@ -78,7 +78,7 @@ def plotGreyLevelHistogram(im, greyRange=None, bins=256, normed=False, series=Fa
else: d = 0
colour = [ 1.0 - d, 0, d ]
counts,binLimits = numpy.histogram( im[step].ravel(), range=greyRange, bins=bins, normed=normed )
counts,binLimits = numpy.histogram( im[step].ravel(), range=greyRange, bins=bins, density=density)
binWidth = ( greyRange[1]-greyRange[0] ) / float( bins )
......
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