X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestWrite.cxx;h=a5c0267f2affb74513fb53caec290aa4ac0b39ac;hb=c3094723404202f691d827ca89cca24bbd8921e7;hp=a34d618c8a7b6e66b020739e9d27b23659508bef;hpb=c094e185dd6404df031524ccae8e1b51e3b84871;p=gdcm.git diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index a34d618c..a5c0267f 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWrite.cxx,v $ Language: C++ - Date: $Date: 2005/01/21 11:40:52 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/03/02 17:22:11 $ + Version: $Revision: 1.19 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,12 +22,12 @@ int main(int argc, char *argv[]) { - std::string zozo; + std::string fileNameToWrite; gdcm::File *e1; gdcm::FileHelper *f1; - void* imageData; + void *imageData; int dataSize; if (argc < 3) { @@ -62,10 +62,10 @@ int main(int argc, char *argv[]) << "--------------------- file :" << argv[1] << std::endl; - std::string toto = argv[1]; + std::string fileName = argv[1]; std::string mode = argv[2]; - e1 = new gdcm::File( toto.c_str() ); + e1 = new gdcm::File( fileName.c_str() ); if (!e1->IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <WriteAcr(zozo); + f1->WriteAcr(fileNameToWrite); break; case 'd' : // Not document in the 'usage', because the method is knowed to be bugged. @@ -130,27 +130,27 @@ int main(int argc, char *argv[]) // ecriture d'un fichier DICOM Implicit VR // à partir d'un dcmFile correct. - zozo = toto + ".DCM"; + fileNameToWrite = fileName + ".DCM"; std::cout << "WriteDCM Implicit VR" << std::endl; - f1->WriteDcmImplVR(zozo); + f1->WriteDcmImplVR(fileNameToWrite); break; case 'x' : // ecriture d'un fichier DICOM Explicit VR // à partir d'un dcmFile correct. - zozo = toto + ".XDCM"; + fileNameToWrite = fileName + ".XDCM"; std::cout << "WriteDCM Explicit VR" << std::endl; - f1->WriteDcmExplVR(zozo); + f1->WriteDcmExplVR(fileNameToWrite); break; case 'r' : // Ecriture d'un Raw File, a afficher avec // affim filein= dimx= dimy= nbit= signe= - zozo = toto + ".RAW"; + fileNameToWrite = fileName + ".RAW"; std::cout << "WriteRaw" << std::endl; - f1->WriteRawData(zozo); + f1->WriteRawData(fileNameToWrite); break; case 'v' : @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) std::cout << "videoinv for 8 bits" << std::endl; for (int i=0; iWriteDcmExplVR(zozo); + f1->WriteDcmExplVR(fileNameToWrite); break; } - return 0; + delete e1; + delete f1; + return 0; }