From 9862070436bb6cee0fa3afd04a86d7b5888c8f72 Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 7 Jul 2005 13:55:39 +0000 Subject: [PATCH] Comment out the time consuming, never used/useless 'Extended tag' stuff for Sequence embedded Entries --- src/gdcmDocument.cxx | 55 ++++++++++++++++++++++++++------------------ src/gdcmSQItem.h | 21 +++++++++-------- 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 6bf0b281..0c450733 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/07/07 13:11:38 $ - Version: $Revision: 1.260 $ + Date: $Date: 2005/07/07 13:55:39 $ + Version: $Revision: 1.261 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -108,15 +108,15 @@ bool Document::Load( std::string const &fileName ) { if ( IsDocumentAlreadyLoaded ) { - /* - if ( Filename == fileName ) - { - gdcmWarningMacro( "The file was already parsed inside this " - << "gdcm::Document (its name is: " - << Filename.c_str() ); - return true; - } - */ + // time waste hunting + // if ( Filename == fileName ) + // { + // gdcmWarningMacro( "The file was already parsed inside this " + // << "gdcm::Document (its name is: " + // << Filename.c_str() ); + // return true; + // } + gdcmWarningMacro( "A file was already parsed inside this " << "gdcm::Document (previous name was: " << Filename.c_str() << ". New name is :" @@ -926,12 +926,14 @@ void Document::ParseDES(DocEntrySet *set, long offset, // but when "this" is a SQItem, we are inserting this new // valEntry in a sequence item, and the key has the // generalized form (refer to \ref BaseTagKey): - if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) - { - newBinEntry->SetKey( parentSQItem->GetBaseTagKey() - + newBinEntry->GetKey() ); - } + // time waste hunting + //if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) + //{ + // newBinEntry->SetKey( parentSQItem->GetBaseTagKey() + // + newBinEntry->GetKey() ); + //} + if ( !set->AddEntry( newBinEntry ) ) { gdcmWarningMacro( "in ParseDES : cannot add a BinEntry " @@ -957,11 +959,13 @@ void Document::ParseDES(DocEntrySet *set, long offset, // ...but when "set" is a SQItem, we are inserting this new // valEntry in a sequence item. Hence the key has the // generalized form (refer to \ref BaseTagKey): - if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) - { - newValEntry->SetKey( parentSQItem->GetBaseTagKey() - + newValEntry->GetKey() ); - } + + // time waste hunting + //if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) + //{ + // newValEntry->SetKey( parentSQItem->GetBaseTagKey() + // + newValEntry->GetKey() ); + //} if ( LoadMode & NO_SHADOW ) // User asked to skip, if possible, // shadow groups ( if possible : @@ -1062,11 +1066,14 @@ void Document::ParseDES(DocEntrySet *set, long offset, // But when "set" is already a SQItem, we are building a nested // sequence, and hence the depth level of the new SeqEntry // we are building, is one level deeper: + + // time waste hunting if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) { newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 ); - newSeqEntry->SetKey( parentSQItem->GetBaseTagKey() - + newSeqEntry->GetKey() ); + + // newSeqEntry->SetKey( parentSQItem->GetBaseTagKey() + // + newSeqEntry->GetKey() ); } if ( l != 0 ) @@ -1132,12 +1139,14 @@ void Document::ParseSQ( SeqEntry *seqEntry, } // create the current SQItem SQItem *itemSQ = new SQItem( seqEntry->GetDepthLevel() ); +/* std::ostringstream newBase; newBase << seqEntry->GetKey() << "/" << SQItemNumber << "#"; itemSQ->SetBaseTagKey( newBase.str() ); +*/ unsigned int l = newDocEntry->GetReadLength(); if ( l == 0xffffffff ) diff --git a/src/gdcmSQItem.h b/src/gdcmSQItem.h index ef24fa28..4874a218 100644 --- a/src/gdcmSQItem.h +++ b/src/gdcmSQItem.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.h,v $ Language: C++ - Date: $Date: 2005/02/07 08:48:18 $ - Version: $Revision: 1.41 $ + Date: $Date: 2005/07/07 13:55:39 $ + Version: $Revision: 1.42 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -70,11 +70,11 @@ public: /// \brief Accessor on \ref SQDepthLevel. void SetDepthLevel(int depth) { SQDepthLevel = depth; } - /// \brief Accessor on \ref BaseTagKey. - void SetBaseTagKey( BaseTagKey const &key ) { BaseTagKeyNested = key; } - - /// \brief Accessor on \ref BaseTagKey. - BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; } + // waste time hunting + // / \brief Accessor on \ref BaseTagKey. + //void SetBaseTagKey( BaseTagKey const &key ) { BaseTagKeyNested = key; } + // / \brief Accessor on \ref BaseTagKey. + //BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; } protected: // Variables that need to be accessed in subclasses @@ -93,9 +93,10 @@ private: /// (see \ref Print). int SQDepthLevel; - /// \brief A TagKey of a DocEntry nested in a sequence is prepended - /// with this BaseTagKey. - BaseTagKey BaseTagKeyNested; + // waste time hunting + // / \brief A TagKey of a DocEntry nested in a sequence is prepended + // / with this BaseTagKey. + //BaseTagKey BaseTagKeyNested; /// \brief SQ Item ordinal number int SQItemNumber; -- 2.45.1