my question is when we apply vtkImageLabelOutline filter on labelMap means get the 2D contours of segmented slices or not?what is the difference between the 2d contours obtained from segmented slices and the results given by vtkImageLabelOutline.

vtkImageLabelOutline takes a labelmap image as input and provides a labelmap image as output where all “internal” pixels are cleared (so that only boundary pixels are left). This is used in Slicer for highlighting boundaries when displaying labelmap volumes and segmentations in slice views.

Thank you so much for the response
there are some 3d reconstrction methods that allow to reconstruct 3D models from 2d contours like the method implemented in SlicerRt which convert 2d contours to 3d smoothed surface (more precisely the converter rule : **vtkPlanarContourToClosedSurfaceConversionRule". can I use vtkImageLabelOutline to get 2D contours or i must segment each 2d image and exract the contour ?

In fact I would like to extract the point set (cloud) of the label contours, compute the point gradiants and a pply a 3d reconstrcution method. vtkImageLabelOutline does not seem providing good results are there Vtk filters to do that,

“Planar contour” representation is a set of polygons on parallel planes, while output of the image label outline filter is a 3D image.

SlicerRT extension’s planar contour to closed surface conversion rule creates a 3D surface. You can have a look at it how it works and modify it to do what you want.

Note that “planar contours” representation is already a point cloud, but it also has very valuable point connectivity information, which allows reconstruction of much more elaborate surfaces.

I have a question that seems important, you know that 3d reconstruction methods which use implicit function depend to the precision of normal vectors.

To compute normal vectors from labelMap, I have applied gaussian and gradians filters to get the normal vectors. I have used Cast filter also to avoid providing null normal vectors. Bt I don’t get good results. My question is : I want extract ponts from labelMap, convert them to RAS space and apply “vtkPCANormalEstimation” to estimate normal vector.

I want normal vectors points outside. but I don’t knwo if it is the right choice

vtkPCANormalEstimation is not relevant here, as it works on unorganized point clouds, while here you know the geometry (you have contours organized in planes). Ignoring connectivity information and treating contour points as a point cloud would lead to very bad quality results, especially when the contours are relatively far away from each other (farther than neighbor points from each other within a contour).

In other posts, I already explained in detail how you can get point normals (smoothing the binary labelmap and computing image gradient).

Yes is exactly what I did, But I don’t want compute normal vectors of the entire labelMap , so I need to apply first “vtkImageLabelOutline” to clear internal pixels and left only boundry pixels, can I apply the series of filters (cast filter, gaussain, gradiant…) on labelMap boundries or it is wrong because apply my implicit method on the entire labelMap does not seem work. It is just an idea beacuse planar contours representation is not supported yet in 3d slicer