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

Update LabelGeometryMeasures to use improved ITK filter #1269

Open
cookpa opened this issue Nov 15, 2021 · 6 comments
Open

Update LabelGeometryMeasures to use improved ITK filter #1269

cookpa opened this issue Nov 15, 2021 · 6 comments
Labels
feature request Ideas for new or improved ANTs features wouldbenice Nice ideas not under development (pull requests welcome)

Comments

@cookpa
Copy link
Member

cookpa commented Nov 15, 2021

Is your feature request related to a problem?

Possibly,

https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/6

Proposed new features

Use updated new implementation

https://itk.org/Doxygen/html/classitk_1_1LabelImageToShapeLabelMapFilter.html

@cookpa cookpa added the feature request Ideas for new or improved ANTs features label Nov 15, 2021
@ntustison
Copy link
Member

Sounds like a good idea. I didn't know the current version doesn't take into account image orientation information. Do you want to make this change or would you like me to put it on my to-do list?

@cookpa
Copy link
Member Author

cookpa commented Nov 15, 2021

I can do it. I did a little more exploring, it looks like it uses index space for some calculations

https://discourse.itk.org/t/labelgeometryimagefilter-not-using-physical-space/1566/3

@ntustison
Copy link
Member

Thanks. I don't think the changes should affect us to much as most usage, I would imagine, are the volume and surface area calculations which should be unaffected, the latter being a completely separate filter.

@cookpa
Copy link
Member Author

cookpa commented Nov 18, 2021

@ntustison correct, it looks like you already replaced LabelGeometryImageFilter with LabelImageToShapeLabelMapFilter specifically for the surface area computation. I might actually need help as I can't understand this label map structure.

The rest of the stats apart from surface area still come from LabelGeometryImageFilter. The ShapeLabelObject provides elongation, centroid, bounds but not eccentricity. And it gets more complicated still once a grayscale image is involved. The Insight article says to use a StatisticsLabelMapFilter but I don't understand it as that appears to want a label image as input rather than a label map.

@ntustison
Copy link
Member

Thanks @cookpa . Now I remember making these changes. Gaetan had originally written a really nice digital perimeter estimation filter which, if I remember correctly, was eventually integrated into the LabelObject framework and so I switched over. I'm pretty sure I looked at moving everything over but it wasn't clear to me what the equivalent calls were or what do with what appears to be additional measures, so I punted. Perhaps we should create something like LabelGeometryMeasures2 with the possibility of deprecating the original at some point. What do you think?

@cookpa
Copy link
Member Author

cookpa commented Nov 18, 2021

Makes sense. It's a lower priority than I first thought.

@cookpa cookpa added the wouldbenice Nice ideas not under development (pull requests welcome) label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Ideas for new or improved ANTs features wouldbenice Nice ideas not under development (pull requests welcome)
Projects
None yet
Development

No branches or pull requests

2 participants