X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestDcm2Acr.cxx;h=86a6ba7be3a5ffeeaa81ec0b4ceb1f7a87e98e63;hb=2c23b5e3fbe71eb3c945b8376b746c533a759901;hp=8a2996b54416fb2518b575a4f8c19125bae27b58;hpb=8fca7bc2830904113dbb5521c009775d964c5c98;p=gdcm.git diff --git a/Example/TestDcm2Acr.cxx b/Example/TestDcm2Acr.cxx index 8a2996b5..86a6ba7b 100644 --- a/Example/TestDcm2Acr.cxx +++ b/Example/TestDcm2Acr.cxx @@ -1,25 +1,47 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: TestDcm2Acr.cxx,v $ + Language: C++ + Date: $Date: 2004/12/03 20:16:55 $ + Version: $Revision: 1.5 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "gdcmFile.h" +#include "gdcmHeader.h" + #include -#include "gdcm.h" int main(int argc, char* argv[]) { std::string toto; - char zozo[100]; + std::string zozo; - gdcmFile * f1; + gdcm::File * f1; - printf (" Before gdcmFile() \n"); - printf ("\n\n---------------------------------------\n\n"); + std::cout << " Before gdcmFile()" << std::endl; + std::cout << "\n\n---------------------------------------" << std::endl; - if (argc > 1) { + if (argc > 1) + { toto = argv[1]; - f1 = new gdcmFile(toto); - } else { + f1 = new gdcm::File(toto); + } + else + { std::string filename = GDCM_DATA_ROOT; filename += "/test.acr"; - f1 = new gdcmFile(filename.c_str()); + f1 = new gdcm::File(filename); } - printf (" Sortie gdcmFile() \n"); + std::cout << " Sortie gdcmFile()" << std::endl; //e1.PrintPubDict(std::cout); f1->GetHeader()->Print(); @@ -27,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(); @@ -40,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();