<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I'm sending again my questions as nobody have answered me. <BR><BR>--- En date de : <B>Ven 22.8.08, sara meghellati <I><sara_meghellati@yahoo.fr></I></B> a écrit :<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: sara meghellati <sara_meghellati@yahoo.fr><BR>Objet: [Insight-users] Please help:problem with wathershed segmentation applied to 3D grayscale Image<BR>À: "insight itk" <insight-users@itk.org><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"><iostream></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'"> </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'"> </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'"> </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'"> <<SPAN style="COLOR: blue">typename</SPAN> ITK_Exporter, <SPAN style="COLOR: blue">typename</SPAN> VTK_Importer></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> </SPAN>importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetSpacingCallback(exporter->GetSpacingCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetOriginCallback(exporter->GetOriginCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetDataExtentCallback(exporter->GetDataExtentCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>importer->SetCallbackUserData(exporter->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'"> </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> </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image<<SPAN style="COLOR: blue">float</SPAN>, 3><SPAN> </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> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image<<SPAN style="COLOR: blue">unsigned</SPAN> <SPAN style="COLOR: blue">long</SPAN>, 3><SPAN> </SPAN>LabeledImageType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image<<SPAN style="COLOR: blue">float</SPAN>, 3><SPAN> </SPAN>ScalarImageType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </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> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::RGBPixel<<SPAN style="COLOR: blue">unsigned</SPAN> <SPAN style="COLOR: blue">char</SPAN>><SPAN> </SPAN>RGBPixelType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Image<RGBPixelType, 3><SPAN> </SPAN>RGBImageType;</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> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::ImageFileReader<ImageType> FileReaderType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::GradientAnisotropicDiffusionImageFilter<ImageType,<SPAN> </SPAN>ImageType><SPAN> </SPAN>DiffusionFilterType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::GradientMagnitudeImageFilter<ImageType,ImageType><SPAN> </SPAN>GradientMagnitudeFilterType; </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::WatershedImageFilter<ScalarImageType> 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> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::ImageFileWriter<RGBImageType> FileWriterType;</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> </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> </SPAN>reader->SetFileName( <SPAN style="COLOR: #a31515">"c:/images/3DImages/Patient01.mhd"</SPAN><SPAN> </SPAN>);</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: green">//reader->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'"> </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </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> </SPAN>diffusion->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> </SPAN>diffusion->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> </SPAN>diffusion->SetTimeStep(0.0625);</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"> </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </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> </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </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> </SPAN>watershed->SetLevel( atof(<SPAN style="COLOR: #a31515">"0.15"</SPAN>) );<SPAN> </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>watershed->SetThreshold( atof(<SPAN style="COLOR: #a31515">"0.001"</SPAN>) );<SPAN> </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> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::Functor::ScalarToRGBPixelFunctor<<SPAN style="COLOR: blue">unsigned</SPAN> <SPAN style="COLOR: blue">long</SPAN>><SPAN> </SPAN>ColorMapFunctorType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">typedef</SPAN> itk::UnaryFunctorImageFilter<LabeledImageType,<SPAN> </SPAN>RGBImageType, ColorMapFunctorType> ColorMapFilterType;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();</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> </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> </SPAN>writer->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'"> </SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>diffusion->SetInput(reader->GetOutput());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>gradient->SetInput(diffusion->GetOutput());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>watershed->SetInput(gradient->GetOutput());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>colormapper->SetInput(watershed->GetOutput());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>writer->SetInput(colormapper->GetOutput());</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>writer->Update();</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; 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> </SPAN>{</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>writer->Update();<SPAN> </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN> </SPAN>}</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN><SPAN style="COLOR: blue">catch</SPAN> (itk::ExceptionObject &e)</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>{</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>std::cerr << e << std::endl;</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN>}</SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </SPAN></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN> </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'"> </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>