Export segmentation contour from cine-mri images (one single time frame)

Hi 3D Slicer Community !

My name is Marco and I am a PhD student passionated about medical images based modelling.

I would like to ask support about exporting the segmentation contour of a mask.

I am working with cine-mri images of the human aorta. With this kind of imaging technique, you can get the in-plane motion of the aorta over the time. In this case, the time resolution is about 25 frames for cardiac cycle. My aim is to estimate the motion of the aorta from cine-mri images.

I segmented manually each frame (therefore one single slice for each frame). An example of segmentation for one frame is reported below:

If I untick the Slice Fill option, I get the contour of the segmetation as shown in the image below:

In that image, the contour of the segmentation is represented by a broken line. The broken line is made up by joining several points. These points are corners of pixels in the slice and are associated with some x, y and z coordinates.

I am looking for a method to store those coordinates.

I have seen similar topics at:
Extract contours only from a segmentation - Support - 3D Slicer Community

And found that the vtkImageLabelOutline should be the right filter for this task. However it does not seem to be available in Python API.

It would be great if someone would like to share his/her ideas.

Thanks,

Marco

I guess this is a sequence of 2D frames? If so you might try this class:

https://vtk.org/doc/nightly/html/classvtkFlyingEdges2D.html#details

Otherwise if it’s 3D you could just export to a surface model and get the vertices.

1 Like

Hi Steve,

Many thanks for your answer.

Indeed, it is a sequence of 2D frames and the class you suggested seems to do exactly what I am looking for. I will try it and let you know.

Thanks

Marco

Hi Steve,
Thanks again for your suggestion.
In the description of the vtkFlyingEdges2D filter it is written: “If you are interested in extracting segmented regions from a label mask, consider using vtkDiscreteFlyingEdges2D.”

I implemented this filter in my code and it does perfectly what I asked in the post.

Thanks,

Marco

1 Like