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

Gelas, Arnaud Joel Florent Arnaud_Gelas at hms.harvard.edu
Sat Dec 4 16:06:39 EST 2010


Hi David,

The problem with this filter is that the kernel image is of the same type as the input image.
I guess this filter needs an additional template argument for the kernel image (a scalar image), like this the input image could theoretically be of any type (scalar, vector, tensor) ?

Arnaud

________________________________________
From: insight-users-bounces at itk.org [insight-users-bounces at itk.org] On Behalf Of David Doria [daviddoria at gmail.com]
Sent: Saturday, December 04, 2010 3:47 PM
To: ITK
Subject: [Insight-users] ConvolutionImageFilter only works with scalar  images?

(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
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list