X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestMakeIcon.cxx;h=34eee75ed0549cfa758f8b6d0f01c6cf0973c94a;hb=cb4c9422fb1923ce0a5bb8478a5f25e9c37410b8;hp=1efc44e4c5ea8e429499d471d8df0da9392c6f77;hpb=4978dd66554aafb749fed4b2fb7887b307795920;p=gdcm.git diff --git a/Testing/TestMakeIcon.cxx b/Testing/TestMakeIcon.cxx index 1efc44e4..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/04/25 14:35:21 $ - Version: $Revision: 1.5 $ + 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 @@ -49,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);