X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestDcm2Acr.cxx;h=7441a17439b2d5088f9627e6c99db52dd891c8dd;hb=d00078b5e19310b379c8339fa8fe38362e8ca392;hp=4e8332a80c15e73d6d94632129a718221803525f;hpb=978f699b97794e209f9d20e2a33a72404bda54ef;p=gdcm.git diff --git a/Example/TestDcm2Acr.cxx b/Example/TestDcm2Acr.cxx index 4e8332a8..7441a174 100644 --- a/Example/TestDcm2Acr.cxx +++ b/Example/TestDcm2Acr.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDcm2Acr.cxx,v $ Language: C++ - Date: $Date: 2004/11/16 04:26:18 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/20 16:16: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 @@ -15,29 +15,33 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ +#include "gdcmFile.h" +#include "gdcmHeader.h" + #include -#include "gdcm.h" -#include int main(int argc, char* argv[]) { std::string toto; - char zozo[100]; + std::string zozo; - gdcm::File * f1; + gdcm::FileHelper * f1; - printf (" Before gdcmFile() \n"); - printf ("\n\n---------------------------------------\n\n"); + std::cout << " Before gdcmFileHelper()" << std::endl; + std::cout << "\n\n---------------------------------------" << std::endl; - if (argc > 1) { + if (argc > 1) + { toto = argv[1]; - f1 = new gdcm::File(toto); - } else { + f1 = new gdcm::FileHelper(toto); + } + else + { std::string filename = GDCM_DATA_ROOT; filename += "/test.acr"; - f1 = new gdcm::File(filename.c_str()); + f1 = new gdcm::FileHelper(filename); } - printf (" Sortie gdcmFile() \n"); + std::cout << " Sortie gdcmFileHelper()" << std::endl; //e1.PrintPubDict(std::cout); f1->GetHeader()->Print(); @@ -45,7 +49,7 @@ int main(int argc, char* argv[]) //cle = gdcmDictEntry::TranslateToKey(0x0028,0x0008); int dataSize = f1->GetImageDataSize(); - printf ("dataSize %d\n",dataSize); + std::cout << "dataSize:" << dataSize << std::endl; // void* imageData= f1->GetHeader()->GetImageData(); @@ -58,9 +62,9 @@ int main(int argc, char* argv[]) // ecriture d'un fichier ACR à partir d'un dcmHeader correct. - sprintf(zozo, "%s.nema", toto.c_str()); + zozo = toto + ".nema"; f1->WriteAcr(zozo); - printf ("\n\n---------------------------------------\n\n"); + std::cout << "\n\n---------------------------------------\n\n" << std::endl; f1->GetHeader()->Print();