- return tagHT.find(key)->second;
-}
-
-/**
- * \brief retrieves the Dicom Elements (all of them) using (group, element)
- * @param group Group number of the searched Dicom Element.
- * @param element Element number of the searched Dicom Element.
- * @return a range (i.e.pair<,>) containing all elements whose key is group|element)
- */
-
-IterHT gdcmDocument::GetDocEntrySameNumber(guint16 group, guint16 element){
- TagKey key = gdcmDictEntry::TranslateToKey(group, element);
- return (tagHT.equal_range(key));
-}
-
-/**
- * \brief Loads the element while preserving the current
- * underlying file position indicator as opposed to
- * to LoadDocEntry that modifies it.
- * @param entry Header Entry whose value shall be loaded.
- * @return
- */
-void gdcmDocument::LoadDocEntrySafe(gdcmDocEntry * entry) {
- long PositionOnEntry = ftell(fp);
- LoadDocEntry(entry);
- fseek(fp, PositionOnEntry, SEEK_SET);
-}
-
-/**
- * \brief Re-computes the length of a ACR-NEMA/Dicom group from a DcmHeader
- * \warning : to be re-written using the chained list instead of the H table.
- * \warning : DO NOT use (doesn't work any longer because of the multimap)
- * \todo : to be re-written using the chained list instead of the H table
- * @param SkipSequence TRUE if we don't want to write Sequences (ACR-NEMA Files)
- * @param type Type of the File (ExplicitVR,ImplicitVR, ACR, ...)
- */
-
- /* Probabely useless, now !
-
-void gdcmDocument::UpdateGroupLength(bool SkipSequence, FileType type) {
- guint16 gr, el;
- std::string vr;
-
- gdcmDocEntry *elem;
- char trash[10];
- std::string str_trash;
-
- GroupKey key;
- GroupHT groupHt; // to hold the length of each group
- TagKey tk;
- // remember :
- // typedef std::map<GroupKey, int> GroupHT;
-
- gdcmDocEntry *elemZ;
-
- // for each Tag in the DCM Header
-
- for (TagDocEntryHT::iterator tag2 = tagHT.begin();
- tag2 != tagHT.end();
- ++tag2)
- {
- elem = tag2->second;
- gr = elem->GetGroup();
- el = elem->GetElement();
- vr = elem->GetVR();
-
- sprintf(trash, "%04x", gr);
- key = trash; // generate 'group tag'
-
- // if the caller decided not to take SEQUENCEs into account
- // e.g : he wants to write an ACR-NEMA File
-
- if (SkipSequence && vr == "SQ")
- continue;
-
- // Still unsolved problem :
- // we cannot find the 'Sequence Delimitation Item'
- // since it's at the end of the Hash Table
- // (fffe,e0dd)
-
- // there is SEQUENCE in ACR-NEMA
- // WARNING :
- // --> la descente a l'interieur' des SQ
- // devrait etre faite avec une liste chainee, pas avec une HTable...
-
- if ( groupHt.count(key) == 0) // we just read the first elem of a given group
- {
- if (el == 0x0000) // the first elem is 0x0000
- {
- groupHt[key] = 0; // initialize group length
- }
- else
- {
- groupHt[key] = 2 + 2 + 4 + elem->GetLength(); // non 0x0000 first group elem
- }
- }
- else // any elem but the first
- {
- if (type == ExplicitVR)
- {
- if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") )
- {
- groupHt[key] += 4; // explicit VR AND OB, OW, SQ : 4 more bytes
- }
- }
- groupHt[key] += 2 + 2 + 4 + elem->GetLength();
- }