[Insight-users] Create my own filter

Luis Ibanez luis.ibanez at kitware.com
Sun Sep 16 10:11:41 EDT 2007


Hi Rashedk,

It is very easy to create ITK filters that take two images.

You may want to look first at the "itkBinaryFunctorImageFilter"

This is the base class of all the filters that take two images
as input and compute a pixel-wise output.

You can ignore the "Functor" aspects of it, and focus on the
SetInput1(), SetInput2() methods, the SetNumberOfRequiredInputs()
call in the constructor.

There are many other filters in ITK that take two images as input.

For example:

$ grep -l "RequiredInputs( 2 )" *.txx
itkBinaryFunctorImageFilter.txx
itkContourDirectedMeanDistanceImageFilter.txx
itkContourMeanDistanceImageFilter.txx
itkDirectedHausdorffDistanceImageFilter.txx
itkHausdorffDistanceImageFilter.txx
itkInterpolateImageFilter.txx
itkNaryFunctorImageFilter.txx
itkPolylineMask2DImageFilter.txx
itkPolylineMaskImageFilter.txx
itkSimilarityIndexImageFilter.txx
itkWarpImageFilter.txx
itkWarpVectorImageFilter.txx


Please let us know if you encounter any problems,


    Thanks


        Luis


----------------
rashedk wrote:
> Hi everyone, 
> 
> I am trying to write my own filter. The filter will take in two images (of
> the same type) as input and output a single image. All the images are of the
> same dimensions. I was looking at Chapter 13 of the ITK software guide,
> especially 13.6. I don't know how to go about extending this since I have
> two images as input. I am also not sure If it would be appropriate to derive
> from ImageToImageFilter. 
> 
> Any ideas how I should go about doing this? 
> 
> Thanks in advance, 
> Rashed karim. 
> 
> 


More information about the Insight-users mailing list