1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirObject.cxx,v $
6 Date: $Date: 2004/12/07 13:39:33 $
7 Version: $Revision: 1.12 $
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 "gdcmDicomDirObject.h"
20 #include "gdcmGlobal.h"
21 #include "gdcmDebug.h"
22 #include "gdcmValEntry.h"
23 #include "gdcmDictSet.h"
28 //-----------------------------------------------------------------------------
30 * \ingroup DicomDirObject
33 * @param ptagHT pointer to the HTable (DicomDirObject needs it
34 * to build the DocEntries)
35 * @param depth Sequence depth level
38 DicomDirObject::DicomDirObject(int depth)
45 * \ingroup DicomDirObject
46 * \brief Canonical destructor.
48 DicomDirObject::~DicomDirObject()
54 //-----------------------------------------------------------------------------
59 * \ingroup DicomDirObject
60 * \brief Builds a hash table (multimap) containing
61 * pointers to all Header Entries (i.e Dicom Element)
62 * related to this 'object'
65 TagDocEntryHT DicomDirObject::GetEntry()
68 DocEntries = GetDocEntries();
69 for(ListDocEntry::iterator i = DocEntries.begin();
70 i != DocEntries.end(); ++i)
72 HT[(*i)->GetKey()] = *i;
77 //-----------------------------------------------------------------------------
80 * \brief add the 'Object' related Dicom Elements to the listEntries
81 * of a partially created DICOMDIR
83 void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList)
85 // FillObject rempli le SQItem qui sera accroche au bon endroit
87 ListDicomDirMetaElem::const_iterator it;
92 // for all the Elements found in they own part of the DicomDir dict.
93 for(it = elemList.begin(); it != elemList.end(); ++it)
97 dictEntry = Global::GetDicts()->GetDefaultPubDict()->GetDictEntryByNumber(tmpGr,tmpEl);
98 entry = new ValEntry(dictEntry);
99 entry->SetOffset(0); // just to avoid further missprinting
100 entry->SetValue(it->Value);
105 } // end namespace gdcm