+ // Read data Note : .tst images are *always* created
+ // on little endian processor !
+ fp->read((char *)Data,GetDataSize());
+
+ // Track BigEndian troubles
+ std::cout << " ScalarSize : " << GetScalarSize()
+ << " IsCurrentProcessorBigEndian:"
+ << GDCM_NAME_SPACE::Util::IsCurrentProcessorBigEndian()
+ << std::endl;
+
+ //if (GetScalarSize() == 1 || GetSwapCode() == 1234)
+ if (GetScalarSize() == 1 || !GDCM_NAME_SPACE::Util::IsCurrentProcessorBigEndian() )
+ {
+ return true;
+ }
+ // We *know* the .tst files are written in 'Little Endian' format.
+ // We *know* DataSize may be 1 or 2 !
+ uint16_t g;
+
+ std::cout << " Let's swap Pixels" <<std::endl;
+
+ for (unsigned int i=0; i<GetDataSize()/2; i++)
+ {
+ g = ((uint16_t *)Data)[i];
+ g = ( g << 8 | g >> 8 );
+ ((uint16_t *)Data)[i] = g;
+ }