]> Creatis software - gdcm.git/commitdiff
Add missing Document::GetSeqEntry() method
authorjpr <jpr>
Tue, 18 Jan 2005 18:03:16 +0000 (18:03 +0000)
committerjpr <jpr>
Tue, 18 Jan 2005 18:03:16 +0000 (18:03 +0000)
src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmElementSet.h

index 12a0a05f9b7bd21bb42c445ab3c1392adba00e16..4adb7d947cdd844e3130db7fd7f217ce7b449da0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 16:23:52 $
-  Version:   $Revision: 1.197 $
+  Date:      $Date: 2005/01/18 18:03:16 $
+  Version:   $Revision: 1.198 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -923,11 +923,7 @@ void Document::LoadEntryBinArea(BinEntry *elem)
 }*/
 
 /**
- * \brief  retrieves a Dicom Element (the first one) using (group, element)
- * \warning (group, element) IS NOT an identifier inside the Dicom Header
- *           if you think it's NOT UNIQUE, check the count number
- *           and use iterators to retrieve ALL the Dicoms Elements within
- *           a given couple (group, element)
+ * \brief  retrieves a Dicom Element using (group, element)
  * @param   group  Group number of the searched Dicom Element 
  * @param   elem Element number of the searched Dicom Element 
  * @return  
@@ -991,9 +987,34 @@ BinEntry *Document::GetBinEntry(uint16_t group, uint16_t elem)
 }
 
 /**
- * \brief         Loads the element while preserving the current
- *               underlying file position indicator as opposed to
- *                to LoadDocEntry that modifies it.
+ * \brief  Same as \ref Document::GetDocEntry except it only
+ *         returns a result when the corresponding entry is of type
+ *         SeqEntry.
+ * @param   group  Group number of the searched Dicom Element 
+ * @param   elem Element number of the searched Dicom Element  
+ * @return When present, the corresponding SeqEntry. 
+ */
+SeqEntry *Document::GetSeqEntry(uint16_t group, uint16_t elem)
+{
+   DocEntry *currentEntry = GetDocEntry(group, elem);
+   if ( !currentEntry )
+   {
+      return 0;
+   }
+   if ( SeqEntry *entry = dynamic_cast<SeqEntry*>(currentEntry) )
+   {
+      return entry;
+   }
+   gdcmVerboseMacro( "Unfound SeqEntry.");
+
+   return 0;
+}
+
+
+/**
+ * \brief  Loads the element while preserving the current
+ *         underlying file position indicator as opposed to
+ *        LoadDocEntry that modifies it.
  * @param entry   Header Entry whose value will be loaded. 
  * @return  
  */
index 6b6376b05b4eb8fda0dfa3438a86aae7274f7a19..37d2f83eb8453328678a68a2b7fb70b6f166b480 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 16:23:52 $
-  Version:   $Revision: 1.90 $
+  Date:      $Date: 2005/01/18 18:03:17 $
+  Version:   $Revision: 1.91 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -102,6 +102,7 @@ public:
    DocEntry *GetDocEntry(uint16_t group, uint16_t element); 
    ValEntry *GetValEntry(uint16_t group, uint16_t element); 
    BinEntry *GetBinEntry(uint16_t group, uint16_t element); 
+   SeqEntry *GetSeqEntry(uint16_t group, uint16_t element); 
 
    ValEntry *ReplaceOrCreate(std::string const &value,
                              uint16_t group, uint16_t elem,
index 3bd508c7a757cfcf2dc67f362468c56164e10112..2b7cc0c97b9c7652392b6a88b3faa4facf77e8df 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 08:01:41 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2005/01/18 18:03:17 $
+  Version:   $Revision: 1.33 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -47,7 +47,7 @@ public:
    ElementSet(int);
    ~ElementSet();
 
-   virtual void Print(std::ostream &os = std::cout, std::string const & indent = "" ); 
+   virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" ); 
 
    bool AddEntry(DocEntry *Entry);
    bool RemoveEntry(DocEntry *EntryToRemove);
@@ -68,7 +68,7 @@ private:
    TagDocEntryHT::iterator ItTagHT; 
  
    friend class Document;
-   friend class DicomDir; //For accessing private TagHT
+   friend class DicomDir;        //For accessing private TagHT
    friend class DocEntryArchive; //For accessing private TagHT
 };
 } // end namespace gdcm