<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Hello: Lui,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I rebuild the ITK as you suggested. Now the image resulution is correct.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks a lot.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Baoyun<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Luis Ibanez &lt;luis.ibanez@kitware.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Baoyun Li &lt;baoyun_li123@yahoo.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> insight-users@itk.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, February 25, 2009 11:11:30 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: ITK FastMarching example--help!!!--the resultion of output images are changed to [1 1 1]<BR></FONT><BR><BR>Hi Baoyun,<BR><BR>Yes ITK 3.10 is the release where this bug sneaked in.&nbsp; :-(<BR><BR>You can fix it by yourself by applying the following change:<BR><BR><A href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkGradientMagnitudeRecursiveGaussianImageFilter.txx?root=Insight&amp;r1=1.20&amp;r2=1.21&amp;sortby=date" target=_blank
 rel=nofollow>http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkGradientMagnitudeRecursiveGaussianImageFilter.txx?root=Insight&amp;r1=1.20&amp;r2=1.21&amp;sortby=date</A><BR><BR><BR>Simply add:<BR><BR>&nbsp;&nbsp; cumulativeImage-&gt;CopyInformation(this-&gt;GetInput());<BR><BR>to line 216 of the file<BR><BR>&nbsp;&nbsp;&nbsp; Insight/Code/BasicFilters/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; itkGradientMagnitudeRecursiveGaussianImageFilter.txx<BR><BR>and rebuild your application.<BR><BR>--<BR><BR>The great advantage of Open Source software is indeed<BR>that you *can* help yourself and help others by fixing <BR>things on your own. &nbsp;&nbsp;&nbsp; :-)<BR><BR><BR>Please let us know if you find any problem,<BR><BR>&nbsp;&nbsp; Thanks<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<BR><BR><BR>------------------------------------------------------------------------<BR>
