[Insight-users] Casting Adaptor?

Luis Ibanez luis.ibanez at kitware.com
Wed Mar 25 17:22:37 EDT 2009


Hi Brad,


You are right in that such basic adaptor should be a standard class
in the toolkit. It is ironic that we have a family of less commonly
used adaptors and we missed the most obvious one:  Casting.

It is simply a shameful omission...


    We could easily add it at this point.

    Would you mind submitting a one page
    contribution to the Insight Journal   ?


It will simply require to attach to it the code that you already
wrote for the CastImageAdaptor.


    Thanks


       Luis



-------------------------
Bradley Lowekamp wrote:
> Hello Luis,
> 
> Thank you for pointing me towards that example. I forgot that when I 
> need this adaptation I usually code up my own adaptor; it just seemed 
> like it should be in ITK. If this is "typical use" then why is a 
> templated CastPixellAccessor such as the following not part of ITK?
> 
> template <class TInternalType, class TExternalType > class ITK_EXPORT 
> CastPixelAccessor 
> {
> 
>   static inline void Set(InternalType & output, const ExternalType & input) 
>   {output = static_cast<InternalType>( input );}
> 
>   static inline ExternalType Get( const InternalType & input ) 
>   {return static_cast<ExternalType>( input ); }
> };  
> 
> Brad
> 
> 
> On Mar 24, 2009, at 2:17 PM, Luis Ibanez wrote:
> 
>>
>> Hi Brad,
>>
>>
>> The Casting adaptor is the typical use case example
>> for the ImageAdaptors.
>>
>> You may want to look at the Example
>>
>>   Insight/Examples/DataRepresentation/Image/ImageAdaptor1.cxx
>>
>> You will find it described in the ITK Software Guide.
>>
>>
>>   Luis
>>
>>
>> --------------------------
>> Bradley Lowekamp wrote:
>>
>>> Hello,
>>
>>>
>>> I am looking for something like itkCastImageAdaptor. I see
>>
>>> itkCastImageFilter, but I don't want an extra copy of all my pixels if I
>>
>>> don't need it. The definition of a CastPixelAccessor seem like it would
>>
>>> be straight forward enough. Perhaps I am missing some complication that
>>
>>> this class would  cause?
>>
>>>
>>> Did I miss an obvious adaptor class?
>>
>>>
>>> Thanks,
>>
>>> Brad
>>
>>>
>>>
>>> ========================================================
>>
>>>
>>> Bradley Lowekamp  
>>
>>>
>>> Lockheed Martin Contractor for
>>
>>>
>>> Office of High Performance Computing and Communications
>>
>>>
>>> National Library of Medicine
>>
>>>
>>> blowekamp at mail.nih.gov <mailto:blowekamp at mail.nih.gov>
>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>
>>>
>>> _____________________________________
>>
>>> Powered by www.kitware.com <http://www.kitware.com>
>>
>>>
>>> Visit other Kitware open-source projects at
>>
>>> http://www.kitware.com/opensource/opensource.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
> 
> 
> ========================================================
> 
> Bradley Lowekamp  
> 
> Lockheed Martin Contractor for
> 
> Office of High Performance Computing and Communications
> 
> National Library of Medicine 
> 
> blowekamp at mail.nih.gov <mailto:blowekamp at mail.nih.gov>
> 
> 
> 


More information about the Insight-users mailing list