1 /*=========================================================================
4 Module: $RCSfile: PrintDocument.cxx,v $
6 Date: $Date: 2005/07/06 15:49:31 $
7 Version: $Revision: 1.16 $
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"
22 #include <stdlib.h> //for atoi
24 int main(int argc, char *argv[])
27 gdcm::File *e1= new gdcm::File();;
31 std::cout << " Usage : "
34 << " printLevel debug "
35 << "short (=NOSEQ + NOSHADOW)"
43 fileName += GDCM_DATA_ROOT;
44 fileName += "/test.acr";
49 int level = atoi(argv[2]);
50 e1->SetPrintLevel(level);
54 gdcm::Debug::DebugOn();
57 e1->SetLoadMode(NO_SEQ | NO_SHADOW);
58 e1->Load( fileName.c_str() );
60 // we use PrintDocument, because we want to print what we get
62 // if ( !e1->IsReadable() )
70 std::cout << "\n\n" << std::endl;
72 if ( e1->GetEntryValue(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
74 std::cout << "Transfer Syntax not loaded. " << std::endl
75 << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
81 std::cout <<std::endl<<fileName<<" is 'file Readable'"<<std::endl;
83 std::cout <<std::endl<<fileName<<" is NOT 'file Readable'"<<std::endl;
84 std::cout<<std::flush;