1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
6 Date: $Date: 2004/10/25 04:08:20 $
7 Version: $Revision: 1.20 $
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 "gdcmGlobal.h"
26 //-----------------------------------------------------------------------------
27 // Constructor / Destructor
30 * @param s SQ Item holding the elements related to this "SERIE" part
31 * @param ptagHT pointer to the HTable (DicomDirObject needs it
32 * to build the DocEntries)
34 DicomDirSerie::DicomDirSerie(SQItem* s, TagDocEntryHT* ptagHT) :
35 DicomDirObject(ptagHT)
37 DocEntries = s->GetDocEntries();
42 * @param ptagHT pointer to the HTable (DicomDirObject needs it
43 * to build the DocEntries)
45 DicomDirSerie::DicomDirSerie(TagDocEntryHT* ptagHT):
46 DicomDirObject(ptagHT)
50 * \brief Canonical destructor.
52 DicomDirSerie::~DicomDirSerie()
54 for(ListDicomDirImage::iterator cc = Images.begin();
62 //-----------------------------------------------------------------------------
65 * \brief Prints the Object
68 void DicomDirSerie::Print(std::ostream& os)
70 os << "SERIE" << std::endl;
71 DicomDirObject::Print(os);
73 for(ListDicomDirImage::iterator cc = Images.begin();
77 (*cc)->SetPrintLevel(PrintLevel);
82 //-----------------------------------------------------------------------------
86 * \brief Writes the Object
89 void DicomDirSerie::Write(std::ofstream* fp, FileType t)
91 DicomDirObject::Write(fp, t);
93 for(ListDicomDirImage::iterator cc = Images.begin();
97 (*cc)->Write( fp, t );
102 * \brief adds a new Image (with the basic elements) to a partially created DICOMDIR
104 DicomDirImage* DicomDirSerie::NewImage()
106 ListDicomDirImageElem const & elemList =
107 Global::GetDicomDirElements()->GetDicomDirImageElements();
109 DicomDirImage* st = new DicomDirImage(PtagHT);
110 FillObject(elemList);
111 Images.push_front(st);
115 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 } // end namespace gdcm