You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I am processing a float image (linked below) to detect peaks.
When i call feature.peak_local_max without defining labels everything is fine. If I define labels the call to feature.peak_local_max causes a change in the intensity values (adding/changing the value of some pixels to 1.7976931348623157e+308) of the image processed. I can replicate the issue with skimage 0.18.0 and 0.18.1 however everything works fine with skimage 0.17.2. Please let me know if I missed anything because I cannot wrap my head around the issue. Thanks!
fromskimageimportfeature, measurefromscipyimportndimageasnddeftest(img):
print(f'min value original: {img.min()}')
thr=2.208img_mask=img>thrlabels=nd.label(img_mask)[0]
properties=measure.regionprops(labels)
forobinproperties:
ifob.area<10orob.area>600:
img_mask[ob.coords[:,0],ob.coords[:,1]]=0labels=nd.label(img_mask)[0]
properties=measure.regionprops(labels,intensity_image=img)
selected_peaks=feature.peak_local_max(img, min_distance=5,
threshold_abs=thr, exclude_border=True,
footprint=None,num_peaks_per_label=1)
print(f'min value after peak calling no labels: {img.min()}')
selected_peaks=feature.peak_local_max(img, min_distance=5,
threshold_abs=thr, exclude_border=True,
footprint=None, labels=labels,num_peaks_per_label=1)
print(f'min value after peak calling using labels: {img.min()}')
returnselected_peaksimg, meta=pickle.load(open(path-to-img ,'rb'))
pk=test(img, thr)
# RESULT # min value original: 0.2976309153266585# min value after peak calling no labels: 0.2976309153266585# min value after peak calling using labels: -1.7976931348623157e+308
Version information
3.8.2 (default, May72020, 20:00:49)
[GCC7.3.0]
Linux-3.10.0-957.1.3.el7.x86_64-x86_64-with-glibc2.10scikit-imageversion: 0.18.0# same error in scikit-image version: 0.18.1# everything works fine in version 0.17.2numpyversion: 1.19.4
The text was updated successfully, but these errors were encountered:
Description
Hi
I am processing a float image (linked below) to detect peaks.
When i call
feature.peak_local_max
without defining labels everything is fine. If I define labels the call tofeature.peak_local_max
causes a change in the intensity values (adding/changing the value of some pixels to1.7976931348623157e+308
) of the image processed. I can replicate the issue withskimage 0.18.0 and 0.18.1
however everything works fine withskimage 0.17.2
. Please let me know if I missed anything because I cannot wrap my head around the issue. Thanks!File to reproduce the issue
img_path_dropbox = get image from here
Way to reproduce
Version information
The text was updated successfully, but these errors were encountered: