Commit ea08f00d authored by Edward Andò's avatar Edward Andò
Browse files

import spam.plotting inside fixUndersegmentation

parent 46cb9cbb
Pipeline #47835 failed with stages
in 12 minutes and 47 seconds
......@@ -416,7 +416,7 @@ if mpiRank == boss or not mpi:
imagette1toCorrelate[maskette1def == 0] = numpy.nan
else:
# add crop??
# TODO: maybe interesting to add crop to remove black edges due to applyPhi??
imagette1toCorrelate = imagette1def.copy()
if args.DEBUG:
......@@ -466,11 +466,8 @@ if mpiRank == boss or not mpi:
slice(max(int(boundingBoxes[label][4] - args.LABEL_CORRELATE_MARGIN - max(labelDilateCurrent, 0) + labelDisplacementInt[2] ), 0 ),
min(int(boundingBoxes[label][5] + args.LABEL_CORRELATE_MARGIN + max(labelDilateCurrent, 0) + labelDisplacementInt[2] + 1), im1.shape[2])))
#print(slicette1)
#print(slicette2)
imagette2imagette1sizeDiff = numpy.array(im2[slicette2].shape) - numpy.array(imagette1.shape)
# Catch register DimProblem
if not (imagette2imagette1sizeDiff < 0).any():
......@@ -491,7 +488,7 @@ if mpiRank == boss or not mpi:
deltaPhiMin=args.LABEL_CORRELATE_MIN_PHI_CHANGE,
interpolationOrder=args.LABEL_CORRELATE_INTERPOLATION_ORDER,
verbose=args.DEBUG,
imShowProgress='X' if args.DEBUG else None)
imShowProgress='Z' if args.DEBUG else None)
writeReturns = True
elif mpi:
......
......@@ -24,7 +24,6 @@ import sys
import os
from . import labelToolkit
import spam.plotting
import scipy.ndimage
import scipy.spatial
......@@ -1297,7 +1296,7 @@ def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect =
"""
This function fix undersegmented particles using directional erosion over the particle
to get the seed for a new localized watershed.
Parameters
-----------
imLab : 3D numpy array
......@@ -1343,7 +1342,7 @@ def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect =
directional erosion
"""
#Check that a,c are valid inputs
if numpy.isnan(a) == True or numpy.isnan(c) == True:
print("\tlabel.fixUndersegmentation(): Parameters a or c are not valid. Some of them are NaN")
......@@ -1371,6 +1370,7 @@ def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect =
volumes = spam.label.volumes(imLab)
#Create the vectors for the directional erosion if needed
if vect is None:
import spam.plotting
vect = spam.plotting.orientationPlotter.SaffAndKuijlaarsSpiral(numVect)
vect = vect.tolist()
#Initalize the variables
......
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