3 #include "gdcmException.h"
4 #include "gdcmCommon.h"
6 #include "gdcmDictEntry.h"
8 #include "gdcmDictSet.h"
9 #include "gdcmHeader.h"
11 #include "gdcmBinEntry.h"
12 #include "gdcmDocEntry.h"
13 #include "gdcmDocEntrySet.h"
14 #include "gdcmDocument.h"
15 #include "gdcmElementSet.h"
16 #include "gdcmSeqEntry.h"
17 #include "gdcmSQItem.h"
18 #include "gdcmValEntry.h"
20 int main(int argc, char* argv[])
27 std::cout << " usage : PrintDocument fileName" << std::endl;
33 fileName += GDCM_DATA_ROOT;
34 fileName += "/test.acr";
38 (fileName.c_str(),false, true);
40 f1 = new gdcmFile(e1);
46 std::cout << "\n\n" << std::endl;
48 int dataSize = f1->GetImageDataSize();
49 std::cout <<std::endl <<" dataSize " << dataSize << std::endl;
50 int nX,nY,nZ,sPP,planarConfig;
51 std::string pixelType;
55 std::cout << " DIMX=" << nX << " DIMY=" << nY << " DIMZ=" << nZ << std::endl;
57 pixelType = e1->GetPixelType();
58 sPP = e1->GetSamplesPerPixel();
59 planarConfig = e1->GetPlanarConfiguration();
61 std::cout << " pixelType=" << pixelType
62 << " SampleserPixel=" << sPP
63 << " PlanarConfiguration=" << planarConfig
65 << " PhotometricInterpretation="
66 << e1->GetEntryByNumber(0x0028,0x0004)
69 int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
70 std::cout << " NumberOfScalarComponents " << numberOfScalarComponents <<std::endl;
72 std::string transferSyntaxName = e1->GetTransfertSyntaxName();
73 std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl;
75 if ( transferSyntaxName != "Implicit VR - Little Endian"
76 && transferSyntaxName != "Explicit VR - Little Endian"
77 && transferSyntaxName != "Deflated Explicit VR - Little Endian"
78 && transferSyntaxName != "Explicit VR - Big Endian"
79 && transferSyntaxName != "Uncompressed ACR-NEMA" )
81 std::cout << std::endl << "==========================================="
83 f1->ParsePixelData(); // gdcmFile Method :-(
84 std::cout << std::endl << "==========================================="
89 std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
91 std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
92 std::cout<<std::flush;