]> Creatis software - gdcm.git/blob - src/gdcmDicomDirSerie.cxx
* src/gdcmUtil.[cxx|h] split in two. Additional file gdcmGlobal.[cxx|h]
[gdcm.git] / src / gdcmDicomDirSerie.cxx
1 // gdcmDicomDirSerie.cxx
2 //-----------------------------------------------------------------------------
3 #include "gdcmDicomDirSerie.h"
4 #include "gdcmDicomDirElement.h"
5 #include "gdcmGlobal.h"
6
7 //-----------------------------------------------------------------------------
8 // Constructor / Destructor
9 /**
10  * \brief  Constructor 
11  * @param  begin  iterator (inside the gdcmParser chained list)
12  *                on the first Header Entry (i.e Dicom Element)
13  *                related to this "SERIE" part
14  * @param  end  iterator  (inside the gdcmParser chained list)
15  *              on the last Header Entry (i.e Dicom Element) 
16  *              related to this 'SERIE' part
17  * @param ptagHT pointer to the HTable (gdcmObject needs it 
18  *               to build the gdcmHeaderEntries)
19  * @param plistEntries pointer to the chained List (gdcmObject needs it 
20  *               to build the gdcmHeaderEntries)
21  */
22 gdcmDicomDirSerie::gdcmDicomDirSerie(ListTag::iterator begin,
23                                      ListTag::iterator end,              
24                                      TagHeaderEntryHT *ptagHT, 
25                                      ListTag *plistEntries ):
26    gdcmObject(begin,end,ptagHT,plistEntries)
27 {
28 }
29
30 /**
31  * \brief   Canonical destructor.
32  */
33 gdcmDicomDirSerie::~gdcmDicomDirSerie() 
34 {
35    for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc)
36    {
37       delete *cc;
38    }
39 }
40
41 //-----------------------------------------------------------------------------
42 // Print
43 /**
44  * \brief   Prints the Object
45  * @return
46  */ 
47 void gdcmDicomDirSerie::Print(std::ostream &os)
48 {
49    os<<"SERIE"<<std::endl;
50    gdcmObject::Print(os);
51
52    for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc)
53    {
54       (*cc)->SetPrintLevel(printLevel);
55       (*cc)->Print(os);
56    }
57 }
58
59 //-----------------------------------------------------------------------------
60 // Public
61 /**
62  * \brief   adds a new Image to a partially created DICOMDIR
63  */
64 gdcmDicomDirImage * gdcmDicomDirSerie::NewImage(void) {
65    std::list<gdcmElement> elemList;   
66    elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements();
67       
68    FillObject(elemList);
69    gdcmDicomDirImage *st = new gdcmDicomDirImage(i, j, ptagHT, plistEntries);
70    images.push_front(st);
71    return st;   
72
73 //-----------------------------------------------------------------------------
74 // Protected
75
76 //-----------------------------------------------------------------------------
77 // Private
78
79 //-----------------------------------------------------------------------------