Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Fp->seekg(0, std::ios::end);
long lgt = Fp->tellg(); // total length of the file
Fp->seekg(0, std::ios::end);
long lgt = Fp->tellg(); // total length of the file
Fp->read((char*)data, l);
if ( Fp->fail() || Fp->eof() )
{
Fp->read((char*)data, l);
if ( Fp->fail() || Fp->eof() )
{
- // explicit VR AND OB, OW, SQ, UT : 4 more bytes
+ // explicit VR AND (OB, OW, SQ, UT) : 4 more bytes
if ( Filetype == ExplicitVR &&
!Global::GetVR()->IsVROfBinaryRepresentable(vr) )
{
////// No DataEntry: should mean UNKOWN VR
gdcmWarningMacro( std::hex << newDocEntry->GetGroup()
<< "|" << newDocEntry->GetElement()
if ( Filetype == ExplicitVR &&
!Global::GetVR()->IsVROfBinaryRepresentable(vr) )
{
////// No DataEntry: should mean UNKOWN VR
gdcmWarningMacro( std::hex << newDocEntry->GetGroup()
<< "|" << newDocEntry->GetElement()
if ( newDocEntry->GetGroup()%2 != 0 )
{
Fp->seekg( l, std::ios::cur);
if ( newDocEntry->GetGroup()%2 != 0 )
{
Fp->seekg( l, std::ios::cur);
{
// User asked to skip *any* SeQuence
Fp->seekg( l, std::ios::cur);
{
// User asked to skip *any* SeQuence
Fp->seekg( l, std::ios::cur);
// is a Document, then we are building the first depth level.
// Hence the SeqEntry we are building simply has a depth
// level of one:
// is a Document, then we are building the first depth level.
// Hence the SeqEntry we are building simply has a depth
// level of one:
}
// But when "set" is already a SQItem, we are building a nested
// sequence, and hence the depth level of the new SeqEntry
}
// But when "set" is already a SQItem, we are building a nested
// sequence, and hence the depth level of the new SeqEntry
else if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 );
else if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 );
uint32_t length = entry->GetLength();
Fp->seekg((long)entry->GetOffset(), std::ios::beg);
uint32_t length = entry->GetLength();
Fp->seekg((long)entry->GetOffset(), std::ios::beg);
* \brief Find the Value Representation of the current Dicom Element.
* @return Value Representation of the current Entry
*/
* \brief Find the Value Representation of the current Dicom Element.
* @return Value Representation of the current Entry
*/
long positionOnEntry = Fp->tellg();
// Warning: we believe this is explicit VR (Value Representation) because
long positionOnEntry = Fp->tellg();
// Warning: we believe this is explicit VR (Value Representation) because
* @return false if the VR is incorrect or if the VR isn't referenced
* otherwise, it returns true
*/
* @return false if the VR is incorrect or if the VR isn't referenced
* otherwise, it returns true
*/
uint32_t length = entry->GetLength();
// When we have some semantics on the element we just read, and if we
uint32_t length = entry->GetLength();
// When we have some semantics on the element we just read, and if we
// Since for dicom compliant and well behaved headers, the present
// test is useless (and might even look a bit paranoid), when we
// encounter such an ill-formed image, we simply display a warning
// Since for dicom compliant and well behaved headers, the present
// test is useless (and might even look a bit paranoid), when we
// encounter such an ill-formed image, we simply display a warning
char *entCur = deb + 128;
if ( memcmp(entCur, "DICM", (size_t)4) == 0 )
{
char *entCur = deb + 128;
if ( memcmp(entCur, "DICM", (size_t)4) == 0 )
{
// Group 0002 should always be VR, and the first element 0000
// Let's be carefull (so many wrong headers ...)
// Group 0002 should always be VR, and the first element 0000
// Let's be carefull (so many wrong headers ...)
- gdcmWarningMacro( "Switching Byte Swap code from "<< SwapCode
- << " at :" <<std::hex << Fp->tellg() );
+ gdcmDebugMacro( "Switching Byte Swap code from "<< SwapCode
+ << " at: 0x" << std::hex << Fp->tellg() );