1 /*=========================================================================
4 Module: $RCSfile: PrintHeader.cxx,v $
6 Date: $Date: 2004/11/16 04:26:18 $
7 Version: $Revision: 1.9 $
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 =========================================================================*/
21 int main(int argc, char* argv[])
27 std::cout << argv[0] << " fileName" << std::endl;
36 fileName += GDCM_DATA_ROOT;
37 fileName += "/test.acr";
40 gdcm::File *e2 = new gdcm::File( fileName.c_str() );
41 gdcm::Header *e1 = e2->GetHeader();
44 int level = atoi(argv[2]);
45 e1->SetPrintLevel(level);
50 std::cout << "\n\n" << std::endl;
52 if ( e1->GetEntryByNumber(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) {
53 std::cout << "Transfert Syntax not loaded. " << std::endl
54 << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
59 std::string transferSyntaxName = e1->GetTransfertSyntaxName();
60 std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl;
62 if ( transferSyntaxName != "Implicit VR - Little Endian"
63 && transferSyntaxName != "Explicit VR - Little Endian"
64 && transferSyntaxName != "Deflated Explicit VR - Little Endian"
65 && transferSyntaxName != "Explicit VR - Big Endian"
66 && transferSyntaxName != "Uncompressed ACR-NEMA" )
68 std::cout << std::endl << "==========================================="
70 e2->GetPixelConverter()->Print();
71 std::cout << std::endl << "==========================================="
76 std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
78 std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
79 std::cout<<std::flush;