]> Creatis software - gdcm.git/blob - src/gdcmDicomDirImage.cxx
a7024f1f4e53a766372ac7e807cc2067aa17d09a
[gdcm.git] / src / gdcmDicomDirImage.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirImage.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/28 17:01:29 $
7   Version:   $Revision: 1.21 $
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 "gdcmDicomDirImage.h"
20 #include "gdcmValEntry.h"
21 #include "gdcmGlobal.h"
22
23 namespace gdcm 
24 {
25 //-----------------------------------------------------------------------------
26 // Constructor / Destructor
27 /**
28  * \brief  Constructor 
29  * \note End user must use : DicomDirSerie::NewImage()
30  */
31 DicomDirImage::DicomDirImage(bool empty):
32    DicomDirObject()
33 {
34    if( !empty )
35    {
36       ListDicomDirImageElem const &elemList = 
37          Global::GetDicomDirElements()->GetDicomDirImageElements();
38       FillObject(elemList);
39    }
40 }
41
42 /**
43  * \brief   Canonical destructor.
44  */
45 DicomDirImage::~DicomDirImage() 
46 {
47 }
48
49 //-----------------------------------------------------------------------------
50 // Print
51 /**
52  * \brief   Prints the Object
53  * @param os ostream to write to
54  * @param indent Indentation string to be prepended during printing
55  * @return
56  */ 
57 void DicomDirImage::Print(std::ostream &os, std::string const & )
58 {
59    os << "IMAGE : ";
60    for(ListDocEntry::iterator i = DocEntries.begin();
61                               i!= DocEntries.end();
62                               ++i)
63    {
64       if( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
65       {
66          os << (dynamic_cast<ValEntry *>(*i))->GetValue(); //FIXME
67       }
68    }
69    os << std::endl;
70
71    DicomDirObject::Print(os);
72 }
73
74 //-----------------------------------------------------------------------------
75 // Public
76
77 //-----------------------------------------------------------------------------
78 // Protected
79
80 //-----------------------------------------------------------------------------
81 // Private
82
83 //-----------------------------------------------------------------------------
84 } // end namespace gdcm
85