X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestDcm2Acr.cxx;h=f16e9ef90e627bbaf79dbfaabd73d86e72ce2730;hb=bd2c6b9f9fa4b815153b200081de0450429a882e;hp=87d625007599d048741e04425292c57213495ce0;hpb=05f4ffeadc3beb5ff48fd88e7342d9287c18a27b;p=gdcm.git diff --git a/Example/TestDcm2Acr.cxx b/Example/TestDcm2Acr.cxx index 87d62500..f16e9ef9 100644 --- a/Example/TestDcm2Acr.cxx +++ b/Example/TestDcm2Acr.cxx @@ -1,51 +1,72 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: TestDcm2Acr.cxx,v $ + Language: C++ + Date: $Date: 2005/01/21 11:40:52 $ + Version: $Revision: 1.8 $ + + 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 "gdcmFileHelper.h" +#include "gdcmFile.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(); + f1->GetFile()->Print(); //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(); + // void* imageData= f1->GetFile()->GetImageData(); // Ecriture d'un Raw File, a afficher avec affim filein= dim= nbit= signe= //f1->WriteRawData("image.raw"); - // ecriture d'un fichier DICOM à partir d'un dcmHeader correct. + // ecriture d'un fichier DICOM à partir d'un dcmFile correct. //f1->WriteDcmImplVR("image.dcm"); - // ecriture d'un fichier ACR à partir d'un dcmHeader correct. + // ecriture d'un fichier ACR à partir d'un dcmFile 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(); + f1->GetFile()->Print(); return 0; }