X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FWriteRead.cxx;h=b5a5a9415f5e0f8820d7af6018a34c11b536cac2;hb=c192f5eb557ecea1d654ac753998a16c36551e81;hp=48be008419142b52240abb1a56fa942a34670661;hpb=220ad8c527f2b2edf1ba19af8897aca8f4a49cf7;p=gdcm.git diff --git a/Example/WriteRead.cxx b/Example/WriteRead.cxx index 48be0084..b5a5a941 100644 --- a/Example/WriteRead.cxx +++ b/Example/WriteRead.cxx @@ -1,16 +1,33 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: WriteRead.cxx,v $ + Language: C++ + Date: $Date: 2005/01/21 11:40:53 $ + Version: $Revision: 1.12 $ + + 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 "gdcmFileHelper.h" + #include -#include -#include "gdcm.h" int main(int argc, char* argv[]) { - std::string toto; - char zozo[200]; + std::string zozo; - gdcmHeader* e1, *e2; - gdcmFile * f1, *f2; + gdcm::File* e1, *e2; + gdcm::FileHelper * f1, *f2; - void* imageData, *imageData2; + uint8_t* imageData, *imageData2; int dataSize, dataSize2; if( argc < 2 ) @@ -19,38 +36,38 @@ int main(int argc, char* argv[]) return 1; } - toto = argv[1]; + std::string toto = argv[1]; // --------------------- we read the input image std::cout << argv[1] << std::endl; - e1 = new gdcmHeader( toto, false ); + e1 = new gdcm::File( toto ); if (!e1->IsReadable()) { std::cerr << "Sorry, " << toto <<" not a Readable DICOM / ACR File" <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); // --------------------- we read the written image - e2 = new gdcmHeader( zozo, false ); + e2 = new gdcm::File( zozo ); if (!e2->IsReadable()) { std::cerr << "Sorry, " << zozo << " not a Readable DICOM / ACR File" <GetImageData(); dataSize2 = f2->GetImageDataSize();