1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
6 Date: $Date: 2004/10/25 04:08:20 $
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 "gdcmDicomDirStudy.h"
20 #include "gdcmDicomDirElement.h"
21 #include "gdcmGlobal.h"
25 //-----------------------------------------------------------------------------
26 // Constructor / Destructor
29 * \ingroup DicomDirStudy
31 * @param s SQ Item holding the elements related to this "STUDY" part
32 * @param ptagHT pointer to the HTable (DicomDirObject needs it
33 * to build the HeaderEntries)
35 DicomDirStudy::DicomDirStudy(SQItem* s, TagDocEntryHT* ptagHT):
36 DicomDirObject(ptagHT)
38 DocEntries = s->GetDocEntries();
41 * \ingroup DicomDirStudy
43 * @param ptagHT pointer to the HTable (DicomDirObject needs it
44 * to build the HeaderEntries)
46 DicomDirStudy::DicomDirStudy(TagDocEntryHT* ptagHT):
47 DicomDirObject(ptagHT)
51 * \ingroup DicomDirStudy
52 * \brief Canonical destructor.
54 DicomDirStudy::~DicomDirStudy()
56 for(ListDicomDirSerie::iterator cc = Series.begin();
64 //-----------------------------------------------------------------------------
67 * \ingroup DicomDirStudy
68 * \brief Prints the Object
71 void DicomDirStudy::Print(std::ostream& os)
73 os << "STUDY" << std::endl;
74 DicomDirObject::Print(os);
76 for(ListDicomDirSerie::iterator cc = Series.begin();
80 (*cc)->SetPrintLevel(PrintLevel);
85 //-----------------------------------------------------------------------------
89 * \brief Writes the Object
92 void DicomDirStudy::Write(std::ofstream* fp, FileType t)
94 DicomDirObject::Write(fp, t);
96 for(ListDicomDirSerie::iterator cc = Series.begin();
100 (*cc)->Write( fp, t );
105 * \ingroup DicomDirStudy
106 * \brief adds a new Serie at the begining of the SerieList
107 * of a partially created DICOMDIR
109 DicomDirSerie* DicomDirStudy::NewSerie()
111 ListDicomDirSerieElem const & elemList =
112 Global::GetDicomDirElements()->GetDicomDirSerieElements();
114 DicomDirSerie* st = new DicomDirSerie(PtagHT);
115 FillObject(elemList);
116 Series.push_front(st);
120 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
126 //-----------------------------------------------------------------------------
127 } // end namespace gdcm