[Insight-developers] NumericTraits for RGBPixel

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 8 14:01:37 EDT 2010


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
>


More information about the Insight-developers mailing list