gdcmDicomDirMeta.cxx
gdcmDicomDirObject.cxx
gdcmDicomDirPatient.cxx
+ gdcmDicomDirVisit.cxx
gdcmDicomDirSerie.cxx
gdcmDicomDirStudy.cxx
gdcmDict.cxx
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/07/08 10:13:38 $
- Version: $Revision: 1.145 $
+ Date: $Date: 2005/07/08 19:07:12 $
+ Version: $Revision: 1.146 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDir.h"
#include "gdcmDicomDirStudy.h"
#include "gdcmDicomDirSerie.h"
+#include "gdcmDicomDirVisit.h"
#include "gdcmDicomDirImage.h"
#include "gdcmDicomDirPatient.h"
#include "gdcmDicomDirMeta.h"
gdcmErrorMacro( "Add AddSerieToEnd failed");
}
}
+ else if ( v == "VISIT " )
+ {
+ si = new DicomDirVisit(true);
+ if ( !AddVisitToEnd( static_cast<DicomDirVisit *>(si)) )
+ {
+ delete si;
+ si = NULL;
+ gdcmErrorMacro( "Add AddVisitToEnd failed");
+ }
+ }
else if ( v == "STUDY " )
{
si = new DicomDirStudy(true);
return false;
}
+/**
+ * \brief AddVisitToEnd
+ * @param dd SQ Item to enqueue to the DicomDirVisit chained List
+ */
+bool DicomDir::AddVisitToEnd(DicomDirVisit *dd)
+{
+ if ( Patients.size() > 0 )
+ {
+ ListDicomDirPatient::iterator itp = Patients.end();
+ itp--;
+
+ DicomDirStudy *study = (*itp)->GetLastStudy();
+ if ( study )
+ {
+ study->AddVisit(dd);
+ return true;
+ }
+ }
+ return false;
+}
/**
* \brief AddImageToEnd
* @param dd SQ Item to enqueue to the DicomDirImage chained List
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2005/07/08 10:13:38 $
- Version: $Revision: 1.62 $
+ Date: $Date: 2005/07/08 19:07:12 $
+ Version: $Revision: 1.63 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class DicomDirElement;
class DicomDirStudy;
class DicomDirSerie;
+class DicomDirVisit;
class DicomDirImage;
class SQItem;
GDCM_DICOMDIR_PATIENT,
GDCM_DICOMDIR_STUDY,
GDCM_DICOMDIR_SERIE,
+ GDCM_DICOMDIR_VISIT,
GDCM_DICOMDIR_IMAGE
} DicomDirType;
bool AddPatientToEnd(DicomDirPatient *dd);
bool AddStudyToEnd (DicomDirStudy *dd);
bool AddSerieToEnd (DicomDirSerie *dd);
+ bool AddVisitToEnd (DicomDirVisit *dd);
bool AddImageToEnd (DicomDirImage *dd);
void SetElements(std::string const &path, VectDocument const &list);
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2005/02/11 15:22:18 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2005/07/08 19:07:12 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::list<Element> ListDicomDirImageElem;
// For future use (Full DICOMDIR)
+
+typedef std::list<Element> ListDicomDirVisitElem;
/*
-typedef std::list<Element> ListDicomDirVisit;
typedef std::list<Element> ListDicomDirResult;
typedef std::list<Element> ListDicomDirStudyComponent;
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.
ListDicomDirPatientElem DicomDirPatientList;
/// Elements chained list, related to the StudyElements of DICOMDIR
ListDicomDirStudyElem DicomDirStudyList;
+ /// Elements chained list, related to the VisitElements of DICOMDIR
+ ListDicomDirVisitElem DicomDirVisitList;
/// Elements chained list, related to the SerieElements of DICOMDIR
ListDicomDirSerieElem DicomDirSerieList;
/// Elements chained list, related to the ImageElements of DICOMDIR
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/06/24 10:55:58 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/07/08 19:07:12 $
+ 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
#include "gdcmDicomDirElement.h"
#include "gdcmGlobal.h"
#include "gdcmDicomDirSerie.h"
+#include "gdcmDicomDirVisit.h"
#include "gdcmDebug.h"
namespace gdcm
{
(*cc)->WriteContent( fp, t );
}
+
+ for(ListDicomDirVisit::iterator cc = Visits.begin();
+ cc!= Visits.end();
+ ++cc )
+ {
+ (*cc)->WriteContent( fp, t );
+ }
}
/**
return st;
}
+/**
+ * \brief adds a new Visit at the beginning of the VisitList
+ * of a partially created DICOMDIR
+ */
+DicomDirVisit *DicomDirStudy::NewVisit()
+{
+ DicomDirVisit *st = new DicomDirVisit();
+ Visits.push_back(st);
+ return st;
+}
+
/**
* \brief Remove all series in the study
*/
Series.clear();
}
+/**
+ * \brief Remove all visits in the study
+ */
+void DicomDirStudy::ClearVisit()
+{
+ for(ListDicomDirVisit::iterator cc = Visits.begin();
+ cc != Visits.end();
+ ++cc )
+ {
+ delete *cc;
+ }
+ Visits.clear();
+}
+
/**
* \brief Get the first entry while visiting the DicomDirSeries
* \return The first DicomDirSerie if found, otherwhise NULL
return NULL;
}
+/**
+ * \brief Get the first entry while visiting the DicomDirVisit
+ * \return The first DicomDirVisit if found, otherwhise NULL
+ */
+DicomDirVisit *DicomDirStudy::GetFirstVisit()
+{
+ ItVisit = Visits.begin();
+ if (ItVisit != Visits.end())
+ return *ItVisit;
+ return NULL;
+}
+
/**
* \brief Get the next entry while visiting the DicomDirSeries
* \note : meaningfull only if GetFirstEntry already called
return NULL;
}
+/**
+ * \brief Get the next entry while visiting the DicomDirVisit
+ * \note : meaningfull only if GetFirstEntry already called
+ * \return The next DicomDirVisit if found, otherwhise NULL
+ */
+DicomDirVisit *DicomDirStudy::GetNextVisit()
+{
+ gdcmAssertMacro (ItVisit != Visits.end());
+
+ ++ItVisit;
+ if (ItVisit != Visits.end())
+ return *ItVisit;
+ return NULL;
+}
+
/**
* \brief Get the last entry while visiting the DicomDirSeries
- * \return The first DicomDirSerie if found, otherwhise NULL
+ * \return The last DicomDirSerie if found, otherwhise NULL
*/
DicomDirSerie *DicomDirStudy::GetLastSerie()
{
return NULL;
}
+/**
+ * \brief Get the last entry while visiting the DicomDirVisit
+ * \return The last DicomDirVisit if found, otherwhise NULL
+ */
+DicomDirVisit *DicomDirStudy::GetLastVisit()
+{
+ ItVisit = Visits.end();
+ if (ItVisit != Visits.begin())
+ {
+ --ItVisit;
+ return *ItVisit;
+ }
+ return NULL;
+}
+
//-----------------------------------------------------------------------------
// Protected
(*cc)->SetPrintLevel(PrintLevel);
(*cc)->Print(os);
}
+
+ for(ListDicomDirVisit::iterator cc2 = Visits.begin();
+ cc2 != Visits.end();
+ ++cc2)
+ {
+ (*cc2)->SetPrintLevel(PrintLevel);
+ (*cc2)->Print(os);
+ }
+
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.h,v $
Language: C++
- Date: $Date: 2005/02/07 14:48:34 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/07/08 19:07:12 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
class DicomDirSerie;
+class DicomDirVisit;
//-----------------------------------------------------------------------------
typedef std::list<DicomDirSerie *> ListDicomDirSerie;
-/*
+
// For future use (Full DICOMDIR)
typedef std::list<DicomDirVisit *> ListDicomDirVisit;
+/*
typedef std::list<DicomDirResult *> ListDicomDirResult;
typedef std::list<DicomDirStudyComponent *> ListDicomDirStudyComponent;
-
*/
//-----------------------------------------------------------------------------
/**
DicomDirSerie *GetNextSerie();
DicomDirSerie *GetLastSerie();
-/*
+
// for future use (Full DICOMDIR)
+ DicomDirVisit *NewVisit();
+ void AddVisit(DicomDirVisit *obj) { Visits.push_back(obj); };
+ void ClearVisit();
DicomDirVisit *GetFirstVisit();
DicomDirVisit *GetNextVisit();
-
+ DicomDirVisit *GetLastVisit();
+/*
DicomDirResult *GetFirstResult();
DicomDirResult *GetNextResult();
+ DicomDirResult *GetLastResult();
DicomDirStudyComponent *GetFirstStudyComponent();
DicomDirStudyComponent *GetNextStudyComponent();
-
-*/
-
+ DicomDirStudyComponent *GetLastStudyComponent();
+*/
private:
/// chained list of DicomDirSeries (to be exploited hierarchicaly)
/// iterator on the DicomDirSeries of the current DicomDirStudy
ListDicomDirSerie::iterator ItSerie;
-/*
+
// for future use (Full DICOMDIR)
/// chained list of DicomDirVisits(single level)
ListDicomDirVisit Visits;
/// iterator on the DicomDirVisits of the current DicomDirStudy
ListDicomDirVisit::iterator ItVisit;
-
+/*
/// chained list of DicomDirResults(single level)
ListDicomDirResult Results;
/// iterator on the DicomDirResults of the current DicomDirStudy
--- /dev/null
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmDicomDirVisit.cxx,v $
+ Language: C++
+ Date: $Date: 2005/07/08 19:07:12 $
+ 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 "gdcmDicomDirVisit.h"
+#include "gdcmValEntry.h"
+#include "gdcmGlobal.h"
+
+namespace gdcm
+{
+//-----------------------------------------------------------------------------
+// Constructor / Destructor
+/**
+ * \brief Constructor
+ * \note End user must use : DicomDirStudy::NewVisit()
+ */
+DicomDirVisit::DicomDirVisit(bool empty):
+ DicomDirObject()
+{
+ if ( !empty )
+ {
+ ListDicomDirVisitElem const &elemList =
+ Global::GetDicomDirElements()->GetDicomDirVisitElements();
+ FillObject(elemList);
+ }
+}
+
+/**
+ * \brief Canonical destructor.
+ */
+DicomDirVisit::~DicomDirVisit()
+{
+}
+
+//-----------------------------------------------------------------------------
+// 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 DicomDirVisit::Print(std::ostream &os, std::string const & )
+{
+ os << "VISIT : ";
+ for(ListDocEntry::iterator i = DocEntries.begin();
+ i!= DocEntries.end();
+ ++i)
+ {
+ if ( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
+ {
+ os << (dynamic_cast<ValEntry *>(*i))->GetValue(); //FIXME // ????
+ }
+ }
+ os << std::endl;
+
+ DicomDirObject::Print(os);
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
+
--- /dev/null
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmDicomDirVisit.h,v $
+ Language: C++
+ Date: $Date: 2005/07/08 19:07:12 $
+ 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 GDCMDICOMDIRVISIT_H
+#define GDCMDICOMDIRVISIT_H
+
+#include "gdcmDicomDirObject.h"
+
+namespace gdcm
+{
+
+/**
+ * \brief describes a VISIT within a within a STUDY
+ * (DicomDirStudy) of a given DICOMDIR (DicomDir)
+ */
+class GDCM_EXPORT DicomDirVisit : public DicomDirObject
+{
+public:
+ DicomDirVisit(bool empty=false);
+ ~DicomDirVisit();
+
+ void Print( std::ostream &os = std::cout, std::string const &indent = "" );
+ // void WriteContent( std::ofstream *fp, FileType t );
+
+};
+} // end namespace gdcm
+//-----------------------------------------------------------------------------
+#endif