[Insight-users] Casting Adaptor?
Bradley Lowekamp
blowekamp at mail.nih.gov
Wed Mar 25 10:04:24 EDT 2009
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
>>
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090325/daedb334/attachment.htm>
More information about the Insight-users
mailing list