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 dc5bde15 authored by Edward Andò's avatar Edward Andò
Browse files

resolves #192 by checking for non-existent labels in the bounding box computation

parent e04f9069
Pipeline #52493 passed with stages
in 24 minutes and 14 seconds
......@@ -83,9 +83,15 @@ class MainWindow(QWidget):
self.Phi = numpy.eye(4)
self.mainWindowGrid = QGridLayout(self)
self.nonConvergedGrains = numpy.where(DDIC['returnStatus'] < args.RETURN_STAT_THRESHOLD)[0][1:]
# 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
presentGrains = REFlabBB[:,1]>REFlabBB[:,0]
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)
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 = []
......@@ -113,7 +119,7 @@ class MainWindow(QWidget):
labelDilate=args.LABEL_DILATE, margin=args.margin,
maskOtherLabels=args.MASK)
if REGgl is not None:
if REFgl is not None:
# 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]))
......@@ -136,18 +142,21 @@ class MainWindow(QWidget):
self.nextLabelButton.clicked.connect(self.nextLabel)
self.mainWindowGrid.addWidget(self.nextLabelButton, 2, 1)
else:
nextLabel()
def nextLabel(self):
#print("Phi:", self.eregWidget.output())
self.eregWidget.close()
# Get Phi output from graphical
PhiTmp = self.eregWidget.output()
# Add back in int displacement
PhiTmp[0:3, -1] += self.diplacementInt
# nonConvergedGrain label number, eye-Phi
self.labAndPhi.append([self.nonConvergedGrains[self.N], PhiTmp])
self.nextLabel(widgetOpen=False)
def nextLabel(self, widgetOpen=True):
if widgetOpen:
self.eregWidget.close()
# Get Phi output from graphical
PhiTmp = self.eregWidget.output()
# Add back in int displacement
PhiTmp[0:3, -1] += self.diplacementInt
# nonConvergedGrain label number, eye-Phi
self.labAndPhi.append([self.nonConvergedGrains[self.N], PhiTmp])
else:
# This grain was skipped, let's add nothing in its place
self.labAndPhi.append([self.nonConvergedGrains[self.N], numpy.eye(4)])
# Move onto next grain, otherwise write and quit
self.N += 1
......
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