Skip to content

Conversation

cookpa
Copy link
Member

@cookpa cookpa commented Feb 26, 2025

This contains more fixes for LabelGeometryMeasures.

The median was only added relatively recently, when switching out the deprecated ITK filter. But it is approximated and derived from a histogram, the default is to use 255 bins over the whole range of the image. This can get really imprecise when there are outliers or a large dynamic range, eg, t-statistic maps - this is how the problem was brought to my attention.

I experimented with using a mask of all the labels to define the histogram range for intensity voxels inside the mask. I also increased the number of histogram bins. It works better, but still, I'm not sure it's a good idea to include imprecise information, and I expect most users who really want median would rather compute it exactly with numpy or similar.

Mean, Min, Max, and Sum (called "IntegratedIntensity" for backwards compatibility) are computed exactly and remain in this version.

@cookpa cookpa merged commit fc0589f into master Feb 26, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant