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

Ability to set minimum size for the connected components in isolate() #2324

Open
iyerkrithika21 opened this issue Sep 12, 2024 · 0 comments
Open

Comments

@iyerkrithika21
Copy link
Contributor

If the segmentation is too noisy the the isolate function fails as it is unable to handle the large number of connected components. ITK filter by default labels each non-zero unconnected pixel as a separate object, which is not efficient.
We need to be able to specify the minimum object size required.

   # source: https://github.com/Bonelab/DECT_BoneAnalysis/blob/87ab9cad4afcc029085dc403ed212a7be39176ce/Segment_Edema.py#L110

   #Component labeling to remove small clusters less than 100 voxels in size:
    cc_filter = sitk.ConnectedComponentImageFilter()
    cl = cc_filter.Execute(edema_masked)

    cc_relabel = sitk.RelabelComponentImageFilter()
    cc_relabel.SetMinimumObjectSize(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant