Hi, Kevin,<br><br>Thanks for your reply. However, I still can&#39;t get it to work. Here is my simple code, where I want to calculate the distance map to point [50,50]. I write the output of the FastMarching filter to .vtk file and open it in Paraview.<br>
<br>    typedef itk::Image&lt;float,2&gt; ImageType;<br>    typedef itk::FastMarchingImageFilter&lt;ImageType,ImageType &gt;FastMarchingFilterType;<br>    FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New();<br>
    typedef FastMarchingFilterType::NodeContainer        NodeContainer;<br>    typedef FastMarchingFilterType::NodeType             NodeType;<br>    /////// alive points<br>    NodeContainer::Pointer alivePoints = NodeContainer::New();<br>
    alivePoints-&gt;Initialize();<br>    NodeType nodeAlive;<br>    ImageType::IndexType index; index[0]=50; index[1]=50;<br>    nodeAlive.SetValue(0.0);<br>    nodeAlive.SetIndex(index);    <br>    alivePoints-&gt;InsertElement(0,nodeAlive);<br>
    fastMarching-&gt;SetTrialPoints(alivePoints);<br><br>     ImageType::IndexType start; start[0]=0; start[1]=0;<br>     ImageType::SizeType size; size[0]=100; size[1]=100;<br>     ImageType::RegionType region; region.SetSize(size); region.SetIndex(start);<br>
     fastMarching-&gt;SetOutputRegion(region);<br>    fastMarching-&gt;SetSpeedConstant(1.0);    <br>    fastMarching-&gt;SetStoppingValue(10);<br>    typedef itk::ImageFileWriter&lt;ImageType&gt; WriterType;<br>    WriterType::Pointer writer = WriterType::New();<br>
    writer-&gt;SetFileName(&quot;fastMarching.vtk&quot;);<br>    writer-&gt;SetInput(fastMarching-&gt;GetOutput());<br>    writer-&gt;Update();<br><br>Thank you for any input.<br>Siqi<br><br><br><div class="gmail_quote">On Tue, Dec 29, 2009 at 4:25 PM, Kevin H. Hobbs <span dir="ltr">&lt;<a href="mailto:hobbsk@ohiou.edu">hobbsk@ohiou.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On 12/29/2009 03:10 PM, siqi chen wrote:<br>
&gt; Hi, ITKers,<br>
&gt;<br>
&gt; I have a simple question regarding how to use FastMarchingImageFilter to<br>
&gt; calculate distance map.<br>
&gt;<br>
&gt; If I have a pointset P with integer coordinates, and I want to calculate a<br>
&gt; distance map to P. What should I pass to FastMarchingImageFilter?<br>
&gt;<br>
&gt; What I did is:<br>
&gt; 1. pass P to AlivePoints with value 0.0,<br>
&gt; 2. pass all the 4 neighbors of P to TrialPoints with value 1.0<br>
&gt; 3. set the speedconstant to 1.0<br>
&gt; 4. set the outputregion, size, origin, ....<br>
&gt;<br>
&gt; Am I missing something?<br>
&gt;<br>
<br>
</div></div>1. pass P to TrialPoints with value 0.0<br>
<div><div></div><div class="h5">2. set the speedconstant to 1.0<br>
3. set the outputregion, size, origin, ....<br>
<br>
</div></div></blockquote></div><br>