[ITK] ThresholdImageFilter on VectorImage

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Mar 6 08:41:28 EST 2015


David,

I don't think the ImageDuplicator is needed. Otherwise I have done something very similar in SimpleITK to generically get filter to run on a per-component basis. I have thought I should write a filter called ComponentByComponentImageFilter to be similar to the SliceBySliceImageFilter.

For your problem though, if you want to do something better have a look at the UnaryImageFilter[1]. This class has a Functor template parameter, which allow a custom function to be called per pixel. Here is the first example of it I see [2], and it looks perfect for your case since is already is working with variable length vectors.

Brad


[1] http://www.itk.org/Doxygen/html/classitk_1_1UnaryFunctorImageFilter.html
[2] http://www.itk.org/Doxygen/html/WikiExamples_2ImageProcessing_2UnaryFunctorImageFilter_8cxx-example.html#_a7

On Mar 6, 2015, at 8:13 AM, David Froger <david.froger.ml at mailoo.org> wrote:

> It works using a combination of:
>  - VectorIndexSelectionCastImageFilter
>  - ThresholdImageFilter
>  - ImageDuplicator
>  - ComposeImageFilter
> 
>  https://github.com/dfroger/issue/blob/66a6585/itk/main3.cxx
> 
> But not simple nor efficient.



More information about the Community mailing list