1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDir.cxx,v $
6 Date: $Date: 2004/12/03 17:13:18 $
7 Version: $Revision: 1.84 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #include "gdcmDicomDir.h"
20 #include "gdcmDicomDirStudy.h"
21 #include "gdcmDicomDirSerie.h"
22 #include "gdcmDicomDirImage.h"
23 #include "gdcmDirList.h"
25 #include "gdcmDebug.h"
26 #include "gdcmGlobal.h"
27 #include "gdcmHeader.h"
28 #include "gdcmSeqEntry.h"
29 #include "gdcmSQItem.h"
30 #include "gdcmValEntry.h"
35 #include <sys/types.h>
38 #define getcwd _getcwd
41 #if defined( _MSC_VER) || defined(__BORLANDC__)
50 //-----------------------------------------------------------------------------
51 // For full DICOMDIR description, see:
52 // PS 3.3-2003, pages 731-750
53 //-----------------------------------------------------------------------------
54 // Constructor / Destructor
58 * \brief Constructor : creates an empty DicomDir
63 Initialize(); // sets all private fields to NULL
64 MetaElems = NewMeta();
68 * \brief Constructor Parses recursively the directory and creates the DicomDir
69 * or uses an already built DICOMDIR, depending on 'parseDir' value.
70 * @param fileName name
71 * - of the root directory (parseDir = true)
72 * - of the DICOMDIR (parseDir = false)
73 * @param parseDir boolean
74 * - true if user passed an entry point
75 * and wants to explore recursively the directories
76 * - false if user passed an already built DICOMDIR file
79 DicomDir::DicomDir(std::string const & fileName, bool parseDir ):
82 // Whatever user passed (a root directory or a DICOMDIR)
83 // and whatever the value of parseDir was,
84 // Document is already executed
85 Initialize(); // sets all private fields to NULL
87 // if user passed a root directory, sure we didn't get anything
88 if ( TagHT.begin() == TagHT.end() ) // when user passed a Directory to parse
90 dbg.Verbose(0, "DicomDir::DicomDir : entry HT empty");
92 if ( fileName.size() == 1 && fileName[0] == '.' )
94 // user passed '.' as Name
95 // we get current directory name
97 getcwd(dummy, (size_t)1000);
98 SetFileName( dummy ); // will be converted into a string
101 if ( parseDir ) // user asked for a recursive parsing of a root directory
103 MetaElems = NewMeta();
105 dbg.Verbose(0, "DicomDir::DicomDir : Parse directory"
106 " and create the DicomDir");
111 /// \todo if parseDir == false, it should be tagged as an error
112 // NON ! il suffit d'appeler ParseDirectory()
113 // apres le constructeur
116 else // Only if user passed a DICOMDIR
118 // Directory record sequence
119 DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220);
122 dbg.Verbose(0, "DicomDir::DicomDir : NO Directory record"
123 " sequence (0x0004,0x1220)");
124 /// \todo FIXME : what do we do when the parsed file IS NOT a
133 * \brief Canonical destructor
135 DicomDir::~DicomDir()
137 SetStartMethod(NULL);
138 SetProgressMethod(NULL);
141 for(ListDicomDirPatient::iterator cc = Patients.begin();
153 //-----------------------------------------------------------------------------
156 * \brief Canonical Printer
158 void DicomDir::Print(std::ostream &os)
162 MetaElems->SetPrintLevel(PrintLevel);
163 MetaElems->Print(os);
165 for(ListDicomDirPatient::iterator cc = Patients.begin();
166 cc != Patients.end();
169 (*cc)->SetPrintLevel( PrintLevel );
174 //-----------------------------------------------------------------------------
177 * \brief This predicate, based on hopefully reasonable heuristics,
178 * decides whether or not the current header was properly parsed
179 * and contains the mandatory information for being considered as
180 * a well formed and usable DicomDir.
181 * @return true when Document is the one of a reasonable DicomDir,
184 bool DicomDir::IsReadable()
186 if( !Document::IsReadable() )
194 if( Patients.size() <= 0 )
203 * \brief Sets all fields to NULL
206 void DicomDir::Initialize()
209 ProgressMethod = NULL;
211 StartMethodArgDelete = NULL;
212 ProgressMethodArgDelete = NULL;
213 EndMethodArgDelete = NULL;
227 * \brief fills the whole structure, starting from a root Directory
229 void DicomDir::ParseDirectory()
231 CreateDicomDirChainedList( GetFileName() );
237 * \brief Set the start method to call when the parsing of the
239 * @param method Method to call
240 * @param arg Argument to pass to the method
241 * @param argDelete Argument
242 * \warning In python : the arg parameter isn't considered
244 void DicomDir::SetStartMethod( DicomDir::Method* method, void* arg,
245 DicomDir::Method* argDelete )
247 if( StartArg && StartMethodArgDelete )
249 StartMethodArgDelete( StartArg );
252 StartMethod = method;
254 StartMethodArgDelete = argDelete;
259 * \brief Set the method to delete the argument
260 * The argument is destroyed when the method is changed or when the
262 * @param method Method to call to delete the argument
264 void DicomDir::SetStartMethodArgDelete( DicomDir::Method* method )
266 StartMethodArgDelete = method;
271 * \brief Set the progress method to call when the parsing of the
273 * @param method Method to call
274 * @param arg Argument to pass to the method
275 * @param argDelete Argument
276 * \warning In python : the arg parameter isn't considered
278 void DicomDir::SetProgressMethod( DicomDir::Method* method, void* arg,
279 DicomDir::Method* argDelete )
281 if( ProgressArg && ProgressMethodArgDelete )
283 ProgressMethodArgDelete( ProgressArg );
286 ProgressMethod = method;
288 ProgressMethodArgDelete = argDelete;
293 * \brief Set the method to delete the argument
294 * The argument is destroyed when the method is changed or when the
296 * @param method Method to call to delete the argument
298 void DicomDir::SetProgressMethodArgDelete( DicomDir::Method* method )
300 ProgressMethodArgDelete = method;
305 * \brief Set the end method to call when the parsing of the directory ends
306 * @param method Method to call
307 * @param arg Argument to pass to the method
308 * @param argDelete Argument
309 * \warning In python : the arg parameter isn't considered
311 void DicomDir::SetEndMethod( DicomDir::Method* method, void* arg,
312 DicomDir::Method* argDelete )
314 if( EndArg && EndMethodArgDelete )
316 EndMethodArgDelete( EndArg );
321 EndMethodArgDelete = argDelete;
326 * \brief Set the method to delete the argument
327 * The argument is destroyed when the method is changed or when
328 * the class is destroyed
329 * @param method Method to call to delete the argument
331 void DicomDir::SetEndMethodArgDelete( DicomDir::Method* method )
333 EndMethodArgDelete = method;
338 * \brief writes on disc a DICOMDIR
339 * \ warning does NOT add the missing elements in the header :
340 * it's up to the user doing it !
341 * \todo : to be re-written using the DICOMDIR tree-like structure
342 * *not* the chained list
343 * (does NOT exist if the DICOMDIR is user-forged !)
344 * @param fileName file to be written to
345 * @return false only when fail to open
348 bool DicomDir::WriteDicomDir(std::string const& fileName)
351 uint16_t sq[4] = { 0x0004, 0x1220, 0xffff, 0xffff };
352 uint16_t sqt[4]= { 0xfffe, 0xe0dd, 0xffff, 0xffff };
354 std::ofstream* fp = new std::ofstream(fileName.c_str(),
355 std::ios::out | std::ios::binary);
358 dbg.Verbose(2, "Failed to open(write) File: ", fileName.c_str());
362 char filePreamble[128];
363 memset(filePreamble, 0, 128);
364 fp->write(filePreamble, 128); //FIXME
365 binary_write( *fp, "DICM");
367 DicomDirMeta *ptrMeta = GetDicomDirMeta();
368 ptrMeta->WriteContent(fp, ExplicitVR);
370 // force writing 0004|1220 [SQ ], that CANNOT exist within DicomDirMeta
373 binary_write(*fp, sq[i]);
376 for(ListDicomDirPatient::iterator cc = Patients.begin();
377 cc != Patients.end();
380 (*cc)->WriteContent( fp, ExplicitVR );
383 // force writing Sequence Delimitation Item
386 binary_write(*fp, sqt[i]); // fffe e0dd ffff ffff
395 //-----------------------------------------------------------------------------
400 * \brief create a Document-like chained list from a root Directory
401 * @param path entry point of the tree-like structure
403 void DicomDir::CreateDicomDirChainedList(std::string const & path)
406 DirList fileList(path,1); // gets recursively the file list
407 unsigned int count = 0;
411 for( DirList::iterator it = fileList.begin();
412 it != fileList.end();
415 Progress = (float)(count+1)/(float)fileList.size();
416 CallProgressMethod();
422 std::cerr<<"File : "<<it->c_str()<<std::endl;
423 header = new Header( it->c_str() );
427 "DicomDir::CreateDicomDirChainedList: "
428 "failure in new Header ",
433 if( header->IsReadable() )
435 // Add the file header to the chained list:
436 list.push_back(header);
438 "DicomDir::CreateDicomDirChainedList: readable ",
447 // sorts Patient/Study/Serie/
448 std::sort(list.begin(), list.end(), DicomDir::HeaderLessThan );
450 std::string tmp = fileList.GetDirName();
451 //for each Header of the chained list, add/update the Patient/Study/Serie/Image info
452 SetElements(tmp, list);
455 for(VectDocument::iterator it=list.begin();
459 delete dynamic_cast<Header *>(*it);
465 * \brief adds *the* Meta to a partially created DICOMDIR
468 DicomDirMeta * DicomDir::NewMeta()
470 DicomDirMeta *m = new DicomDirMeta();
472 if ( TagHT.begin() != TagHT.end() ) // after Document Parsing
474 TagDocEntryHT::iterator lastOneButSequence = TagHT.end();
475 lastOneButSequence --;
476 // ALL the 'out of Sequence' Tags belong to Meta Elems
477 // (we skip 0004|1220 [Directory record sequence] )
478 for ( TagDocEntryHT::iterator cc = TagHT.begin();
479 cc != lastOneButSequence;
482 m->AddDocEntry( cc->second );
485 else // after root directory parsing
487 ListDicomDirMetaElem const & elemList =
488 Global::GetDicomDirElements()->GetDicomDirMetaElements();
489 m->FillObject(elemList);
491 m->SetSQItemNumber(0); // To avoid further missprinting
496 * \brief adds a new Patient (with the basic elements) to a partially created DICOMDIR
498 DicomDirPatient * DicomDir::NewPatient()
500 ListDicomDirPatientElem::const_iterator it;
501 uint16_t tmpGr,tmpEl;
502 DictEntry *dictEntry;
505 ListDicomDirPatientElem const & elemList =
506 Global::GetDicomDirElements()->GetDicomDirPatientElements();
507 DicomDirPatient *p = new DicomDirPatient();
509 // for all the DicomDirPatient Elements
510 for( it = elemList.begin(); it != elemList.end(); ++it )
514 dictEntry = GetPubDict()->GetDictEntryByNumber(tmpGr, tmpEl);
515 entry = new ValEntry( dictEntry );
516 entry->SetOffset(0); // just to avoid further missprinting
517 entry->SetValue( it->Value );
519 // dealing with value length ...
521 if( dictEntry->GetGroup() == 0xfffe)
523 entry->SetLength(entry->GetValue().length());
525 else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" )
527 entry->SetLength( 4 );
529 else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" )
533 else if( dictEntry->GetVR() == "SQ" )
535 entry->SetLength( 0xffffffff );
539 entry->SetLength( entry->GetValue().length() );
541 p->AddDocEntry( entry );
544 Patients.push_front( p );
550 * \brief adds to the HTable
551 * the Entries (Dicom Elements) corresponding to the given type
552 * @param path full path file name (only used when type = GDCM_DICOMDIR_IMAGE
553 * @param type DicomDirObject type to create (GDCM_DICOMDIR_PATIENT,
554 * GDCM_DICOMDIR_STUDY, GDCM_DICOMDIR_SERIE ...)
555 * @param header Header of the current file
557 void DicomDir::SetElement(std::string const & path, DicomDirType type,
560 ListDicomDirElem elemList; //FIXME this is going to be a by copy operation
561 ListDicomDirElem::const_iterator it;
562 uint16_t tmpGr, tmpEl;
563 DictEntry *dictEntry;
570 case GDCM_DICOMDIR_IMAGE:
571 elemList = Global::GetDicomDirElements()->GetDicomDirImageElements();
572 si = new DicomDirImage();
573 if( !AddDicomDirImageToEnd(static_cast<DicomDirImage *>(si)) )
575 dbg.Verbose(0,"DicomDir::SetElement:",
576 "Add DicomDirImageToEnd failed");
579 case GDCM_DICOMDIR_SERIE:
580 elemList = Global::GetDicomDirElements()->GetDicomDirSerieElements();
581 si = new DicomDirSerie();
582 if( !AddDicomDirSerieToEnd(static_cast<DicomDirSerie *>(si)) )
584 dbg.Verbose(0,"DicomDir::SetElement:",
585 "Add DicomDirSerieToEnd failed");
588 case GDCM_DICOMDIR_STUDY:
589 elemList = Global::GetDicomDirElements()->GetDicomDirStudyElements();
590 si = new DicomDirStudy();
591 if( !AddDicomDirStudyToEnd(static_cast<DicomDirStudy *>(si)) )
593 dbg.Verbose(0,"DicomDir::SetElement:",
594 "Add DicomDirStudyToEnd failed");
597 case GDCM_DICOMDIR_PATIENT:
598 elemList = Global::GetDicomDirElements()->GetDicomDirPatientElements();
599 si = new DicomDirPatient();
600 if( !AddDicomDirPatientToEnd(static_cast<DicomDirPatient *>(si)) )
602 dbg.Verbose(0,"DicomDir::SetElement:",
603 "Add DicomDirPatientToEnd failed");
606 case GDCM_DICOMDIR_META:
607 elemList = Global::GetDicomDirElements()->GetDicomDirMetaElements();
608 si = new DicomDirMeta();
611 dbg.Verbose(0,"DicomDir::SetElement:",
612 "MetaElements already exist, they will be destroyed");
615 MetaElems = static_cast<DicomDirMeta *>(si);
620 // removed all the seems-to-be-useless stuff about Referenced Image Sequence
621 // to avoid further troubles
622 // imageElem 0008 1140 "" // Referenced Image Sequence
623 // imageElem fffe e000 "" // 'no length' item : length to be set to 0xffffffff later
624 // imageElem 0008 1150 "" // Referenced SOP Class UID : to be set/forged later
625 // imageElem 0008 1155 "" // Referenced SOP Instance UID : to be set/forged later
626 // imageElem fffe e00d "" // Item delimitation : length to be set to ZERO later
627 // for all the relevant elements found in their own spot of the DicomDir.dic
628 // FIXME : troubles found when it's a SeqEntry
630 for( it = elemList.begin(); it != elemList.end(); ++it)
634 dictEntry = GetPubDict()->GetDictEntryByNumber(tmpGr, tmpEl);
636 entry = new ValEntry( dictEntry ); // Be sure it's never a BinEntry !
638 entry->SetOffset(0); // just to avoid further missprinting
639 entry->SetLength(0); // just to avoid further missprinting
643 // NULL when we Build Up (ex nihilo) a DICOMDIR
644 // or when we add the META elems
645 val = header->GetEntryByNumber(tmpGr, tmpEl);
652 if( val == GDCM_UNFOUND)
654 if( tmpGr == 0x0004 && tmpEl == 0x1130 ) // File-set ID
656 // force to the *end* File Name
657 val = Util::GetName( path );
659 else if( tmpGr == 0x0004 && tmpEl == 0x1500 ) // Only used for image
661 if( header->GetFileName().substr(0, path.length()) != path )
663 dbg.Verbose(0, "DicomDir::SetElement : the base path"
664 " of file name is incorrect");
665 val = header->GetFileName();
669 val = &(header->GetFileName().c_str()[path.length()]);
679 if ( header->GetEntryLengthByNumber(tmpGr,tmpEl) == 0 )
683 // GDCM_UNFOUND or not !
685 entry->SetValue( val ); // troubles expected when vr=SQ ...
689 if( dictEntry->GetGroup() == 0xfffe )
691 entry->SetLength( entry->GetValue().length() ); // FIXME
693 else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" )
697 else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" )
701 else if( dictEntry->GetVR() == "SQ" )
703 entry->SetLength( 0xffffffff );
707 entry->SetLength( entry->GetValue().length() );
711 if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !
713 std::cout << "GDCM_DICOMDIR_META ?!? should never print that"
720 //-----------------------------------------------------------------------------
722 * \brief CallStartMethod
724 void DicomDir::CallStartMethod()
730 StartMethod( StartArg );
734 //-----------------------------------------------------------------------------
737 * \brief CallProgressMethod
739 void DicomDir::CallProgressMethod()
743 ProgressMethod( ProgressArg );
747 //-----------------------------------------------------------------------------
750 * \brief CallEndMethod
752 void DicomDir::CallEndMethod()
761 //-----------------------------------------------------------------------------
765 * \brief create a 'DicomDir' from a DICOMDIR Header
767 void DicomDir::CreateDicomDir()
769 // The list is parsed.
770 // When a DicomDir tag ("PATIENT", "STUDY", "SERIE", "IMAGE") is found :
771 // 1 - we save the beginning iterator
772 // 2 - we continue to parse
773 // 3 - we find an other tag
774 // + we create the object for the precedent tag
777 // Directory record sequence
778 DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220);
781 dbg.Verbose(0, "DicomDir::DicomDir : NO Directory record"
782 " sequence (0x0004,0x1220)");
783 /// \todo FIXME: what to do when the parsed file IS NOT a DICOMDIR file ?
787 SeqEntry* s = dynamic_cast<SeqEntry*>(e);
790 dbg.Verbose(0, "DicomDir::CreateDicomDir: no SeqEntry present");
791 // useless : (0x0004,0x1220) IS a Sequence !
795 DicomDirType type; // = DicomDir::GDCM_DICOMDIR_META;
796 MetaElems = NewMeta();
798 ListSQItem listItems = s->GetSQItems();
803 for( ListSQItem::iterator i = listItems.begin();
804 i !=listItems.end(); ++i )
806 d = (*i)->GetDocEntryByNumber(0x0004, 0x1430); // Directory Record Type
807 if ( ValEntry* valEntry = dynamic_cast< ValEntry* >(d) )
809 v = valEntry->GetValue();
813 dbg.Verbose(0, "DicomDir::CreateDicomDir: not a ValEntry.");
817 if( v == "PATIENT " )
819 si = new DicomDirPatient();
820 AddDicomDirPatientToEnd( static_cast<DicomDirPatient *>(si) );
821 type = DicomDir::GDCM_DICOMDIR_PATIENT;
823 else if( v == "STUDY " )
825 si = new DicomDirStudy();
826 AddDicomDirStudyToEnd( static_cast<DicomDirStudy *>(si) );
827 type = DicomDir::GDCM_DICOMDIR_STUDY;
829 else if( v == "SERIES" )
831 si = new DicomDirSerie();
832 AddDicomDirSerieToEnd( static_cast<DicomDirSerie *>(si) );
833 type = DicomDir::GDCM_DICOMDIR_SERIE;
835 else if( v == "IMAGE " )
837 si = new DicomDirImage();
838 AddDicomDirImageToEnd( static_cast<DicomDirImage *>(si) );
839 type = DicomDir::GDCM_DICOMDIR_IMAGE;
843 // It was not a 'PATIENT', nor a 'STUDY', nor a 'SERIE',
844 // neither an 'IMAGE' SQItem. Skip to next item.
854 * \brief Well ... there is only one occurence
856 bool DicomDir::AddDicomDirMeta()
862 MetaElems = new DicomDirMeta();
868 * \brief AddDicomDirPatientToEnd
869 * @param s SQ Item to enqueue to the DicomPatient chained List
871 bool DicomDir::AddDicomDirPatientToEnd(DicomDirPatient *dd)
873 Patients.push_back(dd);
879 * \brief AddDicomDirStudyToEnd
880 * @param s SQ Item to enqueue to the DicomDirStudy chained List
882 bool DicomDir::AddDicomDirStudyToEnd(DicomDirStudy *dd)
884 if( Patients.size() > 0 )
886 ListDicomDirPatient::iterator itp = Patients.end();
888 (*itp)->AddDicomDirStudy(dd);
896 * \brief AddDicomDirSerieToEnd
897 * @param s SQ Item to enqueue to the DicomDirSerie chained List
899 bool DicomDir::AddDicomDirSerieToEnd(DicomDirSerie *dd)
901 if( Patients.size() > 0 )
903 ListDicomDirPatient::iterator itp = Patients.end();
906 if( (*itp)->GetDicomDirStudies().size() > 0 )
908 ListDicomDirStudy::const_iterator itst =
909 (*itp)->GetDicomDirStudies().end();
911 (*itst)->AddDicomDirSerie(dd);
920 * \brief AddDicomDirImageToEnd
921 * @param s SQ Item to enqueue to the DicomDirImage chained List
923 bool DicomDir::AddDicomDirImageToEnd(DicomDirImage *dd)
925 if( Patients.size() > 0 )
927 ListDicomDirPatient::iterator itp = Patients.end();
930 if( (*itp)->GetDicomDirStudies().size() > 0 )
932 ListDicomDirStudy::const_iterator itst =
933 (*itp)->GetDicomDirStudies().end();
936 if( (*itst)->GetDicomDirSeries().size() > 0 )
938 ListDicomDirSerie::const_iterator its = (*itst)->GetDicomDirSeries().end();
940 (*its)->AddDicomDirImage(dd);
950 * \brief for each Header of the chained list, add/update the Patient/Study/Serie/Image info
951 * @param path path of the root directory
952 * @param list chained list of Headers
954 void DicomDir::SetElements(std::string const & path, VectDocument const &list)
959 std::string patPrevName = "", patPrevID = "";
960 std::string studPrevInstanceUID = "", studPrevID = "";
961 std::string serPrevInstanceUID = "", serPrevID = "";
963 std::string patCurName, patCurID;
964 std::string studCurInstanceUID, studCurID;
965 std::string serCurInstanceUID, serCurID;
968 for( VectDocument::const_iterator it = list.begin();
969 it != list.end(); ++it )
971 // get the current file characteristics
972 patCurName = (*it)->GetEntryByNumber(0x0010,0x0010);
973 patCurID = (*it)->GetEntryByNumber(0x0010,0x0011);
974 studCurInstanceUID = (*it)->GetEntryByNumber(0x0020,0x000d);
975 studCurID = (*it)->GetEntryByNumber(0x0020,0x0010);
976 serCurInstanceUID = (*it)->GetEntryByNumber(0x0020,0x000e);
977 serCurID = (*it)->GetEntryByNumber(0x0020,0x0011);
979 if( patCurName != patPrevName || patCurID != patPrevID || first )
981 SetElement(path, GDCM_DICOMDIR_PATIENT, *it);
985 // if new Study Deal with 'STUDY' Elements
986 if( studCurInstanceUID != studPrevInstanceUID || studCurID != studPrevID
989 SetElement(path, GDCM_DICOMDIR_STUDY, *it);
993 // if new Serie Deal with 'SERIE' Elements
994 if( serCurInstanceUID != serPrevInstanceUID || serCurID != serPrevID
997 SetElement(path, GDCM_DICOMDIR_SERIE, *it);
1001 // Always Deal with 'IMAGE' Elements
1002 SetElement(path, GDCM_DICOMDIR_IMAGE, *it);
1004 patPrevName = patCurName;
1005 patPrevID = patCurID;
1006 studPrevInstanceUID = studCurInstanceUID;
1007 studPrevID = studCurID;
1008 serPrevInstanceUID = serCurInstanceUID;
1009 serPrevID = serCurID;
1016 * \brief Move the content of the src SQItem to the dst SQItem
1017 * Only DocEntry's are moved
1020 void DicomDir::MoveSQItem(SQItem* dst,SQItem *src)
1025 entry = src->GetNextEntry();
1028 src->RemoveEntryNoDestroy(entry);
1029 dst->AddEntry(entry);
1032 entry = src->GetNextEntry();
1038 * \brief compares two dgcmHeaders
1040 bool DicomDir::HeaderLessThan(Document *header1, Document *header2)
1042 return *header1 < *header2;
1044 } // end namespace gdcm
1046 //-----------------------------------------------------------------------------