[Insight-users] ImageToImageFilter for the watershed transformation

Luis Ibanez luis.ibanez at kitware.com
Fri Apr 11 19:19:44 EDT 2008



Hi Edgar,


             Welcome to ITK !


Please read the ITK Software Guide:

      http://www.itk.org/ItkSoftwareGuide.pdf


in particular Section: 9.2, in pdf-page 556.


You will also find useful to look at the
Example source:


    Insight/Examples/Segmentation/
              WatershedSegmentation1.cxx


Note that the ImageToImageFilter is simply the
base class of most ITK filters, and it doesn't
perform any useful algorithm by itself.

The class that you need to use is the:

          itkWatershedImageFilter

as illustrated in the example above.


      Regards,



          Luis


----------------------
Edgar Andrasch wrote:
> Hello,
> I want to achieve the watershed transformation on my image. The problem is my ImageToImageFilter function. How can I use this the right way to use later the watershed transformation?
> 
> typedef itk::Image <pixelType, 3> ItkImageType;
> 
> typedef itk::FixedArray< float, 1 > MeasurementVectorType;
> typedef itk::Image< MeasurementVectorType, 2 > ArrayImageType;
> typedef itk::ScalarToArrayCastImageFilter< FloatImage2DType, ArrayImageType > CasterType;
> 			
> typedef itk::ImageToImageFilter< ItkImageType, ArrayImageType > FilterType1;
> FilterType1::Pointer filter1 = FilterType1::New();<-error C2440: 'initializing' : cannot convert from 'itk::Object::Pointer' to 'itk::SmartPointer<TObjectType>'
> filter1->SetInput(itkImage);
> 				
> CasterType::Pointer caster = CasterType::New();
> caster->SetInput(filter1->GetOutput());
> diffusion->SetInput(caster->GetOutput());
> 
> Thanks for all responses


More information about the Insight-users mailing list