1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
6 Date: $Date: 2004/10/12 04:35:45 $
7 Version: $Revision: 1.14 $
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 "gdcmDicomDirStudy.h"
20 #include "gdcmDicomDirElement.h"
21 #include "gdcmGlobal.h"
26 //-----------------------------------------------------------------------------
27 // Constructor / Destructor
30 * \ingroup DicomDirStudy
32 * @param s SQ Item holding the elements related to this "STUDY" part
33 * @param ptagHT pointer to the HTable (DicomDirObject needs it
34 * to build the HeaderEntries)
36 DicomDirStudy::DicomDirStudy(SQItem* s, TagDocEntryHT* ptagHT):
37 DicomDirObject(ptagHT)
39 docEntries = s->GetDocEntries();
42 * \ingroup DicomDirStudy
44 * @param ptagHT pointer to the HTable (DicomDirObject needs it
45 * to build the HeaderEntries)
47 DicomDirStudy::DicomDirStudy(TagDocEntryHT* ptagHT):
48 DicomDirObject(ptagHT)
52 * \ingroup DicomDirStudy
53 * \brief Canonical destructor.
55 DicomDirStudy::~DicomDirStudy()
57 for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
63 //-----------------------------------------------------------------------------
66 * \ingroup DicomDirStudy
67 * \brief Prints the Object
70 void DicomDirStudy::Print(std::ostream& os)
72 os << "STUDY" << std::endl;
73 DicomDirObject::Print(os);
75 for(ListDicomDirSerie::iterator cc = series.begin();
79 (*cc)->SetPrintLevel(PrintLevel);
84 //-----------------------------------------------------------------------------
88 * \brief Writes the Object
91 void DicomDirStudy::Write(FILE* fp, FileType t)
93 DicomDirObject::Write(fp, t);
95 for(ListDicomDirSerie::iterator cc = series.begin();cc!=series.end();++cc)
97 (*cc)->Write( fp, t );
102 * \ingroup DicomDirStudy
103 * \brief adds a new Serie at the begining of the SerieList
104 * of a partially created DICOMDIR
106 DicomDirSerie* DicomDirStudy::NewSerie()
108 std::list<Element> elemList =
109 Global::GetDicomDirElements()->GetDicomDirSerieElements();
111 DicomDirSerie* st = new DicomDirSerie(PtagHT);
112 FillObject(elemList);
113 series.push_front(st);
117 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 } // end namespace gdcm