]> Creatis software - gdcm.git/commitdiff
The following methods
authorjpr <jpr>
Thu, 20 Jan 2005 11:37:37 +0000 (11:37 +0000)
committerjpr <jpr>
Thu, 20 Jan 2005 11:37:37 +0000 (11:37 +0000)
>    DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
>    ValEntry *GetValEntry(uint16_t group, uint16_t elem);
>    BinEntry *GetBinEntry(uint16_t group, uint16_t elem);
>    SeqEntry *GetSeqEntry(uint16_t group, uint16_t elem);
now belong to gdcm:ElementSet class

src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmElementSet.cxx
src/gdcmElementSet.h

index 369dc0de68e9fc34118918c08056a17613dc37ae..bb3d81df1addaf1a83701eaae7d61b31a299731d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:26:17 $
-  Version:   $Revision: 1.202 $
+  Date:      $Date: 2005/01/20 11:37:37 $
+  Version:   $Revision: 1.203 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -928,94 +928,6 @@ void Document::LoadEntryBinArea(BinEntry *elem)
    return false;
 }*/
 
-/**
- * \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  
- */
-DocEntry *Document::GetDocEntry(uint16_t group, uint16_t elem) 
-{
-   TagKey key = DictEntry::TranslateToKey(group, elem);
-   if ( !TagHT.count(key))
-   {
-      return NULL;
-   }
-   return TagHT.find(key)->second;
-}
-
-/**
- * \brief  Same as \ref Document::GetDocEntry except it only
- *         returns a result when the corresponding entry is of type
- *         ValEntry.
- * @param   group  Group number of the searched Dicom Element 
- * @param   elem Element number of the searched Dicom Element  
- * @return When present, the corresponding ValEntry. 
- */
-ValEntry *Document::GetValEntry(uint16_t group, uint16_t elem)
-{
-   DocEntry *currentEntry = GetDocEntry(group, elem);
-   if ( !currentEntry )
-   {
-      return 0;
-   }
-   if ( ValEntry *entry = dynamic_cast<ValEntry*>(currentEntry) )
-   {
-      return entry;
-   }
-   gdcmVerboseMacro( "Unfound ValEntry.");
-
-   return 0;
-}
-
-/**
- * \brief  Same as \ref Document::GetDocEntry except it only
- *         returns a result when the corresponding entry is of type
- *         BinEntry.
- * @param   group  Group number of the searched Dicom Element 
- * @param   elem Element number of the searched Dicom Element  
- * @return When present, the corresponding BinEntry. 
- */
-BinEntry *Document::GetBinEntry(uint16_t group, uint16_t elem)
-{
-   DocEntry *currentEntry = GetDocEntry(group, elem);
-   if ( !currentEntry )
-   {
-      return 0;
-   }
-   if ( BinEntry *entry = dynamic_cast<BinEntry*>(currentEntry) )
-   {
-      return entry;
-   }
-   gdcmVerboseMacro( "Unfound BinEntry.");
-
-   return 0;
-}
-
-/**
- * \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
index d5ae4e04e80efc54e2521ed2737c21f17a831d1e..21d5558b380c20729cd8aed6147534b5f0f5ff97 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:07:07 $
-  Version:   $Revision: 1.93 $
+  Date:      $Date: 2005/01/20 11:37:37 $
+  Version:   $Revision: 1.94 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -86,10 +86,14 @@ public:
 
 // Content entries
 
+// Oops ! Python is gonna cry : 
+// 4 methods with same name and different parameters ...
+// Only C++ is aware!
+
    virtual bool SetEntry(std::string const &content,
-                         uint16_t group, uint16_t element);
+                         uint16_t group, uint16_t elem);
    virtual bool SetEntry(uint8_t *content, int lgth,
-                         uint16_t group, uint16_t element);
+                         uint16_t group, uint16_t elem);
    virtual bool SetEntry(std::string const &content, ValEntry *entry);
    virtual bool SetEntry(uint8_t *content, int lgth, BinEntry *entry);
 
@@ -99,11 +103,6 @@ public:
    virtual std::string GetEntryVR(uint16_t group, uint16_t elem);
    virtual int GetEntryLength(uint16_t group, uint16_t elem);
 
-   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,
                              TagName const &vr = GDCM_UNKNOWN);
index 44044e4f64da07765d8978fea65de7597a1cce73..cf778c42745d9a3faf69fe42030045ee36070c5d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/19 15:24:28 $
-  Version:   $Revision: 1.46 $
+  Date:      $Date: 2005/01/20 11:37:37 $
+  Version:   $Revision: 1.47 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -96,6 +96,96 @@ void ElementSet::WriteContent(std::ofstream *fp, FileType filetype)
    } 
 }
 
+
+/**
+ * \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  
+ */
+DocEntry *ElementSet::GetDocEntry(uint16_t group, uint16_t elem) 
+{
+   TagKey key = DictEntry::TranslateToKey(group, elem);
+   if ( !TagHT.count(key))
+   {
+      return NULL;
+   }
+   return TagHT.find(key)->second;
+}
+
+/**
+ * \brief  Same as \ref Document::GetDocEntry except it only
+ *         returns a result when the corresponding entry is of type
+ *         ValEntry.
+ * @param   group  Group number of the searched Dicom Element 
+ * @param   elem Element number of the searched Dicom Element  
+ * @return When present, the corresponding ValEntry. 
+ */
+ValEntry *ElementSet::GetValEntry(uint16_t group, uint16_t elem)
+{
+   DocEntry *currentEntry = GetDocEntry(group, elem);
+   if ( !currentEntry )
+   {
+      return 0;
+   }
+   if ( ValEntry *entry = dynamic_cast<ValEntry*>(currentEntry) )
+   {
+      return entry;
+   }
+   gdcmVerboseMacro( "Unfound ValEntry.");
+
+   return 0;
+}
+
+/**
+ * \brief  Same as \ref Document::GetDocEntry except it only
+ *         returns a result when the corresponding entry is of type
+ *         BinEntry.
+ * @param   group  Group number of the searched Dicom Element 
+ * @param   elem Element number of the searched Dicom Element  
+ * @return When present, the corresponding BinEntry. 
+ */
+BinEntry *ElementSet::GetBinEntry(uint16_t group, uint16_t elem)
+{
+   DocEntry *currentEntry = GetDocEntry(group, elem);
+   if ( !currentEntry )
+   {
+      return 0;
+   }
+   if ( BinEntry *entry = dynamic_cast<BinEntry*>(currentEntry) )
+   {
+      return entry;
+   }
+   gdcmVerboseMacro( "Unfound BinEntry.");
+
+   return 0;
+}
+
+/**
+ * \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 *ElementSet::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;
+}
+
+
 //-----------------------------------------------------------------------------
 // Protected
 
index 2b7cc0c97b9c7652392b6a88b3faa4facf77e8df..5622c19d00370215c9f9c80a53da8581427d9d88 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 18:03:17 $
-  Version:   $Revision: 1.33 $
+  Date:      $Date: 2005/01/20 11:37:37 $
+  Version:   $Revision: 1.34 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -58,6 +58,11 @@ public:
    DocEntry *GetFirstEntry();
    DocEntry *GetNextEntry();
 
+   DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
+   ValEntry *GetValEntry(uint16_t group, uint16_t elem);
+   BinEntry *GetBinEntry(uint16_t group, uint16_t elem);
+   SeqEntry *GetSeqEntry(uint16_t group, uint16_t elem);
+
 protected:
     
 private: