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 1e42c974 authored by Gustavo Pinzon's avatar Gustavo Pinzon
Browse files

Merge branch 'master' of https://gricad-gitlab.univ-grenoble-alpes.fr/ttk/spam into ddicTools

parents 890f27c7 07c47a4d
This diff is collapsed.
......@@ -418,26 +418,26 @@ if mpiRank == boss or not mpi:
# TODO: maybe interesting to add crop to remove black edges due to applyPhi??
imagette1toCorrelate = imagette1def.copy()
if args.DEBUG:
import matplotlib.pyplot as plt
print("t before pixel search:\n", spam.deformation.decomposePhi(PhiField[label])['t'])
print("r before pixel search:\n", spam.deformation.decomposePhi(PhiField[label])['r'])
plt.subplot(1,5,1)
plt.title("ref label")
plt.imshow(maskette1[:,:,maskette1.shape[2]//2])
plt.subplot(1,5,2)
plt.title("ref image")
plt.imshow(imagette1[:,:,imagette1.shape[2]//2])
plt.subplot(1,5,3)
plt.title("ref image deformed (no disp)")
plt.imshow(imagette1def[:,:,imagette1def.shape[2]//2])
plt.subplot(1,5,4)
plt.title("ref image deformed (no disp) + mask")
plt.imshow(imagette1toCorrelate[:,:,imagette1toCorrelate.shape[2]//2])
plt.subplot(1,5,5)
plt.title("def image search range")
plt.imshow(imagette2[:,:,imagette2.shape[2]//2])
plt.show()
#if args.DEBUG:
#import matplotlib.pyplot as plt
#print("t before pixel search:\n", spam.deformation.decomposePhi(PhiField[label])['t'])
#print("r before pixel search:\n", spam.deformation.decomposePhi(PhiField[label])['r'])
#plt.subplot(1,5,1)
#plt.title("ref label")
#plt.imshow(maskette1[:,:,maskette1.shape[2]//2])
#plt.subplot(1,5,2)
#plt.title("ref image")
#plt.imshow(imagette1[:,:,imagette1.shape[2]//2])
#plt.subplot(1,5,3)
#plt.title("ref image deformed (no disp)")
#plt.imshow(imagette1def[:,:,imagette1def.shape[2]//2])
#plt.subplot(1,5,4)
#plt.title("ref image deformed (no disp) + mask")
#plt.imshow(imagette1toCorrelate[:,:,imagette1toCorrelate.shape[2]//2])
#plt.subplot(1,5,5)
#plt.title("def image search range")
#plt.imshow(imagette2[:,:,imagette2.shape[2]//2])
#plt.show()
pixelSearchReturns = spam.DIC.correlate.pixelSearch(imagette1toCorrelate,
imagette2,
......
......@@ -85,16 +85,21 @@ class MainWindow(QWidget):
# Issue #192 will be fixed here, by making sure the loew return stat list also has real boundin boxes
# (i.e., grains are really defined)
nonConvergedGrains = DDIC['returnStatus'] < args.RETURN_STAT_THRESHOLD
nonConvergedGrains = DDIC['returnStatus'][0:REFlabBB.shape[0]] < args.RETURN_STAT_THRESHOLD
presentGrains = REFlabBB[:,1]>REFlabBB[:,0]
# In the very unlucky case that there is a nax numbered nonConverged grain that is not present at all:
if REFlabBB.shape[0] < len(nonConvergedGrains):
print("Warning: there are higher-numbered labels in your TSV file that are not in the labelled image, discarding them")
print(numpy.where(nonConvergedGrains), presentGrains)
self.nonConvergedGrains = numpy.where(numpy.logical_and(nonConvergedGrains, presentGrains))[0][0:]
self.N = 0 # Number of the current nonConvergedGrain that's being studied
print("Going to work on these labels:\n", self.nonConvergedGrains, "(p.s. I removed non-existent labels:", numpy.where(~presentGrains)[0][1:]," )")
if len(self.nonConvergedGrains) > 0:
self.alignOneLabel()
self.labAndPhi = []
self.labelExists = False
self.alignOneLabel()
else:
print("No labels to work on")
exit()
......@@ -120,6 +125,7 @@ class MainWindow(QWidget):
maskOtherLabels=args.MASK)
if REFgl is not None:
self.labelExists = True
# 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]))
......@@ -142,10 +148,13 @@ class MainWindow(QWidget):
self.nextLabelButton.clicked.connect(self.nextLabel)
self.mainWindowGrid.addWidget(self.nextLabelButton, 2, 1)
else:
self.nextLabel(widgetOpen=False)
#print('alignOneGrain(): warning refgl is none')
self.labelExists = False
self.nextLabel()
def nextLabel(self, widgetOpen=True):
if widgetOpen:
def nextLabel(self):
#print("Entering nextLabel(): self.labelExists = ", self.labelExists)
if self.labelExists:
self.eregWidget.close()
# Get Phi output from graphical
......@@ -154,7 +163,9 @@ class MainWindow(QWidget):
PhiTmp[0:3, -1] += self.diplacementInt
# nonConvergedGrain label number, eye-Phi
self.labAndPhi.append([self.nonConvergedGrains[self.N], PhiTmp])
print("nextLabel: I accepted a Phi for label {}".format([self.nonConvergedGrains[self.N]]))
else:
print("nextLabel: I skipped label {}".format([self.nonConvergedGrains[self.N]]))
# This grain was skipped, let's add nothing in its place
self.labAndPhi.append([self.nonConvergedGrains[self.N], numpy.eye(4)])
......
......@@ -70,10 +70,14 @@ if args.PHIFILE is not None:
#print("\tI read a registration from a file in binning {} at centre {} at this scale".format(args.PHIFILE_BIN_RATIO, regCentre) )
print("\tI read a registration from a file in binning {}".format(args.PHIFILE_BIN_RATIO))
decomposedPhiInit = spam.deformation.decomposePhi(PhiInit)
print("\tTranslations (px)")
print("\t\t", spam.deformation.decomposePhi(PhiInit)['t'])
print("\t\t", decomposedPhiInit['t'])
print("\tRotations (deg)")
print("\t\t", spam.deformation.decomposePhi(PhiInit)['r'])
print("\t\t", decomposedPhiInit['r'])
print("\tZoom")
print("\t\t", decomposedPhiInit['z'])
# If the read F-file contains multiple lines it's an F field!
else:
......@@ -92,6 +96,7 @@ regReturns = spam.DIC.correlate.registerMultiscale(im1,
im2,
args.BIN_BEGIN, binStop=args.BIN_END,
margin=args.MARGIN,
PhiInit=PhiInit,
PhiRigid=args.RIGID,
im1mask=im1mask,
interpolationOrder=args.INTERPOLATION_ORDER,
......
......@@ -99,7 +99,7 @@ name = 'spam'
description = 'Software for the Practical Analysis of Materials'
long_description = readReadMe('README.rst')
long_description_content_type = 'text/x-rst'
version = '0.5.3.2'
version = '0.5.3.3'
author = 'SPAM authors'
author_email = 'edward.ando@3sr-grenoble.fr'
copyright = 'SPAM authors 2020'
......
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