X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDocument.cxx;h=c037ba6de931a36addc304ce7cb3272daa6acfe7;hb=879f56a62d0772c95e92d0657882eb1886b4153d;hp=857f12de05ca1a44e4acbc750d1599e2752f1c29;hpb=d65508e83c169bde30eecaed0ca1c5ce6d0eebcb;p=gdcm.git diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 857f12de..c037ba6d 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2004/10/06 22:31:31 $ - Version: $Revision: 1.96 $ + Date: $Date: 2004/10/10 03:03:10 $ + Version: $Revision: 1.101 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -33,7 +33,7 @@ #include #endif -# include +#include // Implicit VR Little Endian #define UI1_2_840_10008_1_2 "1.2.840.10008.1.2" @@ -981,12 +981,12 @@ bool gdcmDocument::SetEntryByNumber(std::string const& content, gdcmVRKey vr = valEntry->GetVR(); if( vr == "US" || vr == "SS" ) { - c = CountSubstring(content, "\\") + 1; // for multivaluated items + c = gdcmUtil::CountSubstring(content, "\\") + 1; // for multivaluated items l = c*2; } else if( vr == "UL" || vr == "SL" ) { - c = CountSubstring(content, "\\") + 1; // for multivaluated items + c = gdcmUtil::CountSubstring(content, "\\") + 1; // for multivaluated items l = c*4;; } } @@ -1452,6 +1452,7 @@ void gdcmDocument::ParseDES(gdcmDocEntrySet *set, // form ( group, elem )... if (gdcmDocument* dummy = dynamic_cast< gdcmDocument* > ( set ) ) { + (void)dummy; newBinEntry->SetKey( newBinEntry->GetKey() ); } // but when "this" is a SQItem, we are inserting this new @@ -1784,8 +1785,8 @@ void gdcmDocument::FindDocEntryLength( gdcmDocEntry *entry ) { if ( vr == "OB" || vr == "OW" || vr == "SQ" || vr == "UN" ) { - // The following reserved two bytes (see PS 3.5-2001, section - // 7.1.2 Data element structure with explicit vr p27) must be + // The following reserved two bytes (see PS 3.5-2003, section + // "7.1.2 Data element structure with explicit vr", p 27) must be // skipped before proceeding on reading the length on 4 bytes. fseek(Fp, 2L, SEEK_CUR); uint32_t length32 = ReadInt32(); @@ -1951,7 +1952,7 @@ void gdcmDocument::FindDocEntryVR( gdcmDocEntry *entry ) */ bool gdcmDocument::CheckDocEntryVR(gdcmDocEntry *entry, gdcmVRKey vr) { - char msg[100]; // for sprintf + std::string msg; bool realExplicit = true; // Assume we are reading a falsely explicit VR file i.e. we reached @@ -1979,9 +1980,9 @@ bool gdcmDocument::CheckDocEntryVR(gdcmDocEntry *entry, gdcmVRKey vr) { // We thought this was explicit VR, but we end up with an // implicit VR tag. Let's backtrack. - sprintf(msg,"Falsely explicit vr file (%04x,%04x)\n", - entry->GetGroup(), entry->GetElement()); - dbg.Verbose(1, "gdcmDocument::FindVR: ",msg); + msg = gdcmUtil::Format("Falsely explicit vr file (%04x,%04x)\n", + entry->GetGroup(), entry->GetElement()); + dbg.Verbose(1, "gdcmDocument::FindVR: ", msg.c_str()); if( entry->GetGroup() % 2 && entry->GetElement() == 0x0000) { @@ -2119,7 +2120,7 @@ std::string gdcmDocument::GetDocEntryUnvalue(gdcmDocEntry* entry) uint16_t newInt16; tokens.erase( tokens.begin(), tokens.end()); // clean any previous value - Tokenize (((gdcmValEntry *)entry)->GetValue(), tokens, "\\"); + gdcmUtil::Tokenize (((gdcmValEntry *)entry)->GetValue(), tokens, "\\"); for (unsigned int i=0; iGetValue(), tokens, "\\"); + gdcmUtil::Tokenize (((gdcmValEntry *)entry)->GetValue(), tokens, "\\"); for (unsigned int i=0; iNumberFragments = nbRleSegments; - for( unsigned int k = 1; k <= nbRleSegments; k++ ) + for( unsigned int uk = 1; uk <= nbRleSegments; uk++ ) { - newFrameInfo->Offset[k] = frameOffset + rleSegmentOffsetTable[k]; - newFrameInfo->Length[k] = rleSegmentLength[k]; + newFrameInfo->Offset[uk] = frameOffset + rleSegmentOffsetTable[uk]; + newFrameInfo->Length[uk] = rleSegmentLength[uk]; } RLEInfo.Frames.push_back( newFrameInfo ); }