[Insight-users] ConvolutionImageFilter only works with scalar images?

David Doria daviddoria at gmail.com
Sat Dec 4 15:47:17 EST 2010


(It looked like my message bounced, sorry if this is a duplicate...)

I am trying to do a convolution with RGB images:

typedef itk::Image<itk::CovariantVector<unsigned char, 3>, 2> ColorImageType;

However, I am getting a compiler error that the ConvolutionImageFilter
can't convert my itk::CovariantVector<unsigned char, 3> to a double
(of course not).

It is due to lines like this in the filter:

sum += static_cast< double >( It.Get() ); // trying to cast a
itk::CovariantVector<unsigned char, 3> as a double

Isn't convolution with an image with pixels of N components a pretty
standard operation? The filter would just separate the image and the
kernel into their separate components and perform the convolution on
each component separately. (Is there a filter to do this separation of
channels?)

Has anyone done this type of convolution and have a method to share?

David


More information about the Insight-users mailing list