DiscreteGaussianImageFilter with RGBPixel

Is it possible to natively get an image with RGBPixel<> as the internal type filtered with this filter?
Looks like there are some issues with ITK 5.2.0, as the intermediate type messes up the setup and stops with:

/opt/homebrew/include/ITK-5.2/itkNeighborhoodInnerProduct.hxx:48:85: Invalid operands to binary expression (‘OutputPixelValueType’ (aka ‘double’) and ‘InputPixelRealType’ (aka ‘RGBPixel’))

(not sure how I ended up with doubles when I started with RGBPixel!)

It looks like DiscreteGaussianImageFilter assumes scalar pixel type. You might need to do it one component at a time, using for example VectorImageToImageAdaptor and ComposeImageFilter.

1 Like

Indeed, it’s what I will be doing, but it looks like a waste of resources to copy the data instead of just smoothing everything in place :frowning:

If you feel like it, you could upgrade DiscreteGaussianImageFilter with support for multi-component pixel types!

Yes, I could, I’m still struggling to fight against the smart pointers though, so one step after the other :smiley: