X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FReWrite.cxx;h=43241c1f2a76dd8e16b14131f7c4eabd9fd2a1f7;hb=5632bd68b349f72ddae6d5676193d9b03d50adb2;hp=73596d4f1f58d4e30740a778fe38ec2bd7a82a70;hpb=5b8017eb6682f2c9bd8a91fc24a0fae44ce469c9;p=gdcm.git diff --git a/Example/ReWrite.cxx b/Example/ReWrite.cxx index 73596d4f..43241c1f 100644 --- a/Example/ReWrite.cxx +++ b/Example/ReWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: ReWrite.cxx,v $ Language: C++ - Date: $Date: 2005/06/10 14:10:22 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/06/17 12:37:20 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -74,12 +74,12 @@ int main(int argc, char *argv[]) else loadMode = 0; - bool rgb = am->ArgMgrDefined("RGB"); + bool rgb = ( 0 != am->ArgMgrDefined("RGB") ); if (am->ArgMgrDefined("debug")) gdcm::Debug::DebugOn(); - // if unused Param we give up + // if unused Params we give up if ( am->ArgMgrPrintUnusedLabels() ) { am->ArgMgrUsage(usage); @@ -98,7 +98,6 @@ int main(int argc, char *argv[]) if ( !res ) { delete e1; - delete am; return 0; } @@ -106,12 +105,11 @@ int main(int argc, char *argv[]) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <GetImageDataRawSize(); - imageData = f1->GetImageDataRaw(); + imageData = f1->GetImageDataRaw();// somewhat important... can't remember f1->SetWriteModeToRaw(); } + if ( imageData == 0 ) // to avoid warning + { + std::cout << "Was unable to read pixels " << std::endl; + } std::cout <