1 /*=========================================================================
4 Module: $RCSfile: PrintFile.cxx,v $
6 Date: $Date: 2004/12/16 11:37:01 $
7 Version: $Revision: 1.18 $
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 =========================================================================*/
18 #include "gdcmHeader.h"
23 int main(int argc, char* argv[])
30 std::cout << " usage : PrintDocument fileName" << std::endl;
39 fileName += GDCM_DATA_ROOT;
40 fileName += "/test.acr";
43 e1= new gdcm::Header( fileName.c_str() );
44 f1 = new gdcm::File(e1);
49 std::cout << "\n\n" << std::endl;
51 std::cout <<std::endl;
52 std::cout <<" dataSize " << f1->GetImageDataSize() << std::endl;
53 std::cout <<" dataSizeRaw " << f1->GetImageDataRawSize() << std::endl;
55 int nX,nY,nZ,sPP,planarConfig;
56 std::string pixelType;
60 std::cout << " DIMX=" << nX << " DIMY=" << nY << " DIMZ=" << nZ << std::endl;
62 pixelType = e1->GetPixelType();
63 sPP = e1->GetSamplesPerPixel();
64 planarConfig = e1->GetPlanarConfiguration();
66 std::cout << " pixelType=" << pixelType
67 << " SamplesPerPixel=" << sPP
68 << " PlanarConfiguration=" << planarConfig
70 << " PhotometricInterpretation="
71 << e1->GetEntryByNumber(0x0028,0x0004)
74 int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
75 std::cout << " NumberOfScalarComponents " << numberOfScalarComponents <<std::endl
76 << " LUT=" << (e1->HasLUT() ? "TRUE" : "FALSE")
80 if ( e1->GetEntryByNumber(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
82 std::cout << "Transfert Syntax not loaded. " << std::endl
83 << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
88 std::string transferSyntaxName = e1->GetTransfertSyntaxName();
89 std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl;
92 std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
94 std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
95 std::cout<<std::flush;