1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
6 Date: $Date: 2005/01/17 10:59:52 $
7 Version: $Revision: 1.24 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #include "gdcmDicomDirStudy.h"
20 #include "gdcmDicomDirElement.h"
21 #include "gdcmGlobal.h"
22 #include "gdcmDicomDirSerie.h"
26 //-----------------------------------------------------------------------------
27 // Constructor / Destructor
31 DicomDirStudy::DicomDirStudy():
36 * \ingroup DicomDirStudy
37 * \brief Canonical destructor.
39 DicomDirStudy::~DicomDirStudy()
41 for(ListDicomDirSerie::iterator cc = Series.begin();
49 //-----------------------------------------------------------------------------
52 * \brief Prints the Object
53 * @param os ostream to write to
56 void DicomDirStudy::Print(std::ostream &os, std::string const & )
58 os << "STUDY" << std::endl;
59 DicomDirObject::Print(os);
61 for(ListDicomDirSerie::iterator cc = Series.begin();
65 (*cc)->SetPrintLevel(PrintLevel);
70 //-----------------------------------------------------------------------------
74 * \brief Writes the Object
75 * @param fp ofstream to write to
76 * @param t Type of the File (explicit VR, implicitVR, ...)
79 void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t)
81 DicomDirObject::WriteContent(fp, t);
83 for(ListDicomDirSerie::iterator cc = Series.begin();
87 (*cc)->WriteContent( fp, t );
92 * \brief adds a new Serie at the begining of the SerieList
93 * of a partially created DICOMDIR
95 DicomDirSerie *DicomDirStudy::NewSerie()
97 ListDicomDirSerieElem const &elemList =
98 Global::GetDicomDirElements()->GetDicomDirSerieElements();
100 DicomDirSerie* st = new DicomDirSerie();
101 FillObject(elemList);
102 Series.push_front(st);
108 * \brief Initialise the visit of the Series
110 void DicomDirStudy::InitTraversal()
112 ItDicomDirSerie = Series.begin();
116 * \brief Get the next entry while visiting the DicomDirSeries
117 * \return The next DicomDirSeries if found, otherwhise NULL
119 DicomDirSerie *DicomDirStudy::GetNextEntry()
121 if (ItDicomDirSerie != Series.end())
123 DicomDirSerie *tmp = *ItDicomDirSerie;
132 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
138 //-----------------------------------------------------------------------------
139 } // end namespace gdcm