<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "><pre>Hi,</pre><pre><br></pre><pre>Try to use the ImageMaskSpatialObject. You can set up regions</pre><pre><br></pre><pre>according to the extracted contours, it will not be as accurate</pre><pre><br></pre><pre>but certainly has some nice properties which can be used for </pre><pre><br></pre><pre>morphological operations or derivation.</pre><pre><br></pre><pre>Also, you have defined your contour starting from the point (-1,-1)</pre><pre><br></pre><pre>in the counterclockwise direction, try the opposite and let us know</pre><pre><br></pre><pre>how it works.</pre><pre><br></pre><pre>Best regards,</pre><pre><br></pre><pre>Dawood
Masslawi.</pre><pre><br></pre><pre>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<</pre><pre><br></pre><pre><span class="Apple-style-span" style="font-family: 'Times New Roman'; white-space: normal; "><pre>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<</pre></span></pre><pre><br></pre><pre>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;</pre><pre><br></pre></span></td></tr></table><br>