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

default value

parent 9de391fe
Pipeline #47870 passed with stages
in 12 minutes and 50 seconds
......@@ -820,7 +820,7 @@ def _markerCorrection(markers, numMarkers, distanceMap, volBin, peakDistance=5,
peakDistance = int(peakDistance*1.3)
localMaxi = skimage.feature.peak_local_max(distanceMap, min_distance=peakDistance, indices=False, exclude_border = False, labels=volBin, num_peaks=2)
markers, numMarkers = scipy.ndimage.measurements.label(localMaxi,structure=struc)
# If there are no markers, decrease peakDistance
while (numpy.any(markers)==False or numpy.amax(markers) < 2):
if (counter > 10 ):
......@@ -830,7 +830,7 @@ def _markerCorrection(markers, numMarkers, distanceMap, volBin, peakDistance=5,
localMaxi = skimage.feature.peak_local_max(distanceMap, min_distance=peakDistance, indices=False, exclude_border = False, labels=volBin, num_peaks=2)
markers, numMarkers = scipy.ndimage.measurements.label(localMaxi,structure=struc)
counter = counter + 1
if (numpy.amax(markers) > 2):
centerOfMass = scipy.ndimage.measurements.center_of_mass(markers, labels=markers, index=range(1,numMarkers+1))
distances = numpy.zeros((numMarkers,numMarkers))
......
......@@ -411,7 +411,7 @@ def _checkSlice(topOfSlice, botOfSlice, topLimit, botLimit):
return returnSliceLimited, returnSliceOffset
def getLabel(labelledVolume, label, boundingBoxes=None, centresOfMass=None, margin=None, extractCube=False, extractCubeSize=None, maskOtherLabels=True, labelDilate=0, labelDilateMaskOtherLabels=True):
def getLabel(labelledVolume, label, boundingBoxes=None, centresOfMass=None, margin=None, extractCube=False, extractCubeSize=None, maskOtherLabels=True, labelDilate=0, labelDilateMaskOtherLabels=False):
"""
Helper function to extract labels from a labelled image/volume.
A dictionary is returned with the a subvolume around the particle.
......@@ -588,7 +588,7 @@ def getLabel(labelledVolume, label, boundingBoxes=None, centresOfMass=None, marg
maskLab[numpy.logical_and(labSubVol!=label, labSubVol!=0)] = 0
if labelDilate < 0:
strucuringElement = spam.mesh.structuringElement(radius=-1*labelDilate, order=2, dim=3)
maskLab = scipy.ndimage.morphology.binary_erosion( maskLab, structure=strucuringElement, iterations=1)
maskLab = scipy.ndimage.morphology.binary_erosion(maskLab, structure=strucuringElement, iterations=1)
# Just overwrite "labSubVol"
labSubVol = maskLab
......
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