-
Notifications
You must be signed in to change notification settings - Fork 12
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
OtsuMultipleThresholdsImageFilter #25
Comments
In general, I would recommend to stay away from Nan values and replace them by valid numbers before you do any processing. The reason is that Nan can mean many different things, so algorithm developers can only guess what to do with NaN values. Even if the algorithm developer could implement computations based on some common interpretation, the significantly increased computation time, code complexity, overhead in implementation, testing, documentation, user support, and potential issues caused by silently choosing an arbitrary interpretation, far outweigh the benefits from supporting a tiny fraction of use cases. If you want to use Nan values for masking then I would recommend to use a separate mask image instead. |
Thank you @lassoan for the clarification. I am indeed using NaNs for masking.
Wouldn't that affect the segmentation/classification? Thanks a lot |
I'm not sure if Otsu implementation in ITK can take a mask image, but you can set all the NaN values to a very large value, compute the image histogram with a bin range that does not include the very large value, then get the Otsu threshold value from that histogram. |
Hi @blowekamp,
I am running into an issue where when running OtsuMultipleThresholdsImageFilter on an 32-bit image containing NaNs it returns an image where all pixel values = number_of_thresholds.
So I am wondering, can OtsuMultipleThresholdsImageFilter segment an image when it contains NaNs?
Thanks a lot!
The text was updated successfully, but these errors were encountered: