[Insight-users] itkContourSpatialObject

Dawood Masslawi masslawi at gmail.com
Sat Dec 25 17:34:02 EST 2010


Hi,
Try to use the ImageMaskSpatialObject. You can set up regions
according to the extracted contours, it will not be as accurate
but certainly has some nice properties which can be used for 
morphological operations or derivation.
Also, you have defined your contour starting from the point (-1,-1)
in the counterclockwise direction, try the opposite and let us know
how it works.
Best regards,
Dawood Masslawi.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Dear list,

I got a set of 2d-contours in xy-planes.
What I would like to create from that is a 3d binary mask image.
The pixels where the contour-points are on should also be set
to the "foreground" value.

What I tried to do:
Using PolygonSpatialObject and SpatialObjectToImageFilter and
iterating through the slices. Problem: This way the pixels on the contourline
where not included.

I found ContourSpatialObject and wanted to try that but it doesn't work
the way I want :)

Following code should create a contour box and test if 0,0 is inside
the contour, which should return 1 but it doesn't.

Thanks for your help.

Cheers,
Dirk



typedef itk::ContourSpatialObject<2>  ContourType;
typedef ContourType::Pointer ContourPointer;
typedef ContourType::ControlPointType ContourPointType;
typedef itk::Image< unsigned char, 2>       ImageType;

ContourType::ControlPointListType list;
ContourPointType p;
p.SetPickedPoint(-1,-1);
list.push_back(p);
ContourPointType p1;
p1.SetPickedPoint(-1,1);
list.push_back(p1);
ContourPointType p2;
p2.SetPickedPoint(1,1);
list.push_back(p2);
ContourPointType p3;
p3.SetPickedPoint(1,-1);
list.push_back(p3);
ContourPointer icontour = ContourType::New();
icontour->SetControlPoints(list);
ImageType::PointType testpoint;



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101225/7bcfd1a5/attachment.htm>


More information about the Insight-users mailing list