X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestCopyDicom.cxx;h=62e1a727e9a1a68e0c51a0520786bcdf13132076;hb=879f56a62d0772c95e92d0657882eb1886b4153d;hp=9f781aefe9435db17a30a1062b3b6d1b2c3a9e7b;hpb=84cf8342fcc7bb3caaa37519193344839aec1ecd;p=gdcm.git diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index 9f781aef..62e1a727 100644 --- a/Testing/TestCopyDicom.cxx +++ b/Testing/TestCopyDicom.cxx @@ -9,6 +9,8 @@ #ifndef _WIN32 #include //for access, unlink +#else +#include //for _access on Win32 #endif // return true if the file exists @@ -69,6 +71,9 @@ int TestCopyDicom(int , char* []) TagDocEntryHT & Ht = original->GetHeader()->GetEntry(); + size_t dataSize = original->GetImageDataSize(); + uint8_t* imageData = original->GetImageData(); + //First of all copy the header field by field // Warning :Accessor gdcmElementSet::GetEntry() should not exist @@ -84,7 +89,7 @@ int TestCopyDicom(int , char* []) if ( gdcmBinEntry* b = dynamic_cast(d) ) { copy->GetHeader()->ReplaceOrCreateByNumber( - b->GetVoidArea(), + b->GetBinArea(), b->GetLength(), b->GetGroup(), b->GetElement(), @@ -108,9 +113,6 @@ int TestCopyDicom(int , char* []) } } - size_t dataSize = original->GetImageDataSize(); - void *imageData = original->GetImageData(); - copy->SetImageData(imageData, dataSize); original->GetHeader()->SetImageDataSize(dataSize);