2 //-----------------------------------------------------------------------------
3 #include "gdcmObject.h"
4 #include "gdcmGlobal.h"
6 #include "gdcmValEntry.h"
8 //-----------------------------------------------------------------------------
13 * @param ptagHT pointer to the HTable (gdcmObject needs it
14 * to build the gdcmDocEntries)
15 * @param depth Seaquence depth level
18 gdcmObject::gdcmObject(TagDocEntryHT *ptagHT, int depth)
19 : gdcmSQItem (depth) {
20 this->ptagHT = ptagHT;
26 * \brief Canonical destructor.
28 gdcmObject::~gdcmObject(void) {
33 //-----------------------------------------------------------------------------
39 * \brief Builds a hash table (multimap) containing
40 * pointers to all Header Entries (i.e Dicom Element)
41 * related to this 'object'
44 TagDocEntryHT gdcmObject::GetEntry(void) {
46 docEntries=GetDocEntries();
47 for(ListDocEntry::iterator i=docEntries.begin();i!=docEntries.end();++i) {
48 HT[(*i)->GetKey()]=*i;
55 * \brief Builds a Chained List containing
56 * pointers to all Header Entries (i.e Dicom Element)
57 * related to this 'object'
61 // FIXME : what was it used for ?!?
63 ListTag gdcmObject::GetListEntry(void) {
64 return(GetDocEntries());
68 //-----------------------------------------------------------------------------
72 * \brief add the 'Object' related Dicom Elements to the listEntries
73 * of a partially created DICOMDIR
75 void gdcmObject::FillObject(std::list<gdcmElement> elemList) {
77 // FillObject rempli le SQItem qui sera accroche au bon endroit
79 std::list<gdcmElement>::iterator it;
81 gdcmDictEntry *dictEntry;
84 //gdcmSQItem *s = new gdcmSQItem;
86 // for all the Elements found in they own part of the DicomDir dict.
87 for(it=elemList.begin();it!=elemList.end();++it)
91 dictEntry=gdcmGlobal::GetDicts()->GetDefaultPubDict()->GetDictEntryByNumber(tmpGr,tmpEl);
92 entry=new gdcmValEntry(dictEntry);
93 entry->SetOffset(0); // just to avoid further missprinting
94 entry->SetValue(it->value);
96 // dealing with value length ...
98 if(dictEntry->GetGroup()==0xfffe)
100 entry->SetLength(entry->GetValue().length());
102 else if( (dictEntry->GetVR()=="UL") || (dictEntry->GetVR()=="SL") )
106 else if( (dictEntry->GetVR()=="US") || (dictEntry->GetVR()=="SS") )
110 else if(dictEntry->GetVR()=="SQ")
112 entry->SetLength(0xffffffff);
116 entry->SetLength(entry->GetValue().length());
118 //docEntries->insert(debInsertion ,entry); // ??? // add at the begining of the Patient list
122 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------