-// gdcmDicomDirElement.h
-//-----------------------------------------------------------------------------
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmDicomDirElement.h,v $
+ Language: C++
+ Date: $Date: 2006/04/11 16:03:26 $
+ Version: $Revision: 1.38 $
+
+ 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 GDCMDICOMDIRELEMENT_H
#define GDCMDICOMDIRELEMENT_H
-#include "gdcmCommon.h"
+#include "gdcmRefCounter.h"
+#include "gdcmVRKey.h"
#include <list>
-//-----------------------------------------------------------------------------
-typedef struct
+namespace gdcm
{
- /// DicomGroup number
- unsigned short int group;
- /// DicomElement number
- unsigned short int elem;
- /// value (coded as a std::string) of the Element
- std::string value;
-} gdcmElement;
-
-typedef std::list<gdcmElement> ListDicomDirMetaElem;
-typedef std::list<gdcmElement> ListDicomDirPatientElem;
-typedef std::list<gdcmElement> ListDicomDirStudyElem;
-typedef std::list<gdcmElement> ListDicomDirSerieElem;
-typedef std::list<gdcmElement> ListDicomDirImageElem;
+
+//-----------------------------------------------------------------------------
+
+typedef std::list<DicomElement> ListDicomDirElem;
+typedef std::list<DicomElement> ListDicomDirMetaElem;
+typedef std::list<DicomElement> ListDicomDirPatientElem;
+typedef std::list<DicomElement> ListDicomDirStudyElem;
+typedef std::list<DicomElement> ListDicomDirVisitElem;
+typedef std::list<DicomElement> ListDicomDirSerieElem;
+typedef std::list<DicomElement> ListDicomDirImageElem;
+
+// For future use (Full DICOMDIR)
+
+/*
+typedef std::list<DicomElement> ListDicomDirResultElem;
+typedef std::list<DicomElement> ListDicomDirStudyComponentElem;
+
+typedef std::list<DicomElement> ListDicomDirOverlayElem;
+typedef std::list<DicomElement> ListDicomDirModalityLutElem;
+typedef std::list<DicomElement> ListDicomDirModalityLutElem;
+typedef std::list<DicomElement> ListDicomDirCurveElem;
+typedef std::list<DicomElement> ListDicomDirStoredPrintElem;
+typedef std::list<DicomElement> ListDicomDirRtDoseElem;
+typedef std::list<DicomElement> ListDicomDirRtStructureSetElem;
+typedef std::list<DicomElement> ListDicomDirRtPlanElem;
+typedef std::list<DicomElement> ListDicomDirRtTreatRecordElem;
+typedef std::list<DicomElement> ListDicomDirPresentationElem;
+typedef std::list<DicomElement> ListDicomDirSrDocumentElem;
+typedef std::list<DicomElement> ListDicomDirKeyObjectDocElem;
+typedef std::list<DicomElement> ListDicomDirSpectroscopyElem;
+typedef std::list<DicomElement> ListDicomDirRawDataElem;
+typedef std::list<DicomElement> ListDicomDirRegistrationElem;
+typedef std::list<DicomElement> ListDicomDirFiducialElem;
+*/
//-----------------------------------------------------------------------------
/**
- * \ingroup gdcmDicomDirElement
- * \brief gdcmDicomDirElement represents elements contained in a dicom dir
- *
+ * \brief Represents elements contained in a DicomDir class
+ * for the chained lists from the file 'Dicts/DicomDir.dic'
*/
-class GDCM_EXPORT gdcmDicomDirElement
+class GDCM_EXPORT DicomDirElement : public RefCounter
{
+ gdcmTypeMacro(DicomDirElement);
+
public:
- gdcmDicomDirElement(void);
- ~gdcmDicomDirElement(void);
+/// \brief Contructs a DicomDirElement with a RefCounter
+ static DicomDirElement *New() {return new DicomDirElement();}
- /**
- * \ingroup gdcmParser
+ /**
* \brief canonical Printer
- * \sa SetPrintLevel
- */
- void Print(std::ostream &os);
-/**
- * \ingroup gdcmDicomDirElement
- * \brief returns a reference to the chained List
- * related to the META Elements of a DICOMDIR.
- */
- ListDicomDirMetaElem &GetDicomDirMetaElements(void)
- {return(DicomDirMetaList);};
-/**
- * \ingroup gdcmDicomDirElement
- * \brief returns a reference to the chained List
- * related to the PATIENT Elements of a DICOMDIR.
- */
- ListDicomDirPatientElem &GetDicomDirPatientElements(void)
- {return(DicomDirPatientList);};
-/**
- * \ingroup gdcmDicomDirElement
- * \brief returns a reference to the chained List
- * related to the STUDY Elements of a DICOMDIR.
- */
- ListDicomDirStudyElem &GetDicomDirStudyElements(void)
- {return(DicomDirStudyList);};
-/**
- * \ingroup gdcmDicomDirElement
- * \brief returns a reference to the chained List
- * related to the SERIE Elements of a DICOMDIR.
- */
- ListDicomDirSerieElem &GetDicomDirSerieElements(void)
- {return(DicomDirSerieList);};
-/**
- * \ingroup gdcmDicomDirElement
- * \brief returns a reference to the chained List
- * related to the IMAGE Elements of a DICOMDIR.
- */
- ListDicomDirImageElem &GetDicomDirImageElements(void)
- {return(DicomDirImageList);};
+ */
+ virtual void Print(std::ostream &os = std::cout,
+ std::string const &indent = "" );
+
+ /**
+ * \brief returns a reference to the chained List
+ * related to the META Elements of a DICOMDIR.
+ */
+ ListDicomDirMetaElem const &GetDicomDirMetaElements() const
+ { return DicomDirMetaList; }
+
+ /**
+ * \brief returns a reference to the chained List
+ * related to the PATIENT Elements of a DICOMDIR.
+ */
+ ListDicomDirPatientElem const &GetDicomDirPatientElements() const
+ { return DicomDirPatientList; }
+
+ /**
+ * \brief returns a reference to the chained List
+ * related to the STUDY Elements of a DICOMDIR.
+ */
+ ListDicomDirStudyElem const &GetDicomDirStudyElements() const
+ { return DicomDirStudyList; }
+
+ /**
+ * \brief returns a reference to the chained List
+ * related to the VISIT Elements of a DICOMDIR.
+ */
+ ListDicomDirVisitElem const &GetDicomDirVisitElements() const
+ { return DicomDirVisitList; }
+ /**
+ * \brief returns a reference to the chained List
+ * related to the SERIE Elements of a DICOMDIR.
+ */
+ ListDicomDirSerieElem const &GetDicomDirSerieElements() const
+ { return DicomDirSerieList; }
+
+ /**
+ * \brief returns a reference to the chained List
+ * related to the IMAGE Elements of a DICOMDIR.
+ */
+ ListDicomDirImageElem const &GetDicomDirImageElements() const
+ { return DicomDirImageList; }
+
+ // Public method to add an element
+ bool AddEntry(DicomDirType type, DicomElement const &elem);
+
+ // Only one instance of ddElem
+ void AddDicomDirElement(DicomDirType type,
+ uint16_t group, uint16_t elem, VRKey vr);
+
+protected:
+ DicomDirElement();
+ ~DicomDirElement();
private:
- /// gdcmElements chained list, related to the MetaElements of DICOMDIR
+ /// Elements chained list, related to the MetaElements of DICOMDIR
ListDicomDirMetaElem DicomDirMetaList;
- /// gdcmElements chained list, related to the PatientElements of DICOMDIR
+ /// Elements chained list, related to the PatientElements of DICOMDIR
ListDicomDirPatientElem DicomDirPatientList;
- /// gdcmElements chained list, related to the StudyElements of DICOMDIR
+ /// Elements chained list, related to the StudyElements of DICOMDIR
ListDicomDirStudyElem DicomDirStudyList;
- /// gdcmElements chained list, related to the SerieElements of DICOMDIR
+ /// Elements chained list, related to the VisitElements of DICOMDIR
+ ListDicomDirVisitElem DicomDirVisitList;
+ /// Elements chained list, related to the SerieElements of DICOMDIR
ListDicomDirSerieElem DicomDirSerieList;
- /// gdcmElements chained list, related to the ImageElements of DICOMDIR
-
+ /// Elements chained list, related to the ImageElements of DICOMDIR
ListDicomDirImageElem DicomDirImageList;
};
-
+} // end namespace gdcm
//-----------------------------------------------------------------------------
#endif