[Insight-users] Extract all disconnected regions
Rémi Blanc
rblanc33 at gmail.com
Thu Jun 7 13:31:10 EDT 2012
Hi,
here would be my idea:
I haven't used ConnectedComponentImageFilter, but as far as I understand
the documentation, the output should be an image where each connected
component has a unique label.
You could feed this image to a LabelImageToLabelMapFilter to get a
LabelMap containing one LabelObject per connected component.
Then, for each of these LabelObject, you can
- create a new label map (with same origin, spacing & size)
- add the current labelObject
- use a LabelMapToBinaryImageFilter to generate a binary image out of it.
Best,
Rémi
More information about the Insight-users
mailing list