]> Creatis software - gdcm.git/commitdiff
Add class DicomDirPrivate, for dealing with SERIE/PRIVATE
authorjpr <jpr>
Mon, 26 Mar 2007 13:32:54 +0000 (13:32 +0000)
committerjpr <jpr>
Mon, 26 Mar 2007 13:32:54 +0000 (13:32 +0000)
(mainly used, rigth now, for SIEMENS 'CSA non image')

src/gdcmDicomDirPrivate.cxx [new file with mode: 0755]
src/gdcmDicomDirPrivate.h [new file with mode: 0755]

diff --git a/src/gdcmDicomDirPrivate.cxx b/src/gdcmDicomDirPrivate.cxx
new file mode 100755 (executable)
index 0000000..ae7305d
--- /dev/null
@@ -0,0 +1,86 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmDicomDirPrivate.cxx,v $
+  Language:  C++
+  Date:      $Date: 2007/03/26 13:32:54 $
+  Version:   $Revision: 1.1 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+
+#include "gdcmDicomDirPrivate.h"
+#include "gdcmGlobal.h"
+#include "gdcmDataEntry.h"
+
+namespace gdcm 
+{
+//-----------------------------------------------------------------------------
+// Constructor / Destructor
+/**
+ * \brief  Constructor 
+ * \note End user must use : DicomDirSerie::NewPrivate()
+ */
+DicomDirPrivate::DicomDirPrivate(bool empty):
+   DicomDirObject()
+{
+   if ( !empty )
+   {
+      ListDicomDirPrivateElem const &elemList = 
+         Global::GetDicomDirElements()->GetDicomDirPrivateElements();
+      FillObject(elemList);
+   }
+}
+
+/**
+ * \brief   Canonical destructor.
+ */
+DicomDirPrivate::~DicomDirPrivate() 
+{
+}
+
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief   Prints the Object
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ * @return
+ */ 
+void DicomDirPrivate::Print(std::ostream &os, std::string const & )
+{
+   os << "PRIVATE : ";
+   for(ListDocEntry::iterator i = DocEntries.begin();
+                              i!= DocEntries.end();
+                              ++i)
+   {
+      if ( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
+      {
+         if( dynamic_cast<DataEntry *>(*i) )
+            os << (dynamic_cast<DataEntry *>(*i))->GetString();
+      }
+   }
+   os << std::endl;
+
+   DicomDirObject::Print(os);
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
+
diff --git a/src/gdcmDicomDirPrivate.h b/src/gdcmDicomDirPrivate.h
new file mode 100755 (executable)
index 0000000..11f57a4
--- /dev/null
@@ -0,0 +1,48 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmDicomDirPrivate.h,v $
+  Language:  C++
+  Date:      $Date: 2007/03/26 13:32:54 $
+  Version:   $Revision: 1.1 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+
+#ifndef GDCMDICOMDIRPRIVATE_H
+#define GDCMDICOMDIRPRIVATE_H
+
+#include "gdcmDicomDirObject.h"
+
+namespace gdcm 
+{
+
+/**
+ * \brief   describes a PRIVATE  within a within a SERIE
+ * (DicomDirSerie) of a given DICOMDIR (DicomDir)
+ */
+class GDCM_EXPORT DicomDirPrivate : public DicomDirObject 
+{
+   gdcmTypeMacro(DicomDirPrivate);
+
+public:
+/// \brief Constructs a DicomDirPrivate with a RefCounter
+   static DicomDirPrivate *New(bool empty=false) {return new DicomDirPrivate(empty);}
+
+   void Print( std::ostream &os = std::cout, std::string const &indent = "" );
+  // void WriteContent( std::ofstream *fp, FileType t );
+
+protected:
+   DicomDirPrivate(bool empty=false); 
+   ~DicomDirPrivate();
+};
+} // end namespace gdcm
+//-----------------------------------------------------------------------------
+#endif