[Insight-developers] NumericTraits for RGBPixel
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu Apr 8 14:33:09 EDT 2010
Hello,
I quickly looked at the file. I would agree with this change. Also don't for get about RGBA!
Also I noticed there was no:
itkNumericTraitsRGBPixelMacro( signed char );
I believe the type "char" may be signed or unsigned. So this should be explicitly defined for this type as to ensure its availability. I wish I could remember what system/compiler was like this though. Scratch that actually. Looking at some other NumericTraits files the template parameter type are not consistently defined either.
Brad
On Apr 8, 2010, at 2:01 PM, Luis Ibanez wrote:
> Hi Emmanuel,
>
> Thanks for pointing this out.
>
> I share your view, it will make sense to define the traits
> of the composite class based on the traits of its elements.
>
> Could you please give it a shot at running an Experimental
> build with this change ?
>
> and if it comes out green,
> I will vote for committing the change.
>
>
> Thanks
>
> Luis
>
>
>
> ----------------------------------------------------------------------
> On Thu, Apr 8, 2010 at 10:57 AM, Emmanuel Christophe
> <emmanuel.christophe at gmail.com> wrote:
>> Hi,
>>
>> Is there any reason (backward compatibility?) why the PrintType trait
>> for RGBPixel is defined as:
>>
>> typedef Self PrintType;
>>
>> instead of:
>>
>> typedef RGBPixel<ElementPrintType> PrintType;
>>
>> ???
>>
>> I would expect the PrintType to be consistent with the trait of the
>> element type. With the current definition:
>> std::cout << static_cast<typename itk::NumericTraits<PixelType>::PrintType>(v);
>> works fine with a PixelType defined as char (the char is converted to
>> int before printing), but it doesn't work for a PixelType defined as
>> RGBPixel<char> (it outputs characters like ÿ ÿ ÿ).
>>
>> This is the same for the NumericTraits of the RGBAPixel.
>>
>> Emmanuel
>> _______________________________________________
>> 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://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-developers
>>
> _______________________________________________
> 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://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-developers
========================================================
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/mailman/private/insight-developers/attachments/20100408/d8c5e52b/attachment.htm>
More information about the Insight-developers
mailing list