-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data is always 1 despite input image #219
Comments
Ah, I don't know whether this is a bug or a documentation issue or both 😅, but what is happening is that skan only interprets your image as an intensity image (ie as non-boolean) if it is of a float dtype. So, while we discuss the right path forward for the API, you should be able to work around this by using |
Yes, passing the array as a float dtype did give the expected behavior! |
Agreed. Since we produce mean values even for bool, as you have noted, I don't know why I even implemented the check in the first place. 😂 These seem to be the offending lines: Lines 507 to 510 in 20ab48d
If you're happy to contribute a PR (including a test based on your example above), I'd be happy to merge it! If you're too busy that's all good, I'll get to it "soon". 😊 |
Just updating to say I'm working on making a pull request. This will be my first time ever contributing to anything but my own stuff, so please be understanding and I'm happy to be guided however. Also the tests folder is full of great examples, so hopefully I will write one that is ok (and put this in practice for my own things). Thanks! |
Ok, pretty sure I did a pull request correctly? I'll be sure to follow. I'm glad I finally did something like this, was less intimidating than I expected. :) |
When I pass
skel_array
to
csr_skeleton = skan.csr.Skeleton(skeleton_image=skel_array, source_image=skel_array)
I would expect that thepaths.data
along each branch matches the original pixel value ofskel_array
(i.e. 1, 2, 3 or 4, depending on the label). However, all branches havemean-pixel-value
of 1.0.csr_skeleton.path_with_data(idx)
does return 1 for all corresponding pixel indices. I don't understand why, and tracking the.paths.data
definition back into scipy is not increasing clarity for me.My hope is to use the mean-pixel-value of each branch as a way to identify the label corresponding to each skeleton_id. This way I don't need to iterate the csr.Skeleton over each label individually.
The text was updated successfully, but these errors were encountered: