]> Creatis software - gdcm.git/commitdiff
To speed up DicomDir, instead of copying -and removing the source afterwards-
authorjpr <jpr>
Tue, 12 Jul 2005 17:08:12 +0000 (17:08 +0000)
committerjpr <jpr>
Tue, 12 Jul 2005 17:08:12 +0000 (17:08 +0000)
 each entry of the SQItem (found after gdcm::Document parsing) towards
 the gdcm::Object  belonging to the gdcm::DicomDir, we just copy
 the chained list itself.

src/gdcmCommon.h
src/gdcmDicomDir.cxx
src/gdcmDicomDirElement.h
src/gdcmDicomDirObject.cxx
src/gdcmDicomDirObject.h
src/gdcmDirList.h
src/gdcmSQItem.cxx
src/gdcmSQItem.h

index f4889a5d29fb07171b2fc87ca237688d312b3494..4701be49837b07194e252b15f4f79e83806949f0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommon.h,v $
   Language:  C++
-  Date:      $Date: 2005/07/11 19:46:05 $
-  Version:   $Revision: 1.78 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.79 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -85,7 +85,7 @@ typedef  unsigned int        uint32_t;
 #endif
 
 #include <string>
-#define FASTTAGKEY 0
+#define FASTTAGKEY 1
 
 // FIXME: Should rewrite this:
 #if FASTTAGKEY
index 473a08b460a960a1c90527d16d071525b03cfdf2..de32b9533d7e065c8a4cb27bd61afa6553dc7e3b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/12 14:58:26 $
-  Version:   $Revision: 1.147 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.148 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,6 +21,7 @@
 //  PS 3.3-2003, pages 731-750
 //-----------------------------------------------------------------------------
 #include "gdcmDicomDir.h"
+#include "gdcmDicomDirObject.h"
 #include "gdcmDicomDirStudy.h"
 #include "gdcmDicomDirSerie.h"
 #include "gdcmDicomDirVisit.h"
@@ -817,7 +818,9 @@ void DicomDir::CreateDicomDir()
         continue;
       }
       if ( si )
-         MoveSQItem(si,tmpSI);
+         //MoveSQItem(si,tmpSI); // Old code : Copies each Entry
+                                 //  -and then removes the source-
+         si->MoveObject(tmpSI);  // New code : Copies the List
 
       tmpSI=s->GetNextSQItem();
    }
@@ -1131,7 +1134,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
  * @param src source SQItem
  */
 void DicomDir::MoveSQItem(DocEntrySet *dst,DocEntrySet *src)
-{
+{ 
    DocEntry *entry;
 
    entry = src->GetFirstEntry();
index 0da4be80e82338db6ea80cde28f190f89731a4eb..c9c5148c40ffce7057bd5a96a293c78d97c3611a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirElement.h,v $
   Language:  C++
-  Date:      $Date: 2005/07/08 19:07:12 $
-  Version:   $Revision: 1.29 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.30 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -32,32 +32,32 @@ typedef std::list<Element> ListDicomDirElem;
 typedef std::list<Element> ListDicomDirMetaElem;
 typedef std::list<Element> ListDicomDirPatientElem;
 typedef std::list<Element> ListDicomDirStudyElem;
+typedef std::list<Element> ListDicomDirVisitElem;
 typedef std::list<Element> ListDicomDirSerieElem;
 typedef std::list<Element> ListDicomDirImageElem;
 
 // For future use (Full DICOMDIR)
 
-typedef std::list<Element> ListDicomDirVisitElem;
 /*
-typedef std::list<Element> ListDicomDirResult;
-typedef std::list<Element> ListDicomDirStudyComponent;
-
-typedef std::list<Element> ListDicomDirOverlay;
-typedef std::list<Element> ListDicomDirModalityLut;
-typedef std::list<Element> ListDicomDirModalityLut;
-typedef std::list<Element> ListDicomDirCurve;
-typedef std::list<Element> ListDicomDirStoredPrint;
-typedef std::list<Element> ListDicomDirRtDose;
-typedef std::list<Element> ListDicomDirRtStructureSet;
-typedef std::list<Element> ListDicomDirRtPlan;
-typedef std::list<Element> ListDicomDirRtTreatRecord;
-typedef std::list<Element> ListDicomDirPresentation;
-typedef std::list<Element> ListDicomDirSrDocument;
-typedef std::list<Element> ListDicomDirKeyObjectDoc;
-typedef std::list<Element> ListDicomDirSpectroscopy;
-typedef std::list<Element> ListDicomDirRawData;
-typedef std::list<Element> ListDicomDirRegistration;
-typedef std::list<Element> ListDicomDirFiducial;
+typedef std::list<Element> ListDicomDirResultElem;
+typedef std::list<Element> ListDicomDirStudyComponentElem;
+
+typedef std::list<Element> ListDicomDirOverlayElem;
+typedef std::list<Element> ListDicomDirModalityLutElem;
+typedef std::list<Element> ListDicomDirModalityLutElem;
+typedef std::list<Element> ListDicomDirCurveElem;
+typedef std::list<Element> ListDicomDirStoredPrintElem;
+typedef std::list<Element> ListDicomDirRtDoseElem;
+typedef std::list<Element> ListDicomDirRtStructureSetElem;
+typedef std::list<Element> ListDicomDirRtPlanElem;
+typedef std::list<Element> ListDicomDirRtTreatRecordElem;
+typedef std::list<Element> ListDicomDirPresentationElem;
+typedef std::list<Element> ListDicomDirSrDocumentElem;
+typedef std::list<Element> ListDicomDirKeyObjectDocElem;
+typedef std::list<Element> ListDicomDirSpectroscopyElem;
+typedef std::list<Element> ListDicomDirRawDataElem;
+typedef std::list<Element> ListDicomDirRegistrationElem;
+typedef std::list<Element> ListDicomDirFiducialElem;
 */
 
 //-----------------------------------------------------------------------------
index e81d6b77294bdae4b7dde26c8ccf2a8e5bebb942..84a5387660514f1ae5d53673b75c5277d790036c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/01 10:29:55 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -55,7 +55,7 @@ DicomDirObject::~DicomDirObject()
  */
 void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
 {
-  // FillObject fills up the SQItem that will be conneected to the right place
+  // FillObject fills up the SQItem that will be connected to the right place
    ListDicomDirMetaElem::const_iterator it;
    uint16_t tmpGr,tmpEl;
    DictEntry *dictEntry;
@@ -73,7 +73,7 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
 
       AddEntry(entry);
    }   
-}   
+}  
 
 //-----------------------------------------------------------------------------
 // Private
index b2eb7f01f9a52bc57da3b01f288c9bc1646c1c24..5e6dc85335f0601eaa49f8ebd8e930522e411f84 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.h,v $
   Language:  C++
-  Date:      $Date: 2005/02/07 14:48:34 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -48,6 +48,7 @@ protected:
    ~DicomDirObject();
 
    void FillObject(ListDicomDirMetaElem const &elemList);
+
 };
 } // end namespace gdcm
 
index 99ea714acddd68c3a9579472d2a66de3e23bc083..74a220a1ead915300173a576f2d674454706e67b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.h,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 15:07:41 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.24 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -32,7 +32,7 @@ typedef std::vector<std::string> DirListType;
 
 //-----------------------------------------------------------------------------
 
-// NOTE: Due to a VC6 'feature' we can not export a std::list in a dll, 
+// NOTE: Due to a VC6 'feature' we cannot export a std::list in a dll, 
 // so GDCM_EXPORT keyword was removed for this class only
 
 /**
index c0d3b27d2925525ab203f655f1cc6d431e07816e..fe331d2b6bed66fefafb9f34c7967f399b0f0ff5 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/06 08:43:18 $
-  Version:   $Revision: 1.73 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.74 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -198,6 +198,24 @@ void SQItem::ClearEntry()
    DocEntries.clear();
 }
 
+/**
+ * \brief  Clear the std::list from given Sequence Item  BUT keep the entries
+ */
+void SQItem::ClearEntryNoDestroy()
+{
+   DocEntries.clear();
+}
+
+
+/**
+ * \brief  Move all the entries from a given Sequence Item 
+ */
+void SQItem::MoveObject(SQItem *source)
+{
+   DocEntries = source->DocEntries;
+   source->ClearEntryNoDestroy();
+}
+
 /**
  * \brief   Get the first Dicom entry while visiting the SQItem
  * \return  The first DocEntry if found, otherwhise 0
index 4874a218e99e31e4746bdb6001f71992e6570ce1..ba42f1c0ddaf8447222d203f8846878c37dfbf06 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.h,v $
   Language:  C++
-  Date:      $Date: 2005/07/07 13:55:39 $
-  Version:   $Revision: 1.42 $
+  Date:      $Date: 2005/07/12 17:08:12 $
+  Version:   $Revision: 1.43 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -51,6 +51,8 @@ public:
    bool RemoveEntry(DocEntry *EntryToRemove);
    bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
    void ClearEntry();
+   void ClearEntryNoDestroy();
+   void MoveObject(SQItem *source);
   
    DocEntry *GetFirstEntry();
    DocEntry *GetNextEntry();