X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FVolume2Dicom.cxx;h=3b852d27b6760041b946b929bfd8930bbf74a769;hb=4849efa088ecdf68517144c872a61ebf065831cb;hp=96010e817e36c53c3fdd3b8fe5e0e1e6f0750121;hpb=7f5f66f57c85e30920d807612d32a65800cb1df0;p=gdcm.git diff --git a/Example/Volume2Dicom.cxx b/Example/Volume2Dicom.cxx index 96010e81..3b852d27 100644 --- a/Example/Volume2Dicom.cxx +++ b/Example/Volume2Dicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: Volume2Dicom.cxx,v $ Language: C++ - Date: $Date: 2004/12/06 11:37:37 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/02/02 10:06:32 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,10 +23,10 @@ * It's aim is to show people how to write their data volume into DICOM slices */ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmDocEntry.h" #include "gdcmBinEntry.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmUtil.h" #define USAGE "USAGE: Input3DImage OutputDirectory" @@ -41,9 +41,10 @@ const unsigned int Dimension = 3; void gdcmwrite(const char *inputfile, std::string directory); -void GetFileDateAndTime(const char *inputfile, std::string &date, std::string &time); +void GetFileDateAndTime(const char *inputfile, + std::string &date, std::string &time); -int main( int argc, char * argv[] ) +int main( int argc, char *argv[] ) { if (argc < 2) { @@ -99,7 +100,7 @@ int main( int argc, char * argv[] ) //////////////////////////////////////////////////////////// // Create a new dicom header and fill in some info // //////////////////////////////////////////////////////////// - gdcm::Header *h1 = new gdcm::Header(); + gdcm::File *h1 = new gdcm::File(); //h1->SetDateAndTime(filedate, filetime); //h1->SetModality("CT"); @@ -122,7 +123,7 @@ int main( int argc, char * argv[] ) //////////////////////////////////////////////////////////// // Create a new dicom file object from the header // //////////////////////////////////////////////////////////// - gdcm::File *f1 = new gdcm::File(h1); + gdcm::FileHelper *f1 = new gdcm::FileHelper(h1); uint8_t *myData = f1->GetImageData(); // Get an Image pointer f1->SetImageData( myData, sliceSize); // This callback ensures that the internal // Pixel_Data of f1 is set correctly @@ -158,7 +159,8 @@ int main( int argc, char * argv[] ) // just an utility function to retrieve date and time of a file -void GetFileDateAndTime(const char *inputfile, std::string &date, std::string &time) +void GetFileDateAndTime(const char *inputfile, std::string &date, + std::string &time) { struct stat buf; if (stat(inputfile, &buf) == 0)