<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I'm sending again my&nbsp;questions as nobody have answered me. <BR><BR>--- En date de&nbsp;: <B>Ven 22.8.08, sara meghellati <I>&lt;sara_meghellati@yahoo.fr&gt;</I></B> a écrit&nbsp;:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: sara meghellati &lt;sara_meghellati@yahoo.fr&gt;<BR>Objet: [Insight-users] Please help:problem with wathershed segmentation applied to 3D grayscale Image<BR>À: "insight itk" &lt;insight-users@itk.org&gt;<BR>Date: Vendredi 22 Août 2008, 13h48<BR><BR>
<DIV id=yiv1889277351>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top><PRE><SPAN>Dear itk experts,</SPAN></PRE><PRE><SPAN>I’m segmenting a volume (3D grayscale image) using watershed method inspired from the WatershedSegmentation1 </SPAN></PRE><PRE><SPAN>(2D </SPAN><SPAN>RGB</SPAN><SPAN> image as input)example provided within itk.</SPAN></PRE><PRE><SPAN>My code is well working for 2D grayscale images but when I change </SPAN></PRE><PRE><SPAN>the dimension to 3, the code
 still running as it get stuck in a </SPAN></PRE><PRE><SPAN>loop!! I wait for more than 18min but no results!! Is it normal </SPAN></PRE><PRE><SPAN>that this kind of segmentation takes age to give the result in 3d </SPAN></PRE><PRE><SPAN>image or there is some thing wrong with my code? Please could you help me on that? Also, how can I follow the progress of the code?</SPAN></PRE><PRE><SPAN>I pass my code bellow. In this example I used the 3D data provided</SPAN></PRE><PRE><SPAN>in</SPAN><SPAN style="COLOR: #a31515"> <A href="http://public.kitware.com/pub/itk/Data/LiverTumor/" target=_blank rel=nofollow><FONT color=#800080>http://public.kitware.com/pub/itk/Data/LiverTumor/</FONT></A>.</SPAN></PRE><PRE><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier
 New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">&lt;iostream&gt;</SPAN></SPAN></PRE>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkImage.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkGradientAnisotropicDiffusionImageFilter.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkGradientMagnitudeImageFilter.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkWatershedImageFilter.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkImageFileReader.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkImageFileWriter.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkVectorCastImageFilter.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkUnaryFunctorImageFilter.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkScalarToRGBPixelFunctor.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkVTKImageExport.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"itkVTKImageImport.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkImageData.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkImageImport.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkImageExport.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkImageActor.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkRenderer.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkRenderWindow.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkRenderWindowInteractor.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkInteractorStyleTrackballCamera.h"</SPAN> </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">#include</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: #a31515">"vtkImageShiftScale.h"</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">// This function will connect the given itk::VTKImageExport filter to the given vtkImageImport filter.</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">template</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> &lt;<SPAN style="COLOR: blue">typename</SPAN> ITK_Exporter, <SPAN style="COLOR: blue">typename</SPAN> VTK_Importer&gt;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">void</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer)</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetUpdateInformationCallback(exporter-&gt;GetUpdateInformationCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetPipelineModifiedCallback(exporter-&gt;GetPipelineModifiedCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetWholeExtentCallback(exporter-&gt;GetWholeExtentCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetSpacingCallback(exporter-&gt;GetSpacingCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetOriginCallback(exporter-&gt;GetOriginCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetScalarTypeCallback(exporter-&gt;GetScalarTypeCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetNumberOfComponentsCallback(exporter-&gt;GetNumberOfComponentsCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetPropagateUpdateExtentCallback(exporter-&gt;GetPropagateUpdateExtentCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetUpdateDataCallback(exporter-&gt;GetUpdateDataCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetDataExtentCallback(exporter-&gt;GetDataExtentCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetBufferPointerCallback(exporter-&gt;GetBufferPointerCallback());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN>importer-&gt;SetCallbackUserData(exporter-&gt;GetCallbackUserData());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">int</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> main( )</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<SPAN>&nbsp; </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image&lt;<SPAN style="COLOR: blue">float</SPAN>, 3&gt;<SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ImageType; <SPAN style="COLOR: green"></SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image&lt;<SPAN style="COLOR: blue">unsigned</SPAN> <SPAN style="COLOR: blue">long</SPAN>, 3&gt;<SPAN>&nbsp;&nbsp; </SPAN>LabeledImageType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image&lt;<SPAN style="COLOR: blue">float</SPAN>, 3&gt;<SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ScalarImageType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// for visualization purposes</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::RGBPixel&lt;<SPAN style="COLOR: blue">unsigned</SPAN> <SPAN style="COLOR: blue">char</SPAN>&gt;<SPAN>&nbsp;&nbsp; </SPAN>RGBPixelType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image&lt;RGBPixelType, 3&gt;<SPAN>&nbsp;&nbsp;&nbsp; </SPAN>RGBImageType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::ImageFileReader&lt;ImageType&gt; FileReaderType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::GradientAnisotropicDiffusionImageFilter&lt;ImageType,<SPAN>&nbsp;&nbsp; </SPAN>ImageType&gt;<SPAN>&nbsp; </SPAN>DiffusionFilterType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::GradientMagnitudeImageFilter&lt;ImageType,ImageType&gt;<SPAN>&nbsp;&nbsp;&nbsp; </SPAN>GradientMagnitudeFilterType; </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::WatershedImageFilter&lt;ScalarImageType&gt; WatershedFilterType; <SPAN style="COLOR: green"></SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::ImageFileWriter&lt;RGBImageType&gt; FileWriterType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>FileReaderType::Pointer reader = FileReaderType::New</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>reader-&gt;SetFileName( <SPAN style="COLOR: #a31515">"c:/images/3DImages/Patient01.mhd"</SPAN><SPAN>&nbsp; </SPAN>);</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">//reader-&gt;SetFileName("c:/Images/BrainProtonDensitySlice.png");</SPAN></SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DiffusionFilterType::Pointer diffusion = DiffusionFilterType::New();</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetNumberOfIterations( atoi(<SPAN style="COLOR: #a31515">"10"</SPAN>) );</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetConductanceParameter( atof(<SPAN style="COLOR: #a31515">"2.0"</SPAN>) );</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetTimeStep(0.0625);</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>GradientMagnitudeFilterType::Pointer gradient = GradientMagnitudeFilterType::New();</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>WatershedFilterType::Pointer watershed = WatershedFilterType::New();</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>watershed-&gt;SetLevel( atof(<SPAN style="COLOR: #a31515">"0.15"</SPAN>) );<SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>watershed-&gt;SetThreshold( atof(<SPAN style="COLOR: #a31515">"0.001"</SPAN>) );<SPAN>&nbsp; </SPAN><SPAN style="COLOR: green"></SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Functor::ScalarToRGBPixelFunctor&lt;<SPAN style="COLOR: blue">unsigned</SPAN> <SPAN style="COLOR: blue">long</SPAN>&gt;<SPAN>&nbsp;&nbsp;&nbsp; </SPAN>ColorMapFunctorType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::UnaryFunctorImageFilter&lt;LabeledImageType,<SPAN>&nbsp;&nbsp;&nbsp; </SPAN>RGBImageType, ColorMapFunctorType&gt; ColorMapFilterType;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>FileWriterType::Pointer writer = FileWriterType::New();</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;SetFileName(<SPAN style="COLOR: #a31515">"c:/Images/WatershedSegImg.mhd"</SPAN>);</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetInput(reader-&gt;GetOutput());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>gradient-&gt;SetInput(diffusion-&gt;GetOutput());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>watershed-&gt;SetInput(gradient-&gt;GetOutput());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>colormapper-&gt;SetInput(watershed-&gt;GetOutput());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;SetInput(colormapper-&gt;GetOutput());</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;Update();</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">try</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;Update();<SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;</SPAN><SPAN>&nbsp;&nbsp; </SPAN>}</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (itk::ExceptionObject &amp;e)</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>std::cerr &lt;&lt; e &lt;&lt; std::endl;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN>&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> 0;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN> 
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</SPAN><PRE><SPAN></SPAN></PRE><PRE><SPAN>Thanks</SPAN></PRE><PRE>Sara <SPAN></SPAN></PRE></TD></TR></TBODY></TABLE><BR>
<HR SIZE=1>
Envoyé avec <A href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52423/*http://fr.docs.yahoo.com/mail/overview/index.html" target=_blank rel=nofollow>Yahoo! Mail</A>.<BR>Une boite mail plus intelligente. </DIV><PRE>_______________________________________________
Insight-users mailing list
Insight-users@itk.org
http://www.itk.org/mailman/listinfo/insight-users
</PRE></BLOCKQUOTE></td></tr></table><br>


      <hr size="1"> 
Envoyé avec <a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52423/*http://fr.docs.yahoo.com/mail/overview/index.html">Yahoo! Mail</a>.<br>Une boite mail plus intelligente. </a>