1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
6 Date: $Date: 2005/01/23 10:12:33 $
7 Version: $Revision: 1.33 $
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 "gdcmDicomDirSerie.h"
20 #include "gdcmDicomDirElement.h"
21 #include "gdcmDicomDirImage.h"
22 #include "gdcmGlobal.h"
23 #include "gdcmDebug.h"
28 //-----------------------------------------------------------------------------
29 // Constructor / Destructor
33 DicomDirSerie::DicomDirSerie(bool empty):
38 ListDicomDirSerieElem const &elemList =
39 Global::GetDicomDirElements()->GetDicomDirSerieElements();
45 * \brief Canonical destructor.
47 DicomDirSerie::~DicomDirSerie()
49 for(ListDicomDirImage::iterator cc = Images.begin();
57 //-----------------------------------------------------------------------------
60 * \brief Prints the Object
61 * @param os ostream to write to
62 * @param indent Indentation string to be prepended during printing
64 void DicomDirSerie::Print(std::ostream &os, std::string const &)
66 os << "SERIE" << std::endl;
67 DicomDirObject::Print(os);
69 for(ListDicomDirImage::iterator cc = Images.begin();
73 (*cc)->SetPrintLevel(PrintLevel);
78 //-----------------------------------------------------------------------------
81 * \brief Writes the Object
82 * @param fp ofstream to write to
83 * @param t Type of the File (explicit VR, implicitVR, ...)
85 void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t)
87 DicomDirObject::WriteContent(fp, t);
89 for(ListDicomDirImage::iterator cc = Images.begin();
93 (*cc)->WriteContent( fp, t );
98 * \brief adds a new Image (with the basic elements) to a partially created DICOMDIR
100 DicomDirImage *DicomDirSerie::NewImage()
102 DicomDirImage *st = new DicomDirImage();
103 Images.push_back(st);
108 * \brief Get the first entry while visiting the DicomDirImage
109 * \return The first DicomDirImage if found, otherwhise NULL
111 DicomDirImage *DicomDirSerie::GetFirstImage()
113 ItImage = Images.begin();
114 if (ItImage != Images.end())
120 * \brief Get the next entry while visiting the DicomDirImages
121 * \note : meaningfull only if GetFirstEntry already called
122 * \return The next DicomDirImages if found, otherwhise NULL
124 DicomDirImage *DicomDirSerie::GetNextImage()
126 gdcmAssertMacro (ItImage != Images.end());
129 if (ItImage != Images.end())
136 * \brief Get the first entry while visiting the DicomDirImage
137 * \return The first DicomDirImage if found, otherwhise NULL
139 DicomDirImage *DicomDirSerie::GetLastImage()
141 ItImage = Images.end();
142 if (ItImage != Images.begin())
150 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 } // end namespace gdcm