]> Creatis software - gdcm.git/blob - src/gdcmDicomDirSerie.cxx
* FIX now file names and directory name are written properly in the
[gdcm.git] / src / gdcmDicomDirSerie.cxx
1 // gdcmDicomDirSerie.cxx
2 //-----------------------------------------------------------------------------
3 #include "gdcmDicomDirSerie.h"
4 #include "gdcmDicomDirElement.h"
5 #include "gdcmUtil.h"
6 //-----------------------------------------------------------------------------
7 // Constructor / Destructor
8 /**
9  * \ingroup gdcmDicomDirSerie
10  * \brief   
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  * \ingroup gdcmDicomDirSerie
32  * \brief   Canonical destructor.
33  */
34 gdcmDicomDirSerie::~gdcmDicomDirSerie() 
35 {
36    for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc)
37    {
38       delete *cc;
39    }
40 }
41
42 //-----------------------------------------------------------------------------
43 // Print
44 /**
45  * \ingroup gdcmDicomDirSerie
46  * \brief   Prints the Object
47  * @return
48  */ 
49 void gdcmDicomDirSerie::Print(std::ostream &os)
50 {
51    os<<"SERIE"<<std::endl;
52    gdcmObject::Print(os);
53
54    for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc)
55    {
56       (*cc)->SetPrintLevel(printLevel);
57       (*cc)->Print(os);
58    }
59 }
60
61 //-----------------------------------------------------------------------------
62 // Public
63 /*
64  * \ingroup gdcmDicomSerie
65  * \brief   adds a new Image to a partially created DICOMDIR
66  */
67 gdcmDicomDirImage * gdcmDicomDirSerie::NewImage(void) {
68    std::list<gdcmElement> elemList;   
69    elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements();
70       
71    FillObject(elemList);
72    gdcmDicomDirImage *st = new gdcmDicomDirImage(i, j, ptagHT, plistEntries);
73    images.push_front(st);
74    return st;   
75
76 //-----------------------------------------------------------------------------
77 // Protected
78
79 //-----------------------------------------------------------------------------
80 // Private
81
82 //-----------------------------------------------------------------------------