X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=Example%2FTestReadWriteReadCompare.cxx;h=79679194318e08cb80129b1f2802628401f7f70b;hb=1fad5ff2d076c7dafa56b8cda37cca2118c5230e;hp=9ef3f67a17892b2e83b115410a7f294160f006c1;hpb=3afc179392ebebe610f7685bc8895b690c2a66aa;p=gdcm.git diff --git a/Example/TestReadWriteReadCompare.cxx b/Example/TestReadWriteReadCompare.cxx index 9ef3f67a..79679194 100644 --- a/Example/TestReadWriteReadCompare.cxx +++ b/Example/TestReadWriteReadCompare.cxx @@ -1,5 +1,22 @@ -#include "gdcmHeader.h" +/*========================================================================= + + Program: gdcm + Module: $RCSfile: TestReadWriteReadCompare.cxx,v $ + Language: C++ + Date: $Date: 2005/01/21 11:40:52 $ + Version: $Revision: 1.9 $ + + 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 "gdcmFile.h" +#include "gdcmFileHelper.h" //Generated file: #include "gdcmDataImages.h" @@ -16,7 +33,7 @@ int main(int argc, char* argv[]) std::cout << " For all images in gdcmData (and not blacklisted in " "Test/CMakeLists.txt)" << std::endl; std::cout << " apply the following multistep test: " << std::endl; - std::cout << " step 1: parse the image (as gdcmHeader) and call" + std::cout << " step 1: parse the image (as gdcmFile) and call" << " IsReadable(). " << std::endl; std::cout << " step 2: write the corresponding image in DICOM V3 " << "with explicit" << std::endl @@ -40,7 +57,7 @@ int main(int argc, char* argv[]) //////////////// Step 1 (see above description): - gdcm::Header *header = new gdcm::Header( filename ); + gdcm::File *header = new gdcm::File( filename ); if( !header->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:" @@ -52,7 +69,7 @@ int main(int argc, char* argv[]) //////////////// Step 2: - gdcm::File* file = new gdcm::File( header ); + gdcm::FileHelper *file = new gdcm::FileHelper( header ); int dataSize = file->GetImageDataSize(); uint8_t* imageData = file->GetImageData(); //EXTREMELY IMPORTANT // Sure, it is : It's up to the user to decide if he wants to @@ -82,8 +99,8 @@ int main(int argc, char* argv[]) //////////////// Step 3: - gdcm::File* reread = new gdcm::File( "TestReadWriteReadCompare.dcm" ); - if( !reread->GetHeader()->IsReadable() ) + gdcm::FileHelper *reread = new gdcm::FileHelper( "TestReadWriteReadCompare.dcm" ); + if( !reread->GetFile()->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Could not reread image " << "written:" << filename << std::endl; @@ -95,7 +112,7 @@ int main(int argc, char* argv[]) std::cout << "3..."; // For the next step: int dataSizeWritten = reread->GetImageDataSize(); - uint8_t* imageDataWritten = reread->GetImageData(); + uint8_t *imageDataWritten = reread->GetImageData(); //////////////// Step 4: