1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
6 Date: $Date: 2004/10/12 04:35:45 $
7 Version: $Revision: 1.17 $
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(FILE* fp, FileType t)
91 DicomDirObject::Write(fp, t);
93 for(ListDicomDirImage::iterator cc = images.begin();cc!=images.end();++cc)
95 (*cc)->Write( fp, t );
100 * \brief adds a new Image (with the basic elements) to a partially created DICOMDIR
102 DicomDirImage* DicomDirSerie::NewImage()
104 std::list<Element> elemList =
105 Global::GetDicomDirElements()->GetDicomDirImageElements();
107 DicomDirImage* st = new DicomDirImage(PtagHT);
108 FillObject(elemList);
109 images.push_front(st);
113 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 } // end namespace gdcm