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

fixing numberOfThreads typo

parent 5b7f90f8
......@@ -308,7 +308,7 @@ def reconstructionFromOppositeFaces(im, dmax=None, verbose=False):
return rec1 # send the reconstructed image
def directionalErosion(bwIm, vect, a, c, NumberOfThreads=1, verbose = False):
def directionalErosion(bwIm, vect, a, c, numberOfThreads=1, verbose = False):
"""
This functions performs direction erosion over the binarized image using
an ellipsoidal structuring element over a range of directions. It is highly
......@@ -329,7 +329,7 @@ def directionalErosion(bwIm, vect, a, c, NumberOfThreads=1, verbose = False):
c : int or float
Lenght of the principal semi-axis of the structuring element in px
NumberOfThreads : integer, optional
numberOfThreads : integer, optional
Number of Threads for multiprocessing.
Default = 1
......@@ -379,11 +379,11 @@ def directionalErosion(bwIm, vect, a, c, NumberOfThreads=1, verbose = False):
# qJobs.put( contactList[x,0] )
qJobs.put(x)
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
qJobs.put("STOP")
# print "Master: Launching workers"
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
p = multiprocessing.Process(target=worker, args=(i, qJobs, qResults, ))
p.start()
......@@ -392,7 +392,7 @@ def directionalErosion(bwIm, vect, a, c, NumberOfThreads=1, verbose = False):
finishedThreads = 0
finishedJobs = 0
# print "Master: Waiting for results"
while finishedThreads < NumberOfThreads:
while finishedThreads < numberOfThreads:
result = qResults.get()
if result == "STOP":
......
......@@ -859,7 +859,7 @@ def _markerCorrection(markers, numMarkers, distanceMap, volBin, peakDistance=5,
return markers
def localDetectionAssembly(volLab, volGrey, contactList, localThreshold, boundingBoxes=None, NumberOfThreads=1, radiusThresh=4):
def localDetectionAssembly(volLab, volGrey, contactList, localThreshold, boundingBoxes=None, numberOfThreads=1, radiusThresh=4):
"""
Local contact refinement of a set of contacts
checks whether two particles are in contact with a local threshold using ``localDetection()``
......@@ -883,7 +883,7 @@ def localDetectionAssembly(volLab, volGrey, contactList, localThreshold, boundin
Bounding boxes in format returned by ``boundingBoxes``.
If not defined (Default = None), it is recomputed by running ``boundingBoxes``
NumberOfThreads : integer, optional
numberOfThreads : integer, optional
Number of Threads for multiprocessing
Default = 1
......@@ -948,12 +948,12 @@ def localDetectionAssembly(volLab, volGrey, contactList, localThreshold, boundin
for x in range(numberOfJobs):
qJobs.put( x )
for i in range( NumberOfThreads ):
for i in range( numberOfThreads ):
qJobs.put( "STOP" )
#print ("Master: Launching workers")
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
p = multiprocessing.Process( target=worker, args=( i, qJobs, qResults, ) )
p.start()
......@@ -961,7 +961,7 @@ def localDetectionAssembly(volLab, volGrey, contactList, localThreshold, boundin
finishedThreads = 0
finishedJobs = 0
#print ("Master: Waiting for results")
while finishedThreads < NumberOfThreads:
while finishedThreads < numberOfThreads:
result = qResults.get()
if result == "STOP":
......@@ -980,7 +980,7 @@ def localDetectionAssembly(volLab, volGrey, contactList, localThreshold, boundin
return numpy.asarray(contactListRefined)
def contactOrientationsAssembly(volLab, volGrey, contactList, watershed="ITK", peakDistance=5, boundingBoxes=None, NumberOfThreads=1, verbose=False):
def contactOrientationsAssembly(volLab, volGrey, contactList, watershed="ITK", peakDistance=5, boundingBoxes=None, numberOfThreads=1, verbose=False):
"""
Determines contact normal orientation in an assembly of touching particles
uses either directly the labelled image or the random walker implementation from skimage
......@@ -1012,7 +1012,7 @@ def contactOrientationsAssembly(volLab, volGrey, contactList, watershed="ITK", p
Bounding boxes in format returned by ``boundingBoxes``.
If not defined (Default = None), it is recomputed by running ``boundingBoxes``
NumberOfThreads : integer, optional
numberOfThreads : integer, optional
Number of Threads for multiprocessing.
Default = 1
......@@ -1078,11 +1078,11 @@ def contactOrientationsAssembly(volLab, volGrey, contactList, watershed="ITK", p
# qJobs.put( contactList[x,0] )
qJobs.put(x)
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
qJobs.put("STOP")
# print "Master: Launching workers"
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
p = multiprocessing.Process(target=worker, args=(i, qJobs, qResults, ))
p.start()
......@@ -1090,7 +1090,7 @@ def contactOrientationsAssembly(volLab, volGrey, contactList, watershed="ITK", p
finishedThreads = 0
finishedJobs = 0
# print "Master: Waiting for results"
while finishedThreads < NumberOfThreads:
while finishedThreads < numberOfThreads:
result = qResults.get()
if result == "STOP":
......
......@@ -1331,7 +1331,7 @@ class Spheroid:
x = numpy.mgrid[slices]
return self.criterion(x)<=1.0
def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect = None, boundingBoxes = None, centresOfMass = None, NumberOfThreads = 1, verbose = False):
def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect=100, vect=None, boundingBoxes=None, centresOfMass=None, numberOfThreads=1, verbose=False):
"""
This function fix undersegmented particles using directional erosion over the particle
to get the seed for a new localized watershed.
......@@ -1361,7 +1361,7 @@ def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect =
c : int or float
Lenght of the principal semi-axis of the structuring element
NumberOfThreads : integer (optional, default = 1)
numberOfThreads : integer (optional, default = 1)
Number of Threads for multiprocessing of the directional erosion.
Default = 1
......@@ -1435,7 +1435,7 @@ def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect =
while Continue == False:
#Directional Erosion
imEroded = spam.filters.morphologicalOperations.directionalErosion(bwIm, vect,
a, c, NumberOfThreads = NumberOfThreads,
a, c, numberOfThreads = numberOfThreads,
verbose = verbose)
#Label the markers
markers, num_seeds = scipy.ndimage.label(imEroded)
......@@ -1536,7 +1536,7 @@ def fixUndersegmentation(imLab, imGrey, listLabels, a, c, numVect = 100, vect =
return imLab
def convexVolume(lab, boundingBoxes = None, centresOfMass = None, volumes = None, NumberOfThreads = 1, verbose = True):
def convexVolume(lab, boundingBoxes=None, centresOfMass=None, volumes=None, numberOfThreads=1, verbose=True):
"""
This function compute the convex hull of each label of the labelled image and return a
list with the convex volume of each particle.
......@@ -1558,7 +1558,7 @@ def convexVolume(lab, boundingBoxes = None, centresOfMass = None, volumes = None
Volumes in format returned by ``volumes``
If not defined (Default = None), it is recomputed by running ``volumes``
NumberOfThreads : integer (optional, default = 1)
numberOfThreads : integer (optional, default = 1)
Number of Threads for multiprocessing
Default = 1
......@@ -1622,11 +1622,11 @@ def convexVolume(lab, boundingBoxes = None, centresOfMass = None, volumes = None
# print "Master: Adding jobs to queues"
for x in range(1,numberOfJobs+1):
qJobs.put(x)
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
qJobs.put("STOP")
# print "Master: Launching workers"
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
p = multiprocessing.Process(target=worker, args=(i, qJobs, qResults, ))
p.start()
......@@ -1635,7 +1635,7 @@ def convexVolume(lab, boundingBoxes = None, centresOfMass = None, volumes = None
finishedThreads = 0
finishedJobs = 0
# print "Master: Waiting for results"
while finishedThreads < NumberOfThreads:
while finishedThreads < numberOfThreads:
result = qResults.get()
if result == "STOP":
......@@ -1653,7 +1653,7 @@ def convexVolume(lab, boundingBoxes = None, centresOfMass = None, volumes = None
return convexVolume
def moveLabels(lab, PhiField, boundingBoxes = None, centresOfMass = None, margin = 3, PhiCOM = True, threshold = 0.5, labelDilate = 0, NumberOfThreads = 1):
def moveLabels(lab, PhiField, boundingBoxes=None, centresOfMass=None, margin=3, PhiCOM=True, threshold=0.5, labelDilate=0, numberOfThreads=1):
"""
This function applies a discrete Phi field (from DDIC?) over a labelled image.
......@@ -1690,7 +1690,7 @@ def moveLabels(lab, PhiField, boundingBoxes = None, centresOfMass = None, margin
If ``labelDilate > 0`` a dilated label is returned, while ``labelDilate < 0`` returns an eroded label.
Default = 0
NumberOfThreads : int, optional
numberOfThreads : int, optional
Number of Threads for multiprocessing
Default = 1
......@@ -1799,9 +1799,9 @@ def moveLabels(lab, PhiField, boundingBoxes = None, centresOfMass = None, margin
for label in range(1, numberOfLabels):
q_jobs.put(label)
for i in range(NumberOfThreads): q_jobs.put("STOP")
for i in range(numberOfThreads): q_jobs.put("STOP")
#Launching workers
for i in range(NumberOfThreads):
for i in range(numberOfThreads):
p = multiprocessing.Process( target=work_on_one_job, args=(i, q_jobs, q_results,))
p.start()
......@@ -1812,7 +1812,7 @@ def moveLabels(lab, PhiField, boundingBoxes = None, centresOfMass = None, margin
pbar = progressbar.ProgressBar(widgets=widgets, maxval=numberOfLabels)
pbar.start()
while finished_threads < NumberOfThreads:
while finished_threads < numberOfThreads:
result = q_results.get()
if result == "STOP":
......
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