* ADD DicomDir, DicomDirPatient, DicomDirStudy, DicomDirSerie, DicomDirImage
related methods, in order not to expose internal mechanisms
InitTraversal();
GetNextEntry();
* REM methods that exposed internal mechanisms :
DicomDir::GetDicomDirPatients()
DicomDirPatient::GetDicomDirStudies()
DicomDirStudy::GetDicomDirSeries()
DicomDirSerie::GetDicomDirImages()
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.102 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ Version: $Revision: 1.103 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
return *header1 < *header2;
}
+
+/**
+ * \brief Initialise the visit of the DicomDirPatients of the DicomDir
+ */
+void DicomDir::InitTraversal()
+{
+ ItDicomDirPatient = Patients.begin();
+}
+
+/**
+ * \brief Get the next entry while visiting the DicomDirPatients
+ * \return The next DicomDirPatient if found, otherwhise NULL
+ */
+DicomDirPatient *DicomDir::GetNextEntry()
+{
+ if (ItDicomDirPatient != Patients.end())
+ {
+ DicomDirPatient *tmp = *ItDicomDirPatient;
+ ++ItDicomDirPatient;
+ return tmp;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ 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
/// Returns a pointer to the DicomDirMeta for this DICOMDIR.
DicomDirMeta* GetDicomDirMeta() { return MetaElems; };
- /// Returns the PATIENT chained List for this DICOMDIR.
- ListDicomDirPatient const & GetDicomDirPatients() const { return Patients; };
+ // should avoid exposing internal mechanism
+ void InitTraversal();
+ DicomDirPatient *GetNextEntry();
/// Parsing
void ParseDirectory();
/// Pointer on *the* DicomDirObject 'DicomDirMeta Elements'
DicomDirMeta* MetaElems;
+ ListDicomDirPatient::iterator ItDicomDirPatient;
/// Chained list of DicomDirPatient (to be exploited recursively)
ListDicomDirPatient Patients;
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return st;
}
+/**
+ * \brief Initialise the visit of the DicomDirPatients
+ */
+void DicomDirPatient::InitTraversal()
+{
+ ItDicomDirStudy = Studies.begin();
+}
+
+/**
+ * \brief Get the next entry while visiting the DicomDirStudies
+ * \return The next DicomDirStudies if found, otherwhise NULL
+ */
+DicomDirStudy *DicomDirPatient::GetNextEntry()
+{
+ if (ItDicomDirStudy != Studies.end())
+ {
+ DicomDirStudy *tmp = *ItDicomDirStudy;
+ ++ItDicomDirStudy;
+ return tmp;
+ }
+ else
+ {
+ return NULL;
+ }
+}
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
/**
- * \ingroup DicomDirPatient
* \brief describes a PATIENT within a DICOMDIR (DicomDir)
*/
void Print(std::ostream &os = std::cout, std::string const & indent = "" );
void WriteContent(std::ofstream *fp, FileType t);
+ // TODO Remove GetDicomDirStudies
+ // use InitTraversal + GetNextEntry instead.
+
/// Returns the STUDY chained List for this PATIENT.
ListDicomDirStudy const &GetDicomDirStudies() const { return Studies; };
+ // should avoid exposing internal mechanism
+ void InitTraversal();
+ DicomDirStudy *GetNextEntry();
+
/// adds the passed STUDY to the STUDY chained List for this PATIENT.
void AddDicomDirStudy (DicomDirStudy *obj) { Studies.push_back(obj); };
- /// TODO
DicomDirStudy *NewStudy();
private:
- /// chained list of DicomDirStudy
+ /// chained list of DicomDirStudy (to be exploited recursively)
ListDicomDirStudy Studies;
+ /// iterator on the DicomDirStudies of the current DicomDirPatient
+ ListDicomDirStudy::iterator ItDicomDirStudy;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ 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
Images.push_front(st);
return st;
-}
+}
+
+/**
+ * \brief Initialise the visit of the Images
+ */
+void DicomDirSerie::InitTraversal()
+{
+ ItDicomDirImage = Images.begin();
+}
+
+/**
+ * \brief Get the next entry while visiting the DicomDirImages
+ * \return The next DicomDirImages if found, otherwhise NULL
+ */
+DicomDirImage *DicomDirSerie::GetNextEntry()
+{
+ if (ItDicomDirImage != Images.end())
+ {
+ DicomDirImage *tmp = *ItDicomDirImage;
+ ++ItDicomDirImage;
+ return tmp;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
/**
- * \ingroup DicomDirSerie
* \brief describes a SERIE within a within a STUDY
* (DicomDirStudy) of a given DICOMDIR (DicomDir)
*/
void Print( std::ostream &os = std::cout, std::string const & indent = "" );
void WriteContent( std::ofstream *fp, FileType t );
- /**
- * \ingroup DicomDirSerie
- * \brief returns the IMAGE chained List for this SERIE.
- */
+ // TODO Remove GetDicomDirImages
+ // use InitTraversal + GetNextEntry instead.
+
+ /// Returns the IMAGE chained List for this SERIE.
ListDicomDirImage const &GetDicomDirImages() const { return Images; };
- /**
- * \ingroup DicomDirSerie
- * \brief adds the passed IMAGE to the IMAGE chained List for this SERIE.
- */
+ // should avoid exposing internal mechanism
+ void InitTraversal();
+ DicomDirImage *GetNextEntry();
+
+ /// adds the passed IMAGE to the IMAGE chained List for this SERIE.
void AddDicomDirImage(DicomDirImage *obj) { Images.push_back(obj); };
-/**
- * \ingroup DicomDirSerie
- * \brief TODO
- */
DicomDirImage *NewImage();
-
+
private:
-/**
-* \brief chained list of DicomDirImages
-*/
+
+ ///chained list of DicomDirImages (to be exploited recursively)
ListDicomDirImage Images;
+ /// iterator on the DicomDirImages of the current DicomDirSerie
+ ListDicomDirImage::iterator ItDicomDirImage;
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Series.push_front(st);
return st;
-}
+}
+
+/**
+ * \brief Initialise the visit of the Series
+ */
+void DicomDirStudy::InitTraversal()
+{
+ ItDicomDirSerie = Series.begin();
+}
+
+/**
+ * \brief Get the next entry while visiting the DicomDirSeries
+ * \return The next DicomDirSeries if found, otherwhise NULL
+ */
+DicomDirSerie *DicomDirStudy::GetNextEntry()
+{
+ if (ItDicomDirSerie != Series.end())
+ {
+ DicomDirSerie *tmp = *ItDicomDirSerie;
+ ++ItDicomDirSerie;
+ return tmp;
+ }
+ else
+ {
+ return NULL;
+ }
+}
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/01/17 10:59:52 $
+ Version: $Revision: 1.18 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
/**
- * \ingroup DicomDirStudy
* \brief describes a STUDY within a within a PATIENT
* (DicomDirPatient) of a given DICOMDIR (DicomDir)
*/
void Print(std::ostream &os = std::cout, std::string const & indent = "" );
void WriteContent(std::ofstream *fp, FileType t);
- /**
- * \ingroup DicomDirStudy
- * \brief returns the SERIE chained List for this STUDY.
- */
+ // TODO Remove GetDicomDirSeries
+ // use InitTraversal + GetNextEntry instead.
+
+ /// Returns the SERIE chained List for this STUDY.
ListDicomDirSerie const &GetDicomDirSeries() const { return Series; };
- /**
- * \ingroup DicomDirStudy
- * \brief adds the passed SERIE to the SERIE chained List for this STUDY.
- */
+ // should avoid exposing internal mechanism
+ void InitTraversal();
+ DicomDirSerie *GetNextEntry();
+
+ /// adds the passed SERIE to the SERIE chained List for this STUDY.
void AddDicomDirSerie(DicomDirSerie *obj) { Series.push_back(obj); };
- /**
- * \ingroup DicomDirStudy
- * \brief TODO
- */
DicomDirSerie* NewSerie();
private:
-/**
-* \brief chained list of DicomDirSeries (to be exploited recursively)
-*/
+
+ /// chained list of DicomDirSeries (to be exploited recursively)
ListDicomDirSerie Series;
+ /// iterator on the DicomDirSeries of the current DicomDirStudy
+ ListDicomDirSerie::iterator ItDicomDirSerie;
+
};
} // end namespace gdcm