X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FWriteRead.cxx;h=d4b5594d204f8ef2278b7f7bf7cc09ec9b679536;hb=d00078b5e19310b379c8339fa8fe38362e8ca392;hp=ac57e18f0c9078c49d5197d4f2b5e5ef67848a99;hpb=3afc179392ebebe610f7685bc8895b690c2a66aa;p=gdcm.git diff --git a/Example/WriteRead.cxx b/Example/WriteRead.cxx index ac57e18f..d4b5594d 100644 --- a/Example/WriteRead.cxx +++ b/Example/WriteRead.cxx @@ -1,14 +1,31 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: WriteRead.cxx,v $ + Language: C++ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.10 $ + + 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 "gdcmHeader.h" +#include "gdcmFile.h" + #include -#include -#include "gdcm.h" int main(int argc, char* argv[]) { - std::string toto; - char zozo[200]; + std::string zozo; gdcm::Header* e1, *e2; - gdcm::File * f1, *f2; + gdcm::FileHelper * f1, *f2; uint8_t* imageData, *imageData2; int dataSize, dataSize2; @@ -19,7 +36,7 @@ int main(int argc, char* argv[]) return 1; } - toto = argv[1]; + std::string toto = argv[1]; // --------------------- we read the input image @@ -32,13 +49,13 @@ int main(int argc, char* argv[]) return 0; } - f1 = new gdcm::File(e1); + f1 = new gdcm::FileHelper(e1); imageData= f1->GetImageData(); dataSize = f1->GetImageDataSize(); // --------------------- we write it as an Explicit VR DICOM file - sprintf(zozo, "temp.XDCM" ); + zozo = "temp.XDCM"; std::cout << "WriteDCM Explicit VR" << std::endl; f1->WriteDcmExplVR(zozo); @@ -50,7 +67,7 @@ int main(int argc, char* argv[]) <GetImageData(); dataSize2 = f2->GetImageDataSize();