[Insight-users] Create my own filter
rashedk
rashed.vtk at googlemail.com
Mon Sep 17 19:00:49 EDT 2007
Hi Luis,
Thanks for your quick reply. I was looking at itkBinaryFunctionImageFilter
since this closely resembles what my filter is aiming to accomplish. I have
two inputs Image1 and Image2. The output of the filter is a pixel-wise
selection of the intensity from either Image1 or Image2. At a pixel (x,y,z)
if Image1(x,y,z) > 0 then output(x,y,z) = image1(x,y,z) ELSE if
Image1(x,y,z) == 0 then output(x,y,z) = Image2(x,y,z).
I am trying to modify the itkBinaryFunctionImageFilter, but dont understand
what m_Functor ( ) function in the ThreadedGenerateData( ) function does. I
can see that it implements the pixel-wise addition, but where is this
function defined?
Thanks in advance,
Rashed karim
Luis Ibanez wrote:
>
>
> 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.
>>
>>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
--
View this message in context: http://www.nabble.com/Create-my-own-filter-tf4449323.html#a12746845
Sent from the ITK - Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list