[Insight-developers] ImageToImage filter with 2 inputs of different types

Luis Ibanez luis.ibanez@kitware.com
Mon, 04 Nov 2002 13:09:18 -0500


Hi Josh,

This has been done in the binary filters. They allow you
to have two different image types for the input.
That totals 3 template parameters for these filters.

As Jim said, the only trick is to add a particular method
to your API in order to define how the new image is connected
to the list of inputs.  The SetNthInput() method only knows
about DataObjects so you can pretty much connect anything as
input.

You can still derive from ImageToImageFilter using only one
of the two input types as the input type for the base class.


   Luis



==========================================================

Miller, James V (Research) wrote:
> I think the itk::ShapeDetectionLevelSetFilters do this.  They have a method 
> called SetEdgeImage() that takes in the type of the second input and just calls
> ProcessObject::SetNthInput().
> 
> Jim
> 
> 
>>-----Original Message-----
>>From: Joshua Cates [mailto:cates@sci.utah.edu]
>>Sent: Monday, November 04, 2002 11:53 AM
>>To: Insight-Developers
>>Subject: [Insight-developers] ImageToImage filter with 2 inputs of
>>different types
>>
>>
>>Hi,
>>
>>I am rewriting the level set segmentation filters so that the 
>>ThresholdImage parameter is given as a second input and 
>>therefore becomes 
>>linking into the pipeline properly.
>>
>>The issue I have is that I do not want to require that both 
>>inputs to my 
>>filter be of exactly the same type.
>>
>>Has anyone constructed a similar filter? Any advice would be helpful.
>>
>>I don't believe it can be done as a subclass of itkImageToImageFilter.
>>
>>Josh.
>>
>>______________________________
>> Josh Cates			
>> School of Computer Science	
>> University of Utah
>> Email: cates@sci.utah.edu
>> Phone: (801) 587-7697
>> URL:   www.cs.utk.edu/~cates
>>
>>
>>_______________________________________________
>>Insight-developers mailing list
>>Insight-developers@public.kitware.com
>>http://public.kitware.com/mailman/listinfo/insight-developers
>>
>>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
> 
>