7 #include "fwDicomTools/Image.hpp" 15 unsigned short samplesPerPixel,
16 unsigned short bitsAllocated,
17 unsigned short bitsStored,
18 unsigned short highBit,
19 unsigned short pixelRepresentation,
21 double rescaleIntercept) :
22 m_samplesPerPixel(samplesPerPixel),
23 m_bitsAllocated(bitsAllocated),
24 m_bitsStored(bitsStored),
26 m_pixelRepresentation(pixelRepresentation),
27 m_rescaleSlope(rescaleSlope),
28 m_rescaleIntercept(rescaleIntercept)
47 result = ::fwTools::Type::s_INT8;
54 result = ::fwTools::Type::s_DOUBLE;
61 SLM_ASSERT(
"Min must be lower than max.", min <= max );
62 SLM_ASSERT(
"Min and max values must be of type int64_t.", min == (int64_t)min && max == (int64_t)max );
67 if( max <= std::numeric_limits<uint8_t>::max() )
69 result = ::fwTools::Type::s_UINT8;
71 else if( max <= std::numeric_limits<uint16_t>::max() )
73 result = ::fwTools::Type::s_UINT16;
75 else if( max <= std::numeric_limits<uint32_t>::max() )
77 result = ::fwTools::Type::s_UINT32;
81 SLM_ASSERT(
"Unable to determine the pixel format.", 0 );
88 if( max <= std::numeric_limits<int8_t>::max() && min >= std::numeric_limits<int8_t>::min() )
90 result = ::fwTools::Type::s_INT8;
92 else if( max <= std::numeric_limits<int16_t>::max() && min >= std::numeric_limits<int16_t>::min() )
94 result = ::fwTools::Type::s_INT16;
96 else if( max <= std::numeric_limits<int32_t>::max() && min >= std::numeric_limits<int32_t>::min() )
98 result = ::fwTools::Type::s_INT32;
102 SLM_ASSERT(
"Unable to determine the pixel format.", 0 );
129 SLM_ASSERT(
"Unable to determine minimum value of pixel", 0);
149 SLM_ASSERT(
"Unable to determine maximum value of pixel", 0);
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
This file defines SpyLog macros. These macros are used to log messages to a file or to the console du...