X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestCopyDicom.cxx;h=c0c5164ca429c9d0ccb4478f6b2b814b02217462;hb=7a6f4850521b56e6b907cb8c7938471898613fa4;hp=f74e39d2ba95f5e01a845b6a8435e096e7181608;hpb=96cc99e8e141ceaf026104699c3273ad5fc88a1f;p=gdcm.git diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index f74e39d2..c0c5164c 100644 --- a/Testing/TestCopyDicom.cxx +++ b/Testing/TestCopyDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyDicom.cxx,v $ Language: C++ - Date: $Date: 2005/02/03 10:00:06 $ - Version: $Revision: 1.39 $ + Date: $Date: 2005/07/08 13:39:57 $ + Version: $Revision: 1.41 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,38 +23,9 @@ //Generated file: #include "gdcmDataImages.h" -#ifndef _WIN32 -#include //for access, unlink -#else -#include //for _access on Win32 -#endif - // return true if the file exists -bool FileExists(const char *filename) -{ -#ifdef _MSC_VER -# define access _access -#endif -#ifndef R_OK -# define R_OK 04 -#endif - if ( access(filename, R_OK) != 0 ) - { - return false; - } - else - { - return true; - } -} - -bool RemoveFile(const char *source) -{ -#ifdef _MSC_VER -#define _unlink unlink -#endif - return unlink(source) != 0 ? false : true; -} +bool FileExists(const char *filename); +bool RemoveFile(const char *source); int CopyDicom(std::string const &filename, std::string const &output ) @@ -71,9 +42,12 @@ int CopyDicom(std::string const &filename, //////////////// Step 1: std::cout << " 1..."; - gdcm::File *originalH = new gdcm::File( filename ); + + gdcm::File *originalH = new gdcm::File( ); gdcm::File *copyH = new gdcm::File( ); + originalH->SetFileName( filename ); + originalH->Load( ); //First of all copy the file, field by field //////////////// Step 2: