- int nb, nbu, highBit, sign;
-
- // we save the initial values of the following
- // in order to be able to restore the header in a disk-consistent state
- // (if user asks twice to get the pixels from disk)
-
- if ( PixelRead == -1 ) // File was never "read" before
- {
- InitialSpp = Header->GetEntryByNumber(0x0028,0x0002);
- InitialPhotInt = Header->GetEntryByNumber(0x0028,0x0004);
- InitialPlanConfig = Header->GetEntryByNumber(0x0028,0x0006);
- InitialBitsAllocated = Header->GetEntryByNumber(0x0028,0x0100);
- }
- else // File was already "read", the following *may* have been modified
- // we restore them to be in a disk-consistent state
- {
- // FIXME : What happened with the LUTs ?
- Header->SetEntryByNumber(InitialSpp,0x0028,0x0002);
- Header->SetEntryByNumber(InitialPhotInt,0x0028,0x0004);
- Header->SetEntryByNumber(InitialPlanConfig,0x0028,0x0006);
- Header->SetEntryByNumber(InitialBitsAllocated,0x0028,0x0100);
- }
-
- PixelRead = 1 ; // PixelRaw
-
- if ( ImageDataSize > maxSize )
- {
- dbg.Verbose(0, "gdcmFile::GetImageDataIntoVector: pixel data bigger"
- "than caller's expected MaxSize");
- return (size_t)0;
- }
-
- ReadPixelData( destination );
-
- // Number of Bits Allocated for storing a Pixel
- std::string str_nb = Header->GetEntryByNumber(0x0028,0x0100);
- if ( str_nb == GDCM_UNFOUND )
- {
- nb = 16;
- }
- else
- {
- nb = atoi( str_nb.c_str() );
- // FIXME
- // From reading SetPixelDataSizeFromHeader, it seems 12 should be treated
- // separately, correct ?
- }
-
- // Number of Bits actually used
- std::string str_nbu = Header->GetEntryByNumber(0x0028,0x0101);
- if ( str_nbu == GDCM_UNFOUND )
- {
- nbu = nb;
- }
- else
- {
- nbu = atoi( str_nbu.c_str() );
- }
-
- // High Bit Position
- std::string str_highBit = Header->GetEntryByNumber(0x0028,0x0102);
- if ( str_highBit == GDCM_UNFOUND )