X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FVolume2Dicom.cxx;h=4ed808b7ce3cb5e295e92951b617951370644a17;hb=7e3167602a9c730d1c515527b0fc47fa2168e47d;hp=e8b97936b89e424488bdd739138c3fc3755445c2;hpb=6b51b22366f878e1050c75a6ebb755bd2ff365c7;p=gdcm.git diff --git a/Example/Volume2Dicom.cxx b/Example/Volume2Dicom.cxx index e8b97936..4ed808b7 100644 --- a/Example/Volume2Dicom.cxx +++ b/Example/Volume2Dicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: Volume2Dicom.cxx,v $ Language: C++ - Date: $Date: 2005/10/25 14:52:27 $ - Version: $Revision: 1.10 $ + Date: $Date: 2007/05/30 11:05:47 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -18,7 +18,7 @@ /** * This example was proposed by Jean-Michel Rouet - * It was patch by Mathieu Malaterre to remove ITK reference and be more + * It was patched by Mathieu Malaterre to remove ITK reference and be more * independant from other toolkit * It's aim is to show people how to write their data volume into DICOM slices */ @@ -33,10 +33,14 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 #define stat _stat #endif +#if defined(__BORLANDC__) + #include // for memset, memcpy +#endif + //const unsigned int Dimension = 3; void gdcmwrite(const char *inputfile, std::string directory); @@ -99,12 +103,12 @@ int main( int argc, char *argv[] ) //////////////////////////////////////////////////////////// // Create a new dicom header and fill in some info // //////////////////////////////////////////////////////////// - gdcm::File *f = gdcm::File::New(); + GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New(); //////////////////////////////////////////////////////////// // Create a new dicom file object from the header // //////////////////////////////////////////////////////////// - gdcm::FileHelper *fh = gdcm::FileHelper::New(f); + GDCM_NAME_SPACE::FileHelper *fh = GDCM_NAME_SPACE::FileHelper::New(f); uint8_t *myData = fh->GetImageData(); // Get an Image pointer fh->SetImageData( myData, sliceSize); // This callback ensures that the internal // Pixel_Data of fh is set correctly @@ -123,7 +127,7 @@ int main( int argc, char *argv[] ) memcpy(myData,imageData+z*sizex*sizey,sliceSize); // write the image - std::string filename = directory + gdcm::Util::Format("%Image_%05d.dcm", z); + std::string filename = directory + GDCM_NAME_SPACE::Util::Format("%Image_%05d.dcm", z); std::cout << "Writing file " << filename; fh->WriteDcmExplVR(filename); std::cout << " OK" << std::endl;