1 /*=========================================================================
4 Module: $RCSfile: PrintHeader.cxx,v $
6 Date: $Date: 2005/02/01 10:34:59 $
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 =========================================================================*/
19 #include "gdcmDebug.h"
23 int main(int argc, char* argv[])
29 std::cout << argv[0] << " fileName printLevel debug" << std::endl;
38 fileName += GDCM_DATA_ROOT;
39 fileName += "/test.acr";
43 gdcm::Debug::DebugOn();
45 gdcm::File *e1 = new gdcm::File( fileName.c_str() );
49 int level = atoi(argv[2]);
50 e1->SetPrintLevel(level);
55 std::cout << "\n\n" << std::endl;
57 if ( e1->GetEntryValue(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
59 std::cout << "Transfer Syntax not loaded. " << std::endl
60 << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
65 std::string transferSyntaxName = e1->GetTransferSyntaxName();
66 std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]"
68 std::cout << " SwapCode= " << e1->GetSwapCode() << std::endl;
71 std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
73 std::cout <<std::endl<<fileName<<" is NOT Readable"<<std::endl;
74 std::cout<<std::flush;