X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestMakeIcon.cxx;h=34eee75ed0549cfa758f8b6d0f01c6cf0973c94a;hb=e30768c5d2c9057ca9be9bdb2d12ff1eb1384539;hp=758016bd2996f28786246566d443d68d73dbf61d;hpb=af53562fa5426146d01a30244cc4a7df9d6927b0;p=gdcm.git diff --git a/Testing/TestMakeIcon.cxx b/Testing/TestMakeIcon.cxx index 758016bd..34eee75e 100644 --- a/Testing/TestMakeIcon.cxx +++ b/Testing/TestMakeIcon.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestMakeIcon.cxx,v $ Language: C++ - Date: $Date: 2005/03/02 16:39:28 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/04/26 16:23:58 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,8 +30,11 @@ int TestMakeIcon (int argc, char *argv[]) { // hard coded small image name - std::string input = "LIBIDO-8-ACR_NEMA-Lena_128_128.acr"; - std::string output = "test.dcm"; + std::string input = GDCM_DATA_ROOT; + input += "/"; + input += "LIBIDO-8-ACR_NEMA-Lena_128_128.acr"; + + std::string output = "testIcon.dcm"; gdcm::Debug::DebugOn(); @@ -46,16 +49,18 @@ int TestMakeIcon (int argc, char *argv[]) << " input filename.dcm output Filename.dcm" << std::endl; } - gdcm::File *f1 = new gdcm::File(input); + gdcm::File *f1 = new gdcm::File( ); + f1->Load(input); - if (f1 == 0) + if ( ! f1->IsReadable() ) { - std::cout << " failed to open file" << std::endl; + std::cout << " Failed to Open/Parse file" << input << std::endl; + delete f1; return 1; } gdcm::FileHelper *fh1 = new gdcm::FileHelper(f1); uint8_t *pixels = fh1->GetImageData(); - uint32_t lgth = fh1->GetImageDataSize(); + uint32_t lgth = fh1->GetImageDataSize(); gdcm::SeqEntry *icon = f1->InsertSeqEntry(0x0088, 0x0200); gdcm::SQItem *sqi = new gdcm::SQItem(1);