4 int main(int argc, char* argv[])
11 std::cout << " usage : PrintDocument fileName" << std::endl;
17 fileName += GDCM_DATA_ROOT;
18 fileName += "/test.acr";
21 e1= new gdcmHeader( fileName.c_str() );
23 f1 = new gdcmFile(e1);
29 std::cout << "\n\n" << std::endl;
31 int dataSize = f1->GetImageDataSize();
32 std::cout <<std::endl <<" dataSize " << dataSize << std::endl;
33 int nX,nY,nZ,sPP,planarConfig;
34 std::string pixelType;
38 std::cout << " DIMX=" << nX << " DIMY=" << nY << " DIMZ=" << nZ << std::endl;
40 pixelType = e1->GetPixelType();
41 sPP = e1->GetSamplesPerPixel();
42 planarConfig = e1->GetPlanarConfiguration();
44 std::cout << " pixelType=" << pixelType
45 << " SampleserPixel=" << sPP
46 << " PlanarConfiguration=" << planarConfig
48 << " PhotometricInterpretation="
49 << e1->GetEntryByNumber(0x0028,0x0004)
52 int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
53 std::cout << " NumberOfScalarComponents " << numberOfScalarComponents <<std::endl;
56 if ( e1->GetEntryByNumber(0x0002,0x0010) == GDCM_NOTLOADED ) {
57 std::cout << "Transfert Syntax not loaded. " << std::endl
58 << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
63 std::string transferSyntaxName = e1->GetTransfertSyntaxName();
64 std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl;
66 if ( transferSyntaxName != "Implicit VR - Little Endian"
67 && transferSyntaxName != "Explicit VR - Little Endian"
68 && transferSyntaxName != "Deflated Explicit VR - Little Endian"
69 && transferSyntaxName != "Explicit VR - Big Endian"
70 && transferSyntaxName != "Uncompressed ACR-NEMA" )
72 std::cout << std::endl << "==========================================="
75 std::cout << std::endl << "==========================================="
80 std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
82 std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
83 std::cout<<std::flush;