[Insight-developers] Re: design problem with VectorImage and ImageAdaptor ?

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Mar 16 10:04:49 EST 2006


Hi,

I have added a bug report for that issue
http://www.itk.org/Bug/bug.php?op=show&bugid=2963&pos=2

Regards,

Gaetan


On Tue, 14 Mar 2006 14:49:23 +0100, Luis Ibanez <luis.ibanez at kitware.com>  
wrote:

>
> Hi Gaetan,
>
> You are right, the filter is not checking for the
> index value to be valid.
>
> That check could be done if we use this filter with
> images whose pixel type is defined at compile time.
> (e.g. Vector, RGBPixel). However, if we do it for
> pixels whose vector length is defined at run time,
> then we may face the following difficulties:
>
>
> 1) A use can invoke the SetIndex() method, before
>     connecting an input image, and at that point we
>     do not know how many components are available
>     in that image.
>
> 2) A previous filter may produce a VectorImage
>     with a different number of components.
>
>
> It seems that the only safe way to do it would be to
> overload the GenerateData() method, check there for
> the number of components, and verify that the index
> is valid. Then invoke the GenerateData() method of
> the superclass (the UnaryFunctorFilter).
>
> Could you please create a bug entry for this issue ?
>
> In that way we will make sure a fix will be committed
> soon.
>
>
>
>      Thanks
>
>
>        Luis
>
>
>
> -----------------------
> Gaetan Lehmann wrote:
>>  Hi Luis,
>>  Thanks for you answer.
>> Is there also a filter to create a VectorImage from several scalar  
>> images ?
>> Also, VectorIndexSelectionCastImageFilter seems to not check the number  
>> of  components. Is there a possibility to get invalid data, or to get  
>> a  segmentation fault with that filter ?
>>  Regards,
>>  Gaetan
>>  On Sat, 11 Mar 2006 22:10:59 +0100, Luis Ibanez  
>> <luis.ibanez at kitware.com>  wrote:
>>
>>>
>>> Hi Gaetan,
>>>
>>> The filter that you can use for extracting a scalar image
>>> from a channel of a vector image is the following:
>>>
>>>             VectorIndexSelectionCastImageFilter
>>>
>>> http://www.itk.org/Insight/Doxygen/html/classitk_1_1VectorIndexSelectionCastImageFilter.html  
>>>
>>> Regards,
>>>
>>>
>>>      Luis
>>>
>>>
>>>
>>> -----------------------
>>> Gaetan Lehmann wrote:
>>> ...
>>>
>>>>  I don't like too much adaptor, but it seem that the only class able   
>>>> to  extract a scalar image from a VectorImage for now.
>>>> I guess I have to write a filter to extract the channel I'm  
>>>> interested  in.  It would also avoid the efficiency problem your  
>>>> talking about.
>>>>
>>> ...
>>>
>>>>  Gaetan
>>>>
>>



-- 
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


More information about the Insight-developers mailing list