<DIV class=gmail_quote>On Wed, Feb 25, 2009 at 11:52 AM, Baoyun Li <SPAN dir=ltr>&lt;<A href="mailto:baoyun_li123@yahoo.com" target=_blank rel=nofollow ymailto="mailto:baoyun_li123@yahoo.com">baoyun_li123@yahoo.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>Dear Luis:</DIV>
<DIV>&nbsp;</DIV>
<DIV>The ITK version I used 3.10.0. I begin to used it at the end of 2008. Do you think that will be a problem?</DIV>
<DIV>&nbsp;</DIV>
<DIV>I will try CVS version&nbsp; or the new relase, and let you know the result.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Is it possible for myself to fix the problem? Or I have to be very familiar with ITK to solve the problem by myself. You know the later work can not be continues once this kind of thing happend.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks and my best regards</DIV>
<DIV>&nbsp;</DIV><FONT color=#888888>
<DIV>Baoyun</DIV></FONT>
<DIV><BR>
<DIV class=WgoR0d>&nbsp;</DIV></DIV>
<DIV class=WgoR0d></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV class=WgoR0d><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV class=WgoR0d><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Luis Ibanez &lt;<A href="mailto:luis.ibanez@kitware.com" target=_blank rel=nofollow ymailto="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</A>&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Baoyun Li &lt;<A href="mailto:baoyun_li123@yahoo.com" target=_blank rel=nofollow ymailto="mailto:baoyun_li123@yahoo.com">baoyun_li123@yahoo.com</A>&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> <A href="mailto:insight-users@itk.org" target=_blank rel=nofollow ymailto="mailto:insight-users@itk.org">insight-users@itk.org</A><BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, February 25, 2009 10:43:43 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: ITK FastMarching example--help!!!--the resultion of output images are changed to [1 1 1]<BR></FONT></DIV>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c><BR><BR>Hi Baoyun,<BR><BR>What version of ITK are you using ?<BR><BR>In a recent release a bug went into the RecursiveGaussianImageFilter, <BR>that resulted in the spacing information being reset to trivial values.<BR><BR>This has now been fixed in the CVS repository.<BR><BR>Could you please try a CVS checkout of ITK ?<BR><BR>FYI: We will be releasing ITK 3.12 by Monday.<BR><BR>Please let us know what you find,<BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thanks<BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<BR><BR><BR>-----------------------------------------<BR>
<DIV class=gmail_quote>On Wed, Feb 25, 2009 at 11:39 AM, Baoyun Li <SPAN dir=ltr>&lt;<A href="mailto:baoyun_li123@yahoo.com" target=_blank rel=nofollow ymailto="mailto:baoyun_li123@yahoo.com">baoyun_li123@yahoo.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0..8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><FONT face=Arial>
<DIV>Dear All:</DIV>
<DIV>&nbsp;</DIV>
<DIV>When I run ITK example for fastmarching (see the attached code below), the output image resolution are changed to [1 1 1] begining at sigmoid filter&nbsp;output&nbsp;[writer3-&gt;SetFileName("../data/FastMarchingFilterOutput3.hdr")]. But my input resolution is [0.7 0.7 2.5]. The first two output files kept the origianl resolution.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I only changed&nbsp;some arguments of &nbsp;the expmale code and the Dimension to 3.&nbsp;My command aruguments are: FastMarchingImageFilter SE1.hdr out.hdr 1000 1001.</DIV>
<DIV>&nbsp;</DIV>
<DIV>ITK&nbsp;deals images&nbsp;on Physical space, now the spacial resolution of images are changed, so I do not how I can trust the results and cannot continue some works, eg mutiple resoltion processing</DIV>
<DIV>&nbsp;</DIV>
<DIV>Can somebody help me to figure out this problem?&nbsp; Thanks a lot.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Best regards</DIV>
<DIV>&nbsp;</DIV>
<DIV>Baoyun</DIV>
<DIV><BR><BR>#if defined(_MSC_VER)<BR>#pragma warning ( disable : 4786 )<BR>#endif</DIV>
<DIV>#ifdef __BORLANDC__<BR>#define ITK_LEAN_AND_MEAN<BR>#endif</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>#include "itkCurvatureAnisotropicDiffusionImageFilter.h"</DIV>
<DIV>#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"<BR>#include "itkSigmoidImageFilter.h"</DIV>
<DIV>#include "itkImage.h"<BR>#include "itkFastMarchingImageFilter.h"</DIV>
<DIV><BR>// Software Guide : BeginCodeSnippet<BR>#include "itkBinaryThresholdImageFilter.h"</DIV>
<DIV><BR>// Software Guide : BeginCodeSnippet<BR>#include "itkImageFileReader.h"<BR>#include "itkImageFileWriter.h"</DIV>
<DIV>// <BR>#include "itkRescaleIntensityImageFilter.h"</DIV>
<DIV><BR>int main( int argc, char *argv[] )<BR>{<BR>&nbsp; if( argc &lt; 3 )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Missing Parameters " &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Usage: " &lt;&lt; argv[0];<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; " inputImage&nbsp; outputImage seedX seedY";<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; " Sigma SigmoidAlpha SigmoidBeta TimeThreshold StoppingValue" &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; return 1;<BR>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV><BR>&nbsp; </DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; typedef&nbsp;&nbsp; float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalPixelType;<BR>&nbsp; const&nbsp;&nbsp;&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp; Dimension = 3;<BR>&nbsp; typedef itk::Image&lt; InternalPixelType, Dimension &gt;&nbsp; InternalImageType;<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV>&nbsp; typedef unsigned char OutputPixelType;<BR>&nbsp; typedef itk::Image&lt; OutputPixelType, Dimension &gt; OutputImageType;<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV>&nbsp; typedef itk::BinaryThresholdImageFilter&lt; InternalImageType, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OutputImageType&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp; ThresholdingFilterType;<BR>&nbsp; ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();<BR>&nbsp; </DIV>
<DIV>&nbsp; const InternalPixelType&nbsp; timeThreshold = atof( argv[3] );<BR>&nbsp; <BR>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; thresholder-&gt;SetLowerThreshold(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.0&nbsp; );<BR>&nbsp; thresholder-&gt;SetUpperThreshold( timeThreshold&nbsp; );</DIV>
<DIV>&nbsp; thresholder-&gt;SetOutsideValue(&nbsp; 0&nbsp; );<BR>&nbsp; thresholder-&gt;SetInsideValue(&nbsp; 255 );<BR>&nbsp; <BR>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; typedef&nbsp; itk::ImageFileReader&lt; InternalImageType &gt; ReaderType;<BR>&nbsp; typedef&nbsp; itk::ImageFileWriter&lt;&nbsp; OutputImageType&nbsp; &gt; WriterType;<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp; ReaderType::Pointer reader = ReaderType::New();<BR>&nbsp; WriterType::Pointer writer = WriterType::New();</DIV>
<DIV>&nbsp; reader-&gt;SetFileName( argv[1] );<BR>&nbsp; writer-&gt;SetFileName( argv[2] );</DIV>
<DIV><BR>&nbsp; //&nbsp; The RescaleIntensityImageFilter type is declared below. This filter will<BR>&nbsp; //&nbsp; renormalize image before sending them to writers.<BR>&nbsp; //<BR>&nbsp; typedef itk::RescaleIntensityImageFilter&lt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OutputImageType &gt;&nbsp;&nbsp; CastFilterType;</DIV>
<DIV>&nbsp; typedef&nbsp;&nbsp; itk::CurvatureAnisotropicDiffusionImageFilter&lt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType &gt;&nbsp; SmoothingFilterType;<BR>&nbsp; <BR>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();<BR>&nbsp;</DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; typedef&nbsp;&nbsp; itk::GradientMagnitudeRecursiveGaussianImageFilter&lt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType &gt;&nbsp; GradientFilterType;</DIV>
<DIV>&nbsp; typedef&nbsp;&nbsp; itk::SigmoidImageFilter&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType &gt;&nbsp; SigmoidFilterType;<BR>&nbsp; <BR>&nbsp; GradientFilterType::Pointer&nbsp; gradientMagnitude = GradientFilterType::New();<BR>&nbsp; SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; sigmoid-&gt;SetOutputMinimum(&nbsp; 0.0&nbsp; );<BR>&nbsp; sigmoid-&gt;SetOutputMaximum(&nbsp; 1.0&nbsp; );<BR>&nbsp; </DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; typedef&nbsp; itk::FastMarchingImageFilter&lt; InternalImageType, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType &gt;&nbsp;&nbsp;&nbsp; FastMarchingFilterType;<BR>&nbsp; </DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; FastMarchingFilterType::Pointer&nbsp; fastMarching = FastMarchingFilterType::New();<BR>&nbsp;<BR>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; smoothing-&gt;SetInput( reader-&gt;GetOutput() );<BR>&nbsp; gradientMagnitude-&gt;SetInput( smoothing-&gt;GetOutput() );<BR>&nbsp; sigmoid-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );<BR>&nbsp; fastMarching-&gt;SetInput( sigmoid-&gt;GetOutput() );<BR>&nbsp; thresholder-&gt;SetInput( fastMarching-&gt;GetOutput() );<BR>&nbsp; writer-&gt;SetInput( thresholder-&gt;GetOutput() );<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp; </DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; smoothing-&gt;SetTimeStep( 0.05 );<BR>&nbsp; smoothing-&gt;SetNumberOfIterations(&nbsp; 10 );<BR>&nbsp; smoothing-&gt;SetConductanceParameter( 9.0 );<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp; </DIV>
<DIV>&nbsp; const double sigma = (float) 2.5;//atof( argv[5] );</DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; gradientMagnitude-&gt;SetSigma(&nbsp; sigma&nbsp; );<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; const double alpha =&nbsp; (float)-0.33;//atof( argv[6] );<BR>&nbsp; const double beta&nbsp; =&nbsp; (float) 0.5;//atof( argv[7] );</DIV>
<DIV><BR>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; sigmoid-&gt;SetAlpha( alpha );<BR>&nbsp; sigmoid-&gt;SetBeta(&nbsp; beta&nbsp; );<BR>&nbsp;<BR>&nbsp;<BR>&nbsp; typedef FastMarchingFilterType::NodeContainer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodeContainer;<BR>&nbsp; typedef FastMarchingFilterType::NodeType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodeType;<BR>&nbsp; NodeContainer::Pointer seeds = NodeContainer::New();<BR>&nbsp; //&nbsp; Software Guide : EndCodeSnippet <BR>&nbsp; </DIV>
<DIV>&nbsp; InternalImageType::IndexType&nbsp; seedPosition;<BR>&nbsp; <BR>&nbsp; seedPosition[0] = 131;//atoi( argv[3] );<BR>&nbsp; seedPosition[1] = 273;//atoi( argv[4] );<BR>&nbsp; seedPosition[2] = 36;//atoi( argv[4] );</DIV>
<DIV><BR>&nbsp; <BR>&nbsp; NodeType node;<BR>&nbsp; const double seedValue = 0.0;<BR>&nbsp; <BR>&nbsp; node.SetValue( seedValue );<BR>&nbsp; node.SetIndex( seedPosition );<BR>&nbsp;<BR>&nbsp; seeds-&gt;Initialize();<BR>&nbsp; seeds-&gt;InsertElement( 0, node );<BR>&nbsp; //&nbsp; Software Guide : EndCodeSnippet </DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; fastMarching-&gt;SetTrialPoints(&nbsp; seeds&nbsp; );<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp; //&nbsp; Here we configure all the writers required to see the intermediate<BR>&nbsp; //&nbsp; outputs of the pipeline. This is added here only for<BR>&nbsp; //&nbsp; pedagogical/debugging purposes. These intermediate output are normaly not<BR>&nbsp; //&nbsp; required. Only the output of the final thresholding filter should be<BR>&nbsp; //&nbsp; relevant.&nbsp; Observing intermediate output is helpful in the process of<BR>&nbsp; //&nbsp; fine tuning the parameters of filters in the pipeline. <BR>&nbsp; //<BR>&nbsp; CastFilterType::Pointer caster1 = CastFilterType::New();<BR>&nbsp; CastFilterType::Pointer caster2 = CastFilterType::New();<BR>&nbsp; CastFilterType::Pointer caster3 = CastFilterType::New();<BR>&nbsp; CastFilterType::Pointer caster4 = CastFilterType::New();</DIV>
<DIV>&nbsp; WriterType::Pointer writer1 = WriterType::New();<BR>&nbsp; WriterType::Pointer writer2 = WriterType::New();<BR>&nbsp; WriterType::Pointer writer3 = WriterType::New();<BR>&nbsp; WriterType::Pointer writer4 = WriterType::New();</DIV>
<DIV>&nbsp; caster1-&gt;SetInput( smoothing-&gt;GetOutput() );<BR>&nbsp; writer1-&gt;SetInput( caster1-&gt;GetOutput() );<BR>&nbsp; writer1-&gt;SetFileName("../data/FastMarchingFilterOutput1..hdr");<BR>&nbsp; caster1-&gt;SetOutputMinimum(&nbsp;&nbsp; 0 );<BR>&nbsp; caster1-&gt;SetOutputMaximum( 255 );<BR>&nbsp; writer1-&gt;Update();</DIV>
<DIV>&nbsp; caster2-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );<BR>&nbsp; writer2-&gt;SetInput( caster2-&gt;GetOutput() );<BR>&nbsp; writer2-&gt;SetFileName(".../data/FastMarchingFilterOutput2.hdr");<BR>&nbsp; caster2-&gt;SetOutputMinimum(&nbsp;&nbsp; 0 );<BR>&nbsp; caster2-&gt;SetOutputMaximum( 255 );<BR>&nbsp; writer2-&gt;Update();</DIV>
<DIV>&nbsp; caster3-&gt;SetInput( sigmoid-&gt;GetOutput() );<BR>&nbsp; writer3-&gt;SetInput( caster3-&gt;GetOutput() );<BR>&nbsp; writer3-&gt;SetFileName("../data/FastMarchingFilterOutput3.hdr");<BR>&nbsp; caster3-&gt;SetOutputMinimum(&nbsp;&nbsp; 0 );<BR>&nbsp; caster3-&gt;SetOutputMaximum( 255 );<BR>&nbsp; writer3-&gt;Update();</DIV>
<DIV>&nbsp; caster4-&gt;SetInput( fastMarching-&gt;GetOutput() );<BR>&nbsp; writer4-&gt;SetInput( caster4-&gt;GetOutput() );<BR>&nbsp; writer4-&gt;SetFileName("../data/FastMarchingFilterOutput4.hdr");<BR>&nbsp; caster4-&gt;SetOutputMinimum(&nbsp;&nbsp; 0 );<BR>&nbsp; caster4-&gt;SetOutputMaximum( 255 );</DIV>
<DIV><BR>&nbsp; //&nbsp; Software Guide : BeginLatex<BR>&nbsp;<BR>&nbsp; //<BR>&nbsp; //&nbsp; Software Guide : EndLatex </DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; fastMarching-&gt;SetOutputSize( <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;GetOutput()-&gt;GetBufferedRegion().GetSize() );<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp; <BR>&nbsp; //<BR>&nbsp; //&nbsp; Software Guide : EndLatex </DIV>
<DIV>&nbsp; const double stoppingTime = atof( argv[4] );</DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; fastMarching-&gt;SetStoppingValue(&nbsp; stoppingTime&nbsp; );<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp;</DIV>
<DIV>&nbsp; // Software Guide : BeginCodeSnippet<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; writer-&gt;Update();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; catch( itk::ExceptionObject &amp; excep )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Exception caught !" &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; excep &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; // Software Guide : EndCodeSnippet</DIV>
<DIV><BR>&nbsp; writer4-&gt;Update();</DIV>
<DIV><BR>&nbsp; // The following writer type is used to save the output of the<BR>&nbsp; // time-crossing map in a file with appropiate pixel representation. The<BR>&nbsp; // advantage of saving this image in native format is that it can be used<BR>&nbsp; // with a viewer to help determine an appropriate threshold to be used on<BR>&nbsp; // the output of the \code{fastmarching} filter.<BR>&nbsp; //<BR>&nbsp; typedef itk::ImageFileWriter&lt; InternalImageType &gt; InternalWriterType;</DIV>
<DIV>&nbsp; InternalWriterType::Pointer mapWriter = InternalWriterType::New();<BR>&nbsp; mapWriter-&gt;SetInput( fastMarching-&gt;GetOutput() );<BR>&nbsp; mapWriter-&gt;SetFileName("../data/FastMarchingFilterOutput5.hdr");<BR>&nbsp; mapWriter-&gt;Update();</DIV>
<DIV>&nbsp; InternalWriterType::Pointer speedWriter = InternalWriterType::New();<BR>&nbsp; speedWriter-&gt;SetInput( sigmoid-&gt;GetOutput() );<BR>&nbsp; speedWriter-&gt;SetFileName("../data/FastMarchingFilterOutput6.hdr");<BR>&nbsp; speedWriter-&gt;Update();</DIV>
<DIV>&nbsp; InternalWriterType::Pointer gradientWriter = InternalWriterType::New();<BR>&nbsp; gradientWriter-&gt;SetInput( gradientMagnitude-&gt;GetOutput() );<BR>&nbsp; gradientWriter-&gt;SetFileName("../data/FastMarchingFilterOutput7.hdr");<BR>&nbsp; gradientWriter-&gt;Update();</DIV>
<DIV><BR>&nbsp; return 0;<BR>}<BR></DIV></FONT>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif"></DIV></DIV></DIV><BR></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></DIV></DIV><BR></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></div><br>



      </body></html>