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
#include <netinet/in.h>
#endif
-# include <iomanip>
+#include <iomanip>
// Implicit VR Little Endian
#define UI1_2_840_10008_1_2 "1.2.840.10008.1.2"
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;;
}
}
// 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
{
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();
*/
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
{
// 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)
{
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; i<tokens.size(); i++)
{
newInt16 = atoi(tokens[i].c_str());
uint32_t newInt32;
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; i<tokens.size();i++)
{
newInt32 = atoi(tokens[i].c_str());
}
// Encoded pixel data: for the time being we are only concerned with
// Jpeg or RLE Pixel data encodings.
- // As stated in ps-3.3, 8.2:
+ // As stated in PS 3.5-2003, section 8.2 p44:
// "If sent in Encapsulated Format (i.e. other than the Native Format) the
// value representation OB is used".
// Hence we expect an OB value representation. Concerning OB VR,
- // the section PS3.3, A.4.c (p58 and p59), states:
+ // the section PS 3.5-2003, section A.4.c p 58-59, states:
// "For the Value Representations OB and OW, the encoding shall meet the
// following specifications depending on the Data element tag:"
// [...snip...]
delete[] basicOffsetTableItemValue;
}
- // Encapsulated RLE Compressed Images (see PS-3.3, Annex G).
+ // Encapsulated RLE Compressed Images (see PS 3.5-2003, Annex G)
// Loop on the frame[s] and store the parsed information in a
// gdcmRLEFramesInfo.
long frameLength;
// Store the collected info
gdcmRLEFrame* newFrameInfo = new gdcmRLEFrame;
newFrameInfo->NumberFragments = 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 );
}