ENH: Update LabelGeometryMeasures to not use deprecated filter #1737
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not a fix but part of the way to fixing #1733
I replaced the filter and added some new features including computing mean and median intensities of gray images.
Some attributes don't have an exact analog. I changed some headers to be general over 2D / 3D
New columns are
Label
NumberOfVoxels
PhysicalSize - area in 2D (mm^2) or volume in 3D (mm^3)
Perimeter - perimeter in 2D or surface area in 3D
Elongation - Note this differs from old implementation
Roundness - new
Flatness - new
Centroid_x - Note this differs from old implementation
Centroid_y
Centroid_z
BoundingBoxLower_x - reordered (open to changing this)
BoundingBoxLower_y
BoundingBoxLower_z
BoundingBoxUpper_x
BoundingBoxUpper_y
BoundingBoxUpper_z
MeanIntensity - Grayscale stats if intensity image provided
SigmaIntensity
MedianIntensity
MinIntensity
MaxIntensity
Eccentricity, Orientation have been removed as they don't exist in the new filter. Also, I didn't add the "WeightedCentroid" for gray images, I don't think that exists in
LabelStatisticsImageFilter
.To check the centroid, I compared to SimpleITK:
which agrees with my definition but note that it differs from the old filter and also what c3d reports (I am not sure what filter it uses)