Skip to content
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

Median unreliable #16

Open
cookpa opened this issue Dec 19, 2024 · 1 comment
Open

Median unreliable #16

cookpa opened this issue Dec 19, 2024 · 1 comment

Comments

@cookpa
Copy link
Collaborator

cookpa commented Dec 19, 2024

As discovered by @caugolm

The median computed by

https://simpleitk.org/doxygen/v2_4/html/classitk_1_1simple_1_1LabelIntensityStatisticsImageFilter.html

Is based on a histogram calculation. The default number of bins is 128, over the whole intensity range of the image. This leads to bad median calculation when the values are tightly clustered, and is susceptible to outliers in the image.

Increasing the number of histogram bins to 10000 is an immediate fix, but IMO better to avoid this danger by using numpy to get the median.

@jeffduda
Copy link
Collaborator

jeffduda commented Dec 20, 2024

I agree wih the switch to numpy. This would be a good time to add a new column to the output for 'calculator' to indicate what package was used to calculate a given value. While it's possibly overkill for just this one change, it will make it easier to include values from additional packages like pyradiomics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants