1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
6 Date: $Date: 2004/09/23 10:47:10 $
7 Version: $Revision: 1.11 $
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.htm 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 //-----------------------------------------------------------------------------
23 // Constructor / Destructor
26 * \ingroup gdcmDicomDirStudy
28 * @param s SQ Item holding the elements related to this "STUDY" part
29 * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
30 * to build the gdcmHeaderEntries)
32 gdcmDicomDirStudy::gdcmDicomDirStudy(gdcmSQItem *s, TagDocEntryHT *ptagHT):
33 gdcmDicomDirObject(ptagHT)
35 docEntries = s->GetDocEntries();
38 * \ingroup gdcmDicomDirStudy
40 * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it
41 * to build the gdcmHeaderEntries)
43 gdcmDicomDirStudy::gdcmDicomDirStudy(TagDocEntryHT *ptagHT):
44 gdcmDicomDirObject(ptagHT)
48 * \ingroup gdcmDicomDirStudy
49 * \brief Canonical destructor.
51 gdcmDicomDirStudy::~gdcmDicomDirStudy()
53 for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
59 //-----------------------------------------------------------------------------
62 * \ingroup gdcmDicomDirStudy
63 * \brief Prints the Object
66 void gdcmDicomDirStudy::Print(std::ostream &os)
68 os << "STUDY" << std::endl;
69 gdcmDicomDirObject::Print(os);
71 for(ListDicomDirSerie::iterator cc = series.begin();
75 (*cc)->SetPrintLevel(PrintLevel);
80 //-----------------------------------------------------------------------------
84 * \brief Writes the Object
87 void gdcmDicomDirStudy::Write(FILE *fp, FileType t)
89 gdcmDicomDirObject::Write(fp, t);
91 for(ListDicomDirSerie::iterator cc = series.begin();cc!=series.end();++cc)
93 (*cc)->Write( fp, t );
98 * \ingroup gdcmDicomStudy
99 * \brief adds a new Serie at the begining of the SerieList
100 * of a partially created DICOMDIR
102 gdcmDicomDirSerie * gdcmDicomDirStudy::NewSerie()
104 std::list<gdcmElement> elemList =
105 gdcmGlobal::GetDicomDirElements()->GetDicomDirSerieElements();
107 gdcmDicomDirSerie *st = new gdcmDicomDirSerie(PtagHT);
108 FillObject(elemList);
109 series.push_front(st);
113 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------