]> Creatis software - gdcm.git/blob - src/gdcmDicomEntry.cxx
785b941c9cb9767d6be8dd9e1cec6966d678e2f5
[gdcm.git] / src / gdcmDicomEntry.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomEntry.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/10/19 13:17:05 $
7   Version:   $Revision: 1.1 $
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 "gdcmDicomEntry.h"
20 #include "gdcmDebug.h"
21 #include "gdcmUtil.h"
22
23 #include <iomanip> // for std::ios::left, ...
24 #include <fstream>
25 #include <stdio.h> // for sprintf
26
27 namespace gdcm 
28 {
29 //-----------------------------------------------------------------------------
30 // Constructor / Destructor
31 /**
32  * \brief   Constructor
33  * @param   group      DICOM-Group Number
34  * @param   elem       DICOM-Element Number
35  * @param   vr         Value Representation
36  * @param   vm         Value Multiplicity 
37  * @param   name       description of the element
38 */
39 DicomEntry::DicomEntry(const uint16_t &group,const uint16_t &elt,
40                        const VRKey &vr)
41 {
42    Tag.SetGroup(group);
43    Tag.SetElement(elt);
44    VR = vr;
45 }
46
47 /**
48  * \brief   Destructor
49  */
50 DicomEntry::~DicomEntry()
51 {
52 }
53
54 //-----------------------------------------------------------------------------
55 // Public
56 /**
57  * \brief   concatenates 2 uint16_t (supposed to be a Dicom group number 
58  *                                              and a Dicom element number)
59  * @param  group the Dicom group number used to build the tag
60  * @param  elem the Dicom element number used to build the tag
61  * @return the built tag
62  */
63 TagKey DicomEntry::TranslateToKey(uint16_t group, uint16_t elem)
64 {
65    // according to 'Purify', TranslateToKey is one of the most
66    // time consuming methods.
67    // Let's try to shorten it !
68    return TagKey(group,elem);
69 }
70
71 //-----------------------------------------------------------------------------
72 // Protected
73
74 //-----------------------------------------------------------------------------
75 // Private
76
77 //-----------------------------------------------------------------------------
78 // Print
79 /**
80  * \brief   Prints an entry of the Dicom DictionaryEntry
81  * @param   os ostream we want to print in
82  * @param indent Indentation string to be prepended during printing
83  */
84 void DicomEntry::Print(std::ostream &os, std::string const & )
85 {
86    std::ostringstream s;
87
88    s << GetKey(); 
89    s << " [" << VR  << "] ";
90 }
91
92 //-----------------------------------------------------------------------------
93 } // end namespace gdcm
94