[ITK] ThresholdImageFilter on VectorImage

David Froger david.froger.ml at mailoo.org
Fri Mar 6 04:22:08 EST 2015


Hello Bradley

> On Mar 1, 2015, at 11:11 AM, David Froger <david.froger.ml at mailoo.org> wrote:
> > Modifying the example:
> >    http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/NthElementImageAdaptor
I post the wrong link, the correct one was:
       http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ProcessingNthImageElement

> OK, you are using an Image of CovarientVectors not a VectorImage. There are different types and beats :) Confusing, I know.
You're right!

> My first guess here it that there is a problem with the output type of the threshold ImageFilter:
> 
> template< typename TImage >
> class ThresholdImageFilter:public InPlaceImageFilter< TImage, TImage >
> 
> What to note here it that output type is the same as the input. That is the output is also an Adaptor image.
> 
> You are not running the filter "inplace". Therefore the output is a new vector image, but there is an adaptor so only one component is being set.
> 
> What are you expecting in the output? What are you trying to do?
Thanks for the explanations.

What I'm trying to to: I have a VectorImage, and I want to replace all pixel
compoment values that are below a value TH with the value TH.

I first tried to apply ThresholdImageFilter on the VectorImage, but I seems
to accept only Image:
    https://github.com/dfroger/issue/blob/7d8ebbb/itk/main0.cxx#L86-L87

Then I tried to loop with NthElementImageAdaptor on the VectorImage and apply
ThresholdImageFilter on each VectorImage component, and then re-crete the
VectorImage using ComposeImageFilter (don't work for now):
    https://github.com/dfroger/issue/blob/master/itk/main1.cxx

Thank you,
David


More information about the Community mailing list