<DIV>Hi,</DIV>  <DIV>I modified FastMarchingImageFilter.cxx that is found in Examples\Segmentation to work on a 3D analyze format image. After compilation, I executed it from the command line:</DIV>  <DIV>&nbsp;</DIV><FONT size=2>  <DIV>FM_Filter3D.exe mri4itk.hdr mri4itkResult.hdr <FONT size=2></DIV>  <DIV>1.25 -8.0 75.0 10 15 </DIV>  <DIV>108 125&nbsp;1 110 125 5 112 124 10 113 124 15 113 123 20 107 130 25 94 136 32</DIV>  <DIV>&nbsp;</DIV>  <DIV>The second line has values for sigma, alpha, beta, threshold and stopping time</DIV>  <DIV>The third line contains indices (x,y,z) for a set of 7 points. All three lines were concatenated into one when running the program. The segmentation results don't look good. The binary image contains a large white spot in each slice. I am trying to segment the right artery which appears as a white spot on the right side in the input image. The text of my program is given below. I tried to attach the image (mri4itk.hdr, mri4itk.img) to this
 email, but&nbsp; the email bounced. The size is approximately 3 MB. Can I send the images somehow? </DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks,</DIV>  <DIV>Vijay</DIV>  <DIV>&nbsp;</DIV><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkCurvatureAnisotropicDiffusionImageFilter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkGradientMagnitudeRecursiveGaussianImageFilter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkSigmoidImageFilter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkImage.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkFastMarchingImageFilter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000
 size=2>"itkBinaryThresholdImageFilter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkImageFileReader.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkImageFileWriter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>#include</FONT><FONT size=2> </FONT><FONT color=#800000 size=2>"itkRescaleIntensityImageFilter.h"</DIV></FONT><FONT color=#0000ff size=2>  <DIV>int</FONT><FONT size=2> main( </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> argc, </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> *argv[] )</DIV>  <DIV>{</DIV>  <DIV></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>( argc &lt; 11 ) {</DIV>  <DIV>std::cerr &lt;&lt; </FONT><FONT color=#800000 size=2>"Missing Parameters "</FONT><FONT size=2> &lt;&lt; std::endl;</DIV>  <DIV>std::cerr &lt;&lt; </FONT><FONT color=#800000 size=2>"Usage: "</FONT><FONT size=2>
 &lt;&lt; argv[0];</DIV>  <DIV>std::cerr &lt;&lt; </FONT><FONT color=#800000 size=2>" inputImage outputImage"</FONT><FONT size=2>;</DIV>  <DIV>std::cerr &lt;&lt; </FONT><FONT color=#800000 size=2>" Sigma SigmoidAlpha SigmoidBeta TimeThreshold StoppingValue seedX seedY seedZ"</FONT><FONT size=2> &lt;&lt; std::endl;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> 1;</DIV>  <DIV>}</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2> InternalPixelType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> Dimension = 3;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image&lt; InternalPixelType, Dimension &gt; InternalImageType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2>
 </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> OutputPixelType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image&lt; OutputPixelType, Dimension &gt; OutputImageType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::BinaryThresholdImageFilter&lt; InternalImageType, </DIV>  <DIV>OutputImageType &gt; ThresholdingFilterType;</DIV>  <DIV>ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();</DIV>  <DIV></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> InternalPixelType timeThreshold = atof( argv[6] );</DIV>  <DIV></DIV>  <DIV>thresholder-&gt;SetLowerThreshold( 0.0 );</DIV>  <DIV>thresholder-&gt;SetUpperThreshold( timeThreshold );</DIV>  <DIV>thresholder-&gt;SetOutsideValue( 0 );</DIV>  <DIV>thresholder-&gt;SetInsideValue( 255 );</DIV>  <DIV></DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT
 size=2> itk::ImageFileReader&lt; InternalImageType &gt; ReaderType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::ImageFileWriter&lt; OutputImageType &gt; WriterType;</DIV>  <DIV></DIV>  <DIV>ReaderType::Pointer reader = ReaderType::New();</DIV>  <DIV>WriterType::Pointer writer = WriterType::New();</DIV>  <DIV>reader-&gt;SetFileName( argv[1] );</DIV>  <DIV>writer-&gt;SetFileName( argv[2] );</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::RescaleIntensityImageFilter&lt; </DIV>  <DIV>InternalImageType, </DIV>  <DIV>OutputImageType &gt; CastFilterType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::CurvatureAnisotropicDiffusionImageFilter&lt; </DIV>  <DIV>InternalImageType, </DIV>  <DIV>InternalImageType &gt; SmoothingFilterType;</DIV>  <DIV>SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();</DIV>  <DIV></DIV>  <DIV></FONT><FONT color=#0000ff
 size=2>typedef</FONT><FONT size=2> itk::GradientMagnitudeRecursiveGaussianImageFilter&lt; </DIV>  <DIV>InternalImageType, </DIV>  <DIV>InternalImageType &gt; GradientFilterType;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::SigmoidImageFilter&lt; </DIV>  <DIV>InternalImageType, </DIV>  <DIV>InternalImageType &gt; SigmoidFilterType;</DIV>  <DIV></DIV>  <DIV>GradientFilterType::Pointer gradientMagnitude = GradientFilterType::New();</DIV>  <DIV>SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();</DIV>  <DIV>sigmoid-&gt;SetOutputMinimum( 0.0 );</DIV>  <DIV>sigmoid-&gt;SetOutputMaximum( 1.0 );</DIV>  <DIV></DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::FastMarchingImageFilter&lt; InternalImageType, </DIV>  <DIV>InternalImageType &gt; FastMarchingFilterType;</DIV>  <DIV>FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New();</DIV>  <DIV></DIV>  <DIV>smoothing-&gt;SetInput(
 reader-&gt;GetOutput() );</DIV>  <DIV>gradientMagnitude-&gt;SetInput( smoothing-&gt;GetOutput() );</DIV>  <DIV>sigmoid-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );</DIV>  <DIV>fastMarching-&gt;SetInput( sigmoid-&gt;GetOutput() );</DIV>  <DIV>thresholder-&gt;SetInput( fastMarching-&gt;GetOutput() );</DIV>  <DIV>writer-&gt;SetInput( thresholder-&gt;GetOutput() );</DIV>  <DIV>smoothing-&gt;SetTimeStep( 0.0625 );</DIV>  <DIV>smoothing-&gt;SetNumberOfIterations( 5 );</DIV>  <DIV>smoothing-&gt;SetConductanceParameter( 9.0 );</DIV>  <DIV></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> sigma = atof( argv[3] );</DIV>  <DIV>gradientMagnitude-&gt;SetSigma( sigma );</DIV>  <DIV></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> alpha = atof( argv[4] );</DIV>  <DIV></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT
 color=#0000ff size=2>double</FONT><FONT size=2> beta = atof( argv[5] );</DIV>  <DIV>sigmoid-&gt;SetAlpha( alpha );</DIV>  <DIV>sigmoid-&gt;SetBeta( beta );</DIV>  <DIV></DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> FastMarchingFilterType::NodeContainer NodeContainer;</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> FastMarchingFilterType::NodeType NodeType;</DIV>  <DIV>NodeContainer::Pointer seeds = NodeContainer::New();</DIV>  <DIV></DIV>  <DIV>InternalImageType::IndexType seedPosition1;</DIV>  <DIV>InternalImageType::IndexType seedPosition2;</DIV>  <DIV>InternalImageType::IndexType seedPosition3;</DIV>  <DIV>InternalImageType::IndexType seedPosition4;</DIV>  <DIV>InternalImageType::IndexType seedPosition5;</DIV>  <DIV>InternalImageType::IndexType seedPosition6;</DIV>  <DIV>InternalImageType::IndexType seedPosition7;</DIV></FONT><FONT color=#008000 size=2>  <DIV>&nbsp;</DIV></FONT><FONT size=2>  <DIV>seedPosition1[0] =
 atoi( argv[8] );</DIV>  <DIV>seedPosition1[1] = atoi( argv[9] );</DIV>  <DIV>seedPosition1[2] = atoi( argv[10] );</DIV>  <DIV>seedPosition2[0] = atoi( argv[11] );</DIV>  <DIV>seedPosition2[1] = atoi( argv[12] );</DIV>  <DIV>seedPosition2[2] = atoi( argv[13] );</DIV>  <DIV>seedPosition3[0] = atoi( argv[14] );</DIV>  <DIV>seedPosition3[1] = atoi( argv[15] );</DIV>  <DIV>seedPosition3[2] = atoi( argv[16] );</DIV>  <DIV>seedPosition4[0] = atoi( argv[17] );</DIV>  <DIV>seedPosition4[1] = atoi( argv[18] );</DIV>  <DIV>seedPosition4[2] = atoi( argv[19] );</DIV>  <DIV>seedPosition5[0] = atoi( argv[20] );</DIV>  <DIV>seedPosition5[1] = atoi( argv[21] );</DIV>  <DIV>seedPosition5[2] = atoi( argv[22] );</DIV>  <DIV>seedPosition6[0] = atoi( argv[23] );</DIV>  <DIV>seedPosition6[1] = atoi( argv[24] );</DIV>  <DIV>seedPosition6[2] = atoi( argv[25] );</DIV>  <DIV>seedPosition7[0] = atoi( argv[26] );</DIV>  <DIV>seedPosition7[1] = atoi( argv[27] );</DIV>  <DIV>seedPosition7[2] = atoi(
 argv[28] );</DIV>  <DIV>NodeType seed1;</DIV>  <DIV>NodeType seed2;</DIV>  <DIV>NodeType seed3;</DIV>  <DIV>NodeType seed4;</DIV>  <DIV>NodeType seed5;</DIV>  <DIV>NodeType seed6;</DIV>  <DIV>NodeType seed7;</DIV></FONT><FONT color=#008000 size=2></FONT><FONT size=2>  <DIV></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> seedValue = 0.0;</DIV>  <DIV>seed1.SetValue( seedValue );</DIV>  <DIV>seed1.SetIndex( seedPosition1 );</DIV>  <DIV>seed2.SetValue( seedValue );</DIV>  <DIV>seed2.SetIndex( seedPosition2 );</DIV></FONT><FONT color=#008000 size=2></FONT><FONT size=2>  <DIV>seed3.SetValue( seedValue );</DIV>  <DIV>seed3.SetIndex( seedPosition3 );</DIV></FONT><FONT color=#008000 size=2></FONT><FONT size=2>  <DIV>seed3.SetValue( seedValue );</DIV>  <DIV>seed3.SetIndex( seedPosition4 );</DIV></FONT><FONT color=#008000 size=2></FONT><FONT size=2>  <DIV>seed3.SetValue( seedValue );</DIV>  <DIV>seed3.SetIndex(
 seedPosition5 );</DIV></FONT><FONT color=#008000 size=2></FONT><FONT size=2>  <DIV>seed3.SetValue( seedValue );</DIV>  <DIV>seed3.SetIndex( seedPosition6 );</DIV></FONT><FONT color=#008000 size=2></FONT><FONT size=2>  <DIV>seed3.SetValue( seedValue );</DIV>  <DIV>seed3.SetIndex( seedPosition7 );</DIV>  <DIV></DIV>  <DIV>seeds-&gt;Initialize();</DIV>  <DIV>seeds-&gt;InsertElement( 0, seed1 );</DIV>  <DIV>seeds-&gt;InsertElement( 1, seed2 );</DIV>  <DIV>seeds-&gt;InsertElement( 2, seed3 );</DIV>  <DIV>seeds-&gt;InsertElement( 3, seed4 );</DIV>  <DIV>seeds-&gt;InsertElement( 4, seed5 );</DIV>  <DIV>seeds-&gt;InsertElement( 5, seed4 );</DIV>  <DIV>seeds-&gt;InsertElement( 6, seed5 );</DIV>  <DIV>fastMarching-&gt;SetTrialPoints( seeds );</DIV>  <DIV></DIV>  <DIV>CastFilterType::Pointer caster1 = CastFilterType::New();</DIV>  <DIV>CastFilterType::Pointer caster2 = CastFilterType::New();</DIV>  <DIV>CastFilterType::Pointer caster3 = CastFilterType::New();</DIV> 
 <DIV>CastFilterType::Pointer caster4 = CastFilterType::New();</DIV>  <DIV>WriterType::Pointer writer1 = WriterType::New();</DIV>  <DIV>WriterType::Pointer writer2 = WriterType::New();</DIV>  <DIV>WriterType::Pointer writer3 = WriterType::New();</DIV>  <DIV>WriterType::Pointer writer4 = WriterType::New();</DIV>  <DIV>caster1-&gt;SetInput( smoothing-&gt;GetOutput() );</DIV>  <DIV>writer1-&gt;SetInput( caster1-&gt;GetOutput() );</DIV>  <DIV>writer1-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput1.hdr"</FONT><FONT size=2>);</DIV>  <DIV>caster1-&gt;SetOutputMinimum( 0 );</DIV>  <DIV>caster1-&gt;SetOutputMaximum( 255 );</DIV>  <DIV>writer1-&gt;Update();</DIV>  <DIV>caster2-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );</DIV>  <DIV>writer2-&gt;SetInput( caster2-&gt;GetOutput() );</DIV>  <DIV>writer2-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput2.hdr"</FONT><FONT size=2>);</DIV>  <DIV>caster2-&gt;SetOutputMinimum( 0
 );</DIV>  <DIV>caster2-&gt;SetOutputMaximum( 255 );</DIV>  <DIV>writer2-&gt;Update();</DIV>  <DIV>caster3-&gt;SetInput( sigmoid-&gt;GetOutput() );</DIV>  <DIV>writer3-&gt;SetInput( caster3-&gt;GetOutput() );</DIV>  <DIV>writer3-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput3.hdr"</FONT><FONT size=2>);</DIV>  <DIV>caster3-&gt;SetOutputMinimum( 0 );</DIV>  <DIV>caster3-&gt;SetOutputMaximum( 255 );</DIV>  <DIV>writer3-&gt;Update();</DIV>  <DIV>caster4-&gt;SetInput( fastMarching-&gt;GetOutput() );</DIV>  <DIV>writer4-&gt;SetInput( caster4-&gt;GetOutput() );</DIV>  <DIV>writer4-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput4.hdr"</FONT><FONT size=2>);</DIV>  <DIV>caster4-&gt;SetOutputMinimum( 0 );</DIV>  <DIV>caster4-&gt;SetOutputMaximum( 255 );</DIV>  <DIV>fastMarching-&gt;SetOutputSize( </DIV>  <DIV>reader-&gt;GetOutput()-&gt;GetBufferedRegion().GetSize() );</DIV>  <DIV></FONT><FONT color=#0000ff
 size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> stoppingTime = atof( argv[7] );</DIV>  <DIV>fastMarching-&gt;SetStoppingValue( stoppingTime );</DIV>  <DIV></DIV>  <DIV></FONT><FONT color=#0000ff size=2>try</DIV></FONT><FONT size=2>  <DIV>{</DIV>  <DIV>writer-&gt;Update();</DIV>  <DIV>}</DIV>  <DIV></FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>( itk::ExceptionObject &amp; excep )</DIV>  <DIV>{</DIV>  <DIV>std::cerr &lt;&lt; </FONT><FONT color=#800000 size=2>"Exception caught !"</FONT><FONT size=2> &lt;&lt; std::endl;</DIV>  <DIV>std::cerr &lt;&lt; excep &lt;&lt; std::endl;</DIV>  <DIV>}</DIV>  <DIV>writer4-&gt;Update();</DIV>  <DIV></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::ImageFileWriter&lt; InternalImageType &gt; InternalWriterType;</DIV>  <DIV>InternalWriterType::Pointer mapWriter = InternalWriterType::New();</DIV>  <DIV>mapWriter-&gt;SetInput( fastMarching-&gt;GetOutput() );</DIV> 
 <DIV>mapWriter-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput4.mha"</FONT><FONT size=2>);</DIV>  <DIV>mapWriter-&gt;Update();</DIV>  <DIV>InternalWriterType::Pointer speedWriter = InternalWriterType::New();</DIV>  <DIV>speedWriter-&gt;SetInput( sigmoid-&gt;GetOutput() );</DIV>  <DIV>speedWriter-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput3.mha"</FONT><FONT size=2>);</DIV>  <DIV>speedWriter-&gt;Update();</DIV>  <DIV>InternalWriterType::Pointer gradientWriter = InternalWriterType::New();</DIV>  <DIV>gradientWriter-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );</DIV>  <DIV>gradientWriter-&gt;SetFileName(</FONT><FONT color=#800000 size=2>"FastMarchingFilterOutput2.mha"</FONT><FONT size=2>);</DIV>  <DIV>gradientWriter-&gt;Update();</DIV>  <DIV></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> 0;</DIV>  <DIV>}</DIV></FONT><FONT face=Arial size=2></FONT></FONT></FONT><p>&#32;



      <hr size=1>Ahhh...imagining that irresistible "new car" smell?<br> Check out
<a href="http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-">new cars at Yahoo! Autos.</a>