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
I have found an issue with function chords_count on a chord filled image where spacing=0. The issue does not seems to appear when I use a spacing greater than 0.
In my case, I'm interested by chords length in a binary image of 800^3 voxels and I end up with a 10^8 chord length using function chords_count. Similar to this previous issue (#131).
I suspect this commit (6808792) introduced a regression for images that contained chords already labelled. Looking at the history, there seems to be a few back-and-forth commit, making the function unable to works with 0-spaced chord images, even though already labelled.
Possible fix
chords_count should check the image to know if it is labelled : a simple check like len(np.unique(im)) > 2 should be enough for most cases. There might a some corners cases that I have not though about.
another possibility would be for apply_chords to only return labelled image, as it appears in the code that labels are computed and removed at the end if not asked and remove the labeling in chords_count. This change will probably break backward compatibility.
If you want, I could make the change and a pull request once done.
The text was updated successfully, but these errors were encountered:
Thanks for this report, and we appreciate the offer of a PR. I will take a look and get back to you.
ma-sadeghi
changed the title
chords_apply with spacing=0 is incompatible with chords_countchords_apply with spacing=0 is incompatible with chords_countAug 12, 2022
The issue
I have found an issue with function
chords_count
on a chord filled image wherespacing=0
. The issue does not seems to appear when I use a spacing greater than 0.In my case, I'm interested by chords length in a binary image of 800^3 voxels and I end up with a 10^8 chord length using function
chords_count
. Similar to this previous issue (#131).I suspect this commit (6808792) introduced a regression for images that contained chords already labelled. Looking at the history, there seems to be a few back-and-forth commit, making the function unable to works with 0-spaced chord images, even though already labelled.
Possible fix
chords_count
should check the image to know if it is labelled : a simple check likelen(np.unique(im)) > 2
should be enough for most cases. There might a some corners cases that I have not though about.apply_chords
to only return labelled image, as it appears in the code that labels are computed and removed at the end if not asked and remove the labeling inchords_count
. This change will probably break backward compatibility.If you want, I could make the change and a pull request once done.
The text was updated successfully, but these errors were encountered: