X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FWriteDicom.cxx;h=7116f734fceaefaaa7065440b17675711d50e015;hb=2bb60efea83f2bfa1823f27b2a5536a0e6cfd8c0;hp=a10d1f78efe333792090653fd97e1c08b1a07566;hpb=cba27e8db47fefa11652b98dd81d782c13eb9a80;p=gdcm.git diff --git a/Example/WriteDicom.cxx b/Example/WriteDicom.cxx index a10d1f78..7116f734 100644 --- a/Example/WriteDicom.cxx +++ b/Example/WriteDicom.cxx @@ -1,5 +1,21 @@ -#include "gdcmDocument.h" -#include "gdcmFile.h" +/*========================================================================= + + Program: gdcm + Module: $RCSfile: WriteDicom.cxx,v $ + Language: C++ + Date: $Date: 2004/11/26 10:55:03 $ + 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 "gdcm.h" // Writting of a DICOM file based on a correct dicom header // and data pixel of another image @@ -15,10 +31,10 @@ int main(int argc, char* argv[]) } const char *first = argv[1]; - gdcmFile *f1 = new gdcmFile( first ); + gdcm::File *f1 = new gdcm::File( first ); const char *second = argv[2]; - gdcmFile *f2 = new gdcmFile( second ); + gdcm::File *f2 = new gdcm::File( second ); // We assume that DICOM fields of second file actually exists : @@ -39,13 +55,12 @@ int main(int argc, char* argv[]) // and that does the job int dataSize = f2->GetImageDataSize(); - void *imageData = f2->GetImageData(); + uint8_t* imageData = f2->GetImageData(); std::cout << "dataSize :" << dataSize << std::endl; // TODO : Shouldn't we merge those two functions ? f1->SetImageData( imageData, dataSize); - f1->GetHeader()->SetImageDataSize( dataSize ); f1->GetHeader()->Print();