<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Dear Luis, </SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I would like&nbsp;to thank you and all the other itk members who have replied me regarding my question.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have gave a try with your code. my CPU is Intel core 2, 2.41 Ghz and 2 Gb of Ram. it takes nearly 34 minutes.&nbsp;So I have tried my code, its working and it takes&nbsp;also nearly 34 minutes. </SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I used 0.001 for threshold and 0.1 for the level parameter.</SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sara</SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Best regards </SPAN></DIV>
<DIV><BR><BR>--- En date de&nbsp;: <B>Ven 22.8.08, Luis Ibanez <I>&lt;luis.ibanez@kitware.com&gt;</I></B> a écrit&nbsp;:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: Luis Ibanez &lt;luis.ibanez@kitware.com&gt;<BR>Objet: Re: [Insight-users] nobody could answer me ? Fw : Please help:problem with wathershed segmentation applied to 3D grayscale Image<BR>À: sara_meghellati@yahoo.fr<BR>Cc: "insight itk" &lt;insight-users@itk.org&gt;<BR>Date: Vendredi 22 Août 2008, 18h59<BR><BR>
<DIV id=yiv1072800816>
<DIV dir=ltr><BR>Hi Sara,<BR><BR>Thanks for your detailed question regarding Watersheds.<BR><BR><BR>Please take a look at the attached code.<BR><BR>It process the image "Patient01" from <BR><BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <SPAN style="COLOR: rgb(163,21,21)"><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><BR>&nbsp;<BR>in a time of<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 minutes 38 seconds.<BR><BR>This was profiled in an QuadCore Intel Xeon 2.66 Ghz. (with 16Gb RAM).<BR>(although the process uses only one of the cores)<BR><BR>Note that the process peaks 1Gb of memory allocation when it is running.<BR><BR>Depending on the configuration of your system, it may be that the program<BR>started swapping memory at some point.<BR><BR>Please give a try at the attached code and let us know what
 you find.<BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; Regards,<BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<BR><BR><BR>-----------------------------------------------------------------------------------------------------------------------------------<BR>
<DIV class=gmail_quote>On Fri, Aug 22, 2008 at 11:19 AM, sara meghellati <SPAN dir=ltr>&lt;<A href="mailto:sara_meghellati@yahoo.fr" target=_blank rel=nofollow>sara_meghellati@yahoo.fr</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">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD style="FONT-FAMILY: inherit; font-size-adjust: inherit; font-stretch: inherit" vAlign=top>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;<A href="mailto:sara_meghellati@yahoo.fr" target=_blank rel=nofollow>sara_meghellati@yahoo.fr</A>&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;<A href="mailto:sara_meghellati@yahoo.fr" target=_blank rel=nofollow>sara_meghellati@yahoo.fr</A>&gt;<BR>Objet: [Insight-users] Please help:problem with wathershed segmentation applied to 3D grayscale Image<BR>À: "insight itk" &lt;<A href="mailto:insight-users@itk.org" target=_blank rel=nofollow>insight-users@itk.org</A>&gt;<BR>Date: Vendredi 22 Août 2008, 13h48<BR><BR>
<DIV>
<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: rgb(163,21,21)"> <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">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">&lt;iostream&gt;</SPAN></SPAN></PRE>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkImage.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkGradientAnisotropicDiffusionImageFilter.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkGradientMagnitudeImageFilter.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkWatershedImageFilter.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkImageFileReader.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkImageFileWriter.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkVectorCastImageFilter.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkUnaryFunctorImageFilter.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkScalarToRGBPixelFunctor.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: rgb(163,21,21)">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkVTKImageExport.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"itkVTKImageImport.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: rgb(163,21,21)">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkImageData.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkImageImport.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkImageExport.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkImageActor.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkRenderer.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkRenderWindow.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkRenderWindowInteractor.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkInteractorStyleTrackballCamera.h"</SPAN> </SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">#include</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: rgb(163,21,21)">"vtkImageShiftScale.h"</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: rgb(163,21,21)">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green">// This function will connect the given itk::VTKImageExport filter to the given vtkImageImport filter.</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">template</SPAN><SPAN style="FONT-SIZE: 10pt"> &lt;<SPAN style="COLOR: blue">typename</SPAN> ITK_Exporter, <SPAN style="COLOR: blue">typename</SPAN> VTK_Importer&gt;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">void</SPAN><SPAN style="FONT-SIZE: 10pt"> ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer)</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">{</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetUpdateInformationCallback(exporter-&gt;GetUpdateInformationCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetPipelineModifiedCallback(exporter-&gt;GetPipelineModifiedCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetWholeExtentCallback(exporter-&gt;GetWholeExtentCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetSpacingCallback(exporter-&gt;GetSpacingCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetOriginCallback(exporter-&gt;GetOriginCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetScalarTypeCallback(exporter-&gt;GetScalarTypeCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetNumberOfComponentsCallback(exporter-&gt;GetNumberOfComponentsCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetPropagateUpdateExtentCallback(exporter-&gt;GetPropagateUpdateExtentCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetUpdateDataCallback(exporter-&gt;GetUpdateDataCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetDataExtentCallback(exporter-&gt;GetDataExtentCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetBufferPointerCallback(exporter-&gt;GetBufferPointerCallback());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN>importer-&gt;SetCallbackUserData(exporter-&gt;GetCallbackUserData());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">}</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">int</SPAN><SPAN style="FONT-SIZE: 10pt"> main( )</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">{<SPAN>&nbsp; </SPAN></SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// for visualization purposes</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::ImageFileReader&lt;ImageType&gt; FileReaderType;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::ImageFileWriter&lt;RGBImageType&gt; FileWriterType;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>FileReaderType::Pointer reader = FileReaderType::New</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>reader-&gt;SetFileName( <SPAN style="COLOR: rgb(163,21,21)">"c:/images/3DImages/Patient01.mhd"</SPAN><SPAN>&nbsp; </SPAN>);</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">//reader-&gt;SetFileName("c:/Images/BrainProtonDensitySlice.png");</SPAN></SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DiffusionFilterType::Pointer diffusion = DiffusionFilterType::New();</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetNumberOfIterations( atoi(<SPAN style="COLOR: rgb(163,21,21)">"10"</SPAN>) );</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetConductanceParameter( atof(<SPAN style="COLOR: rgb(163,21,21)">"2.0"</SPAN>) );</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetTimeStep(0.0625);</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>GradientMagnitudeFilterType::Pointer gradient = GradientMagnitudeFilterType::New();</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>WatershedFilterType::Pointer watershed = WatershedFilterType::New();</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>watershed-&gt;SetLevel( atof(<SPAN style="COLOR: rgb(163,21,21)">"0.15"</SPAN>) );<SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>watershed-&gt;SetThreshold( atof(<SPAN style="COLOR: rgb(163,21,21)">"0.001"</SPAN>) );<SPAN>&nbsp; </SPAN><SPAN style="COLOR: green"></SPAN></SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>FileWriterType::Pointer writer = FileWriterType::New();</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;SetFileName(<SPAN style="COLOR: rgb(163,21,21)">"c:/Images/WatershedSegImg.mhd"</SPAN>);</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>diffusion-&gt;SetInput(reader-&gt;GetOutput());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>gradient-&gt;SetInput(diffusion-&gt;GetOutput());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>watershed-&gt;SetInput(gradient-&gt;GetOutput());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>colormapper-&gt;SetInput(watershed-&gt;GetOutput());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;SetInput(colormapper-&gt;GetOutput());</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>writer-&gt;Update();</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">try</SPAN><SPAN style="FONT-SIZE: 10pt"> </SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><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></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;</SPAN><SPAN>&nbsp;&nbsp; </SPAN>}</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (itk::ExceptionObject &amp;e)</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>std::cerr &lt;&lt; e &lt;&lt; std::endl;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN></SPAN></DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt"><SPAN>&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> 0;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">&nbsp;</SPAN> </DIV>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt">}</SPAN></DIV><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
<A href="mailto:Insight-users@itk.org" target=_blank rel=nofollow>Insight-users@itk.org</A>
<A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank rel=nofollow>http://www.itk.org/mailman/listinfo/insight-users</A>
</PRE></BLOCKQUOTE></TD></TR></TBODY></TABLE>
<DIV class=WgoR0d><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><BR>_______________________________________________<BR>Insight-users mailing list<BR><A href="mailto:Insight-users@itk.org" target=_blank rel=nofollow>Insight-users@itk.org</A><BR><A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank rel=nofollow>http://www.itk.org/mailman/listinfo/insight-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></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>