]> Creatis software - gdcm.git/blobdiff - src/gdcmObject.cxx
Now the tree-like structure describing a DICOMDIR comming from an already
[gdcm.git] / src / gdcmObject.cxx
index debbfdd543160e55b1f4bf5580c643134af5db5f..a067e72b764e3a14f1e3f88af6c6e29287e3e98c 100644 (file)
@@ -85,6 +85,34 @@ std::string gdcmObject::GetEntryByName(TagName name)  {
    return GetEntryByNumber(dictEntry->GetGroup(),dictEntry->GetElement()); 
 }
 
+/**
+ * \ingroup gdcmObject
+ * \brief   Set the 'boundaries' gdcmObject (gdcmDicomDirPatient,
+ *          gdcmDicomDirStudy, gdcmDicomDirSerie, gdcmDicomDirImage)
+ *          comming for the parsing of a DICOMDIR file
+ * \warning NOT en user intended function
+ * @param  flag = 0 when META to be dealt with
+ */ 
+void gdcmObject::ResetBoundaries(int flag) {
+
+   if (flag) { // it's NOT a META
+     // upwards to fffe,e000   
+       for( i=j=debut();
+            ((*i)->GetGroup() != 0xfffe)  && ((*i)->GetElement() != 0x0000);
+           --i,j--) {      
+       }
+      beginObj=j;
+   }
+         
+  // downwards to fffe,e000       
+   for( i=j=fin();
+        ((*i)->GetGroup() != 0xfffe)  && ((*i)->GetElement() != 0x0000);
+       --i,j--) {          
+   }
+   j--;
+   endObj=j;    
+}
+
 /**
  * \ingroup gdcmParser
  * \brief   Sets Entry (Dicom Element) value of an element,
@@ -114,7 +142,7 @@ std::string gdcmObject::GetEntryByName(TagName name)  {
          if ( ! ptagHT->count(key)) {
           // we assume a Public Dictionnary *is* loaded
            gdcmDict *PubDict         = gdcmGlobal::GetDicts()->GetDefaultPubDict();
-           // if the invoqued (group,elem) doesn't exist inside the Dictionary
+           // if the invoked (group,elem) doesn't exist inside the Dictionary
           // we create a VirtualDictEntry
            gdcmDictEntry *DictEntry  = PubDict->GetDictEntryByNumber(group, element);
           if (DictEntry == NULL) {