[Insight-users] data type limits

Dan Mueller dan.muel at gmail.com
Mon Nov 2 22:32:13 EST 2009


Hi Darren,

If I understand your question correctly, I believe you may be looking
for itk::NumericTraits.

You can use as follows:

#include "itkNumericTraits.h"

typedef unsigned char PixelType;

std::cout << "max=" << itk::NumericTraits<PixelType>::max() << std::endl;
std::cout << "min=" << itk::NumericTraits<PixelType>::min() << std::endl;
std::cout << "zero=" << itk::NumericTraits<PixelType>::Zero << std::endl;
std::cout << "one=" << itk::NumericTraits<PixelType>::One << std::endl;
std::cout << "one=" << itk::NumericTraits<PixelType>::IsPositive( 42 )
<< std::endl;
etc...

Hope this helps.

Cheers, Dan

2009/11/3 Darren Weber <darren.weber.lists at gmail.com>:
>
> Does ITK provide platform-independent constants for common data limits, to
> supplement or replace limits.h?
>
> TIA,
> Darren


More information about the Insight-users mailing list