ENH: Update LabelGeometryMeasures to not use deprecated filter#1737
Merged
ENH: Update LabelGeometryMeasures to not use deprecated filter#1737
Conversation
Member
|
Awesome. Thanks @cookpa |
Member
Author
|
Can't convert to draft from my phone but don't merge yet I will make a couple of changes to maintain backwards compatibility in column names as requested by @stnava |
Member
Author
|
In the latest commit, I've added "Eccentricity" and "Axes Length" back, both derived from the label principal moments. Axes length agrees with the old definition, which suggests that the moments are the same. But eccentricity differs. |
Member
Author
|
More discussion of the numbers here |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)