]> Creatis software - gdcm.git/blob - src/gdcmDicomDirObject.cxx
Fix mistypings
[gdcm.git] / src / gdcmDicomDirObject.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
5   Language:  C++
6   Date:      $Date: 2007/05/23 14:18:08 $
7   Version:   $Revision: 1.25 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 #include "gdcmDicomDirObject.h"
20 #include "gdcmGlobal.h"
21 #include "gdcmDebug.h"
22 #include "gdcmDictSet.h"
23 #include "gdcmDataEntry.h"
24
25 namespace GDCM_NAME_SPACE 
26 {
27 //-----------------------------------------------------------------------------
28 /**
29  * \brief  Constructor 
30  *          
31  * @param depth Sequence depth level
32  */
33   
34 DicomDirObject::DicomDirObject(int depth) 
35           : SQItem (depth)
36 {
37 }
38
39 /**
40  * \brief   Canonical destructor.
41  */
42 DicomDirObject::~DicomDirObject()
43 {
44 }
45
46 //-----------------------------------------------------------------------------
47 // Public
48
49 //-----------------------------------------------------------------------------
50 // Protected
51 /**
52  * \brief   add the 'Object' related Dicom Elements to the listEntries
53  *          of a partially created DICOMDIR
54  * @param elemList Element List to add at the right place
55  */
56 void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
57 {
58   // FillObject fills up the SQItem that will be connected to the right place
59    ListDicomDirMetaElem::const_iterator it;
60    //uint16_t tmpGr,tmpEl;
61    //DictEntry *dictEntry;
62    DataEntry *entry;
63       
64    // for all the Elements found in they own part of the DicomDir dict.     
65    for(it = elemList.begin(); it != elemList.end(); ++it)
66    {
67       //tmpGr = it->Group;
68       //tmpEl = it->Elem;
69       //dictEntry = Global::GetDicts()->GetDefaultPubDict()->GetEntry(tmpGr,tmpEl);
70       //entry = DataEntry::New(dictEntry);
71       entry = DataEntry::New(it->Group, it->Elem, it->VR );
72       entry->SetOffset(0); // just to avoid further missprinting
73       entry->SetString(it->Value);
74
75       AddEntry(entry);
76       entry->Delete();
77    } 
78
79
80 //-----------------------------------------------------------------------------
81 // Private
82
83 //-----------------------------------------------------------------------------
84 // Print
85
86 //-----------------------------------------------------------------------------
87 } // end namespace gdcm