From: jpr Date: Mon, 27 Oct 2003 16:45:57 +0000 (+0000) Subject: To avoid pb with xmedcon-breaker CT McTwin Elscint images X-Git-Tag: Version0.3.1~79 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9ab2e9d4f106a4587c3d4f8f3de93def93e5b43e;p=gdcm.git To avoid pb with xmedcon-breaker CT McTwin Elscint images --- diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index ed51d698..5952e63b 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -161,8 +161,8 @@ bool gdcmFile::ReadPixelData(void* destination) { IsImplicitVRLittleEndianTransferSyntax() || IsExplicitVRLittleEndianTransferSyntax() || IsExplicitVRBigEndianTransferSyntax() || - IsDeflatedExplicitVRLittleEndianTransferSyntax() ) { - + IsDeflatedExplicitVRLittleEndianTransferSyntax() ) { + size_t ItemRead = fread(destination, lgrTotale, 1, fp); if ( ItemRead != 1 ) { CloseFile(); @@ -354,9 +354,11 @@ size_t gdcmFile::GetImageDataIntoVector (void* destination, size_t MaxSize) { } // Signe des Pixels + // 0 = Unsigned + // 1 = Signed str_signe=GetPubElValByNumber(0x0028,0x0103); if (str_signe == GDCM_UNFOUND ) { - signe = 1; + signe = 0; // default is unsigned } else { signe = atoi(str_signe.c_str() ); } @@ -364,7 +366,18 @@ size_t gdcmFile::GetImageDataIntoVector (void* destination, size_t MaxSize) { // re arange bytes inside the integer if (nb != 8) SwapZone(destination, GetSwapCode(), lgrTotale, nb); - + + // to avoid pb with some xmedcon breakers images + if (nb==16 && nbu