1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
6 Date: $Date: 2005/01/25 15:44:23 $
7 Version: $Revision: 1.35 $
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()
52 //-----------------------------------------------------------------------------
55 * \brief Prints the Object
56 * @param os ostream to write to
57 * @param indent Indentation string to be prepended during printing
59 void DicomDirSerie::Print(std::ostream &os, std::string const &)
61 os << "SERIE" << std::endl;
62 DicomDirObject::Print(os);
64 for(ListDicomDirImage::iterator cc = Images.begin();
68 (*cc)->SetPrintLevel(PrintLevel);
73 //-----------------------------------------------------------------------------
76 * \brief Writes the Object
77 * @param fp ofstream to write to
78 * @param t Type of the File (explicit VR, implicitVR, ...)
80 void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t)
82 DicomDirObject::WriteContent(fp, t);
84 for(ListDicomDirImage::iterator cc = Images.begin();
88 (*cc)->WriteContent( fp, t );
93 * \brief adds a new Image (with the basic elements) to a partially created
96 DicomDirImage *DicomDirSerie::NewImage()
98 DicomDirImage *st = new DicomDirImage();
104 * \brief Remove all images in the serie
106 void DicomDirSerie::ClearImage()
108 for(ListDicomDirImage::iterator cc = Images.begin();
118 * \brief Get the first entry while visiting the DicomDirImage
119 * \return The first DicomDirImage if found, otherwhise NULL
121 DicomDirImage *DicomDirSerie::GetFirstImage()
123 ItImage = Images.begin();
124 if (ItImage != Images.end())
130 * \brief Get the next entry while visiting the DicomDirImages
131 * \note : meaningfull only if GetFirstEntry already called
132 * \return The next DicomDirImages if found, otherwhise NULL
134 DicomDirImage *DicomDirSerie::GetNextImage()
136 gdcmAssertMacro (ItImage != Images.end());
139 if (ItImage != Images.end())
145 * \brief Get the first entry while visiting the DicomDirImage
146 * \return The first DicomDirImage if found, otherwhise NULL
148 DicomDirImage *DicomDirSerie::GetLastImage()
150 ItImage = Images.end();
151 if (ItImage != Images.begin())
159 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
166 } // end namespace gdcm