[Insight-users] Filtering all channels of a VectorImage

Julien Michel julien.michel at cnes.fr
Thu Apr 28 03:11:24 EDT 2011


Dear David,

I am the author of these filters and I am glad that they suit you needs. 
I just would like to point out some performances issues that you may run 
into.

Internally, the filter converts the VectorImage to a list of Images, 
applies the filter on each image sequentially, and then collect back the 
Images into VectorImages. So if you process a 3 three channels image, 
you end up walking the image three times (+ 2 times for splitting 
unsplitting). If the cost per pixel of the filter is high (like for 
instance resampling with very complex Transform), this is highly 
inefficient. I am not sure that the splitting and unsplitting filters 
are multi-threaded either.

I remember when we first introduced these filters in OTB everybody 
started using them any time. But for some tasks like resampling the real 
breakthrough here was to try to make interpolators work with VectorImage ...

Regards,

Julien


Le 27/04/2011 20:52, David Doria a écrit :
> 2011/4/27 Gaëtan Lehmann<gaetan.lehmann at jouy.inra.fr>:
>> Le 27 avr. 11 à 20:20, David Doria a écrit :
>>
>>> On Wed, Apr 27, 2011 at 3:27 AM, Julien Malik<julien.malik at c-s.fr>  wrote:
>>>> Hello,
>>>>
>>>> We have such a filter in OTB.
>>>> You might want to check :
>>>>
>>>> http://hg.orfeo-toolbox.org/OTB/file/94265b241df9/Code/BasicFilters/otbPerBandVectorImageFilter.h
>>>>
>>>> http://hg.orfeo-toolbox.org/OTB/file/94265b241df9/Code/BasicFilters/otbPerBandVectorImageFilter.txx
>>>>
>>>> Julien
>>> I took the liberty of pulling everything necessary out of OTB so you
>>> guys can easily look at the implementation:
>>> http://review.source.kitware.com/#change,1521
>>>
>>> I don't know about the inside, but the interface is FANTASTIC!
>>>
>>> typedef itk::MeanImageFilter<ImageType, ImageType>  MeanFilterType;
>>> typedef itk::ChannelByChannelVectorImageFilter<VectorImageType,
>>> VectorImageType, MeanFilterType>
>>> ChannelByChannelVectorImageFilterType;
>>
>> David,
>>
>> There may be licenses issues, as this code was first develop with a cecill
>> (GPL like) licence.
>>
>> Gaëtan
>>
>>
>> --
>> Gaëtan Lehmann
>> Biologie du Développement et de la Reproduction
>> INRA de Jouy-en-Josas (France)
>> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
>> http://voxel.jouy.inra.fr  http://www.itk.org
>> http://www.mandriva.org  http://www.bepo.fr
>>
>>
> OK. I wasn't proposing pushing this as is, simply letting people try
> it out without having to download/build/learn OTB.
>
> 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
>


-- 
Julien MICHEL
CNES - DCT/SI/AP - BPI 1219
18, avenue Edouard Belin
31401 Toulouse Cedex 09 - France
Tel: +33 561 282 894 - Fax: +33 561 283 109



More information about the Insight-users mailing list