1 /*=========================================================================
4 Module: $RCSfile: TestPrintAllDocument.cxx,v $
6 Date: $Date: 2005/06/02 09:38:53 $
7 Version: $Revision: 1.2 $
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.
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.
17 =========================================================================*/
19 // TODO : check what's *actually* usefull
21 #include "gdcmDictEntry.h"
23 #include "gdcmDictSet.h"
26 #include "gdcmCommon.h"
27 #include "gdcmBinEntry.h"
28 #include "gdcmDocEntry.h"
29 #include "gdcmDocEntrySet.h"
30 #include "gdcmDocument.h"
31 #include "gdcmElementSet.h"
32 #include "gdcmSeqEntry.h"
33 #include "gdcmSQItem.h"
34 #include "gdcmValEntry.h"
38 #include <iomanip> // for std::ios::left, ...
41 #include "gdcmDataImages.h"
43 int TestPrintAllDocument(int, char *[])
45 //std::ostringstream s;
48 std::string pixelType, photomInterp;
50 l = strlen("PALETTE COLOR ");
51 while( gdcmDataImages[i] != 0 )
53 std::string filename = GDCM_DATA_ROOT;
54 filename += "/"; //doh!
55 filename += gdcmDataImages[i];
57 gdcm::File *e1= new gdcm::File( filename );
60 // just to be able to grep the display result, for some usefull info
62 //s.setf(std::ios::left);
63 //s << std::setw(60-filename.length()) << " ";
64 //std::cout << s.str() << gdcmDataImages[i];
66 std::cout << gdcmDataImages[i];
67 for (unsigned int j=0; j<60-strlen(gdcmDataImages[i]); j++)
70 pixelType = e1->GetPixelType();
71 std::cout << " pixelType=" << pixelType;
72 if (pixelType == "8U" || pixelType == "8S" )
74 std::cout << " Smpl.P.Pix.=" << e1->GetSamplesPerPixel()
75 << " Plan.Config.=" << e1->GetPlanarConfiguration();
76 photomInterp = e1->GetEntryValue(0x0028,0x0004);
78 std::cout << " Photom.Interp.=" << photomInterp;
79 for (unsigned int j=0; j<l-photomInterp.length(); j++)
82 std::cout << " TransferSyntaxName= [" << e1->GetTransferSyntaxName() << "]" ;
83 swapC = e1->GetSwapCode();
85 std::cout << " SwapCode = " << e1->GetSwapCode();
86 if ( e1->CheckIfEntryExist(0x0088,0x0200) )
87 std::cout << " Icon Image Sequence";
89 std::cout << std::endl;
91 if( e1->IsReadable() )
93 std::cout <<filename << " is Readable"
94 << std::endl << std::endl;
98 std::cout << filename << " is NOT Readable"
99 << std::endl << std::endl;