From d00078b5e19310b379c8339fa8fe38362e8ca392 Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 20 Jan 2005 16:16:57 +0000 Subject: [PATCH] First stage of name normalisation : gdcm::File replace by gdcm::FileHelper in src, Examples, Test, vtk, gdcmPython --- Doc/Website/Support.html | 5 +- Example/FindTags.cxx | 12 +-- Example/PrintFile.cxx | 10 +- Example/TestChangeHeader.cxx | 10 +- Example/TestCopyDicom.cxx | 8 +- Example/TestDcm2Acr.cxx | 14 +-- Example/TestFromScratch.cxx | 8 +- Example/TestPapyrus.cxx | 10 +- Example/TestReadWriteReadCompare.cxx | 12 +-- Example/TestWrite.cxx | 15 ++- Example/TestWriteSimple.cxx | 12 +-- Example/Volume2Dicom.cxx | 8 +- Example/Write.cxx | 8 +- Example/WriteDicom.cxx | 10 +- Example/WriteDicomSimple.cxx | 8 +- Example/WriteRead.cxx | 10 +- Testing/TestAllReadCompareDicom.cxx | 10 +- Testing/TestCopyDicom.cxx | 12 +-- Testing/TestCopyRescaleDicom.cxx | 12 +-- Testing/TestReadWriteReadCompare.cxx | 8 +- Testing/TestWriteSimple.cxx | 10 +- Testing/VTKTestRead.cxx | 8 +- gdcmPython/gdcm.i | 2 +- src/CMakeLists.txt | 2 +- src/gdcmDocEntrySet.h | 6 +- src/gdcmDocument.h | 14 +-- src/gdcmFile.cxx | 137 +++++++++++++++++---------- src/gdcmFile.h | 14 +-- src/gdcmJPEGFragment.h | 6 +- src/gdcmJPEGFragmentsInfo.h | 6 +- src/gdcmRLEFramesInfo.h | 6 +- vtk/vtkGdcmReader.cxx | 10 +- vtk/vtkGdcmWriter.cxx | 10 +- 33 files changed, 235 insertions(+), 198 deletions(-) diff --git a/Doc/Website/Support.html b/Doc/Website/Support.html index d3d985fa..66bfbf6f 100644 --- a/Doc/Website/Support.html +++ b/Doc/Website/Support.html @@ -39,13 +39,10 @@ The current developpers are (alphabetical order) The contributors are diff --git a/Example/FindTags.cxx b/Example/FindTags.cxx index 83c6e599..4cbba5e0 100644 --- a/Example/FindTags.cxx +++ b/Example/FindTags.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: FindTags.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/01/20 16:16:58 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmHeader.h" #include "gdcmUtil.h" @@ -26,14 +26,14 @@ int main(int argc, char* argv[]) { std::string toto, titi; - gdcm::File * f1; + gdcm::FileHelper *f1; if(argc > 1 ) - f1 = new gdcm::File(argv[1]); + f1 = new gdcm::FileHelper(argv[1]); else { toto = GDCM_DATA_ROOT; toto += "/test.acr"; - f1 = new gdcm::File(toto); + f1 = new gdcm::FileHelper(toto); } std::string ManufacturerName="SIEMENS "; diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index cafceb70..4d6a65fe 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/19 15:26:42 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -17,14 +17,14 @@ =========================================================================*/ #include "gdcmHeader.h" #include "gdcmDebug.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include int main(int argc, char* argv[]) { gdcm::Header *e1; - gdcm::File *f1; + gdcm::FileHelper *f1; std::string fileName; if (argc != 2) { @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) gdcm::Debug::SetDebugOn(); e1= new gdcm::Header( fileName.c_str() ); - f1 = new gdcm::File(e1); + f1 = new gdcm::FileHelper(e1); if (argc > 2) { diff --git a/Example/TestChangeHeader.cxx b/Example/TestChangeHeader.cxx index aa4ae3bc..6baada03 100644 --- a/Example/TestChangeHeader.cxx +++ b/Example/TestChangeHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestChangeHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" // This examples read two images (could be the same). Try to modify // Acquisition Matrix and then write the image again @@ -32,8 +32,8 @@ int main(int argc, char* argv[]) } gdcm::Header *h1 = new gdcm::Header( argv[1] ); - gdcm::File *f1 = new gdcm::File( h1 ); - gdcm::File *f2 = new gdcm::File( argv[2] ); + gdcm::FileHelper *f1 = new gdcm::FileHelper( h1 ); + gdcm::FileHelper *f2 = new gdcm::FileHelper( argv[2] ); // 0018 1310 US ACQ Acquisition Matrix gdcm::DictEntry *dictEntry = diff --git a/Example/TestCopyDicom.cxx b/Example/TestCopyDicom.cxx index e7ced62b..8d386103 100644 --- a/Example/TestCopyDicom.cxx +++ b/Example/TestCopyDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyDicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 07:55:16 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -80,12 +80,12 @@ int main(int argc, char* argv[]) return 1; } } - gdcm::File *original = new gdcm::File( filename ); + gdcm::FileHelper *original = new gdcm::FileHelper( filename ); std::cout << "--- Original ----------------------" << std::endl; //original->GetHeader()->Print(); - gdcm::File *copy = new gdcm::File( output ); + gdcm::FileHelper *copy = new gdcm::FileHelper( output ); size_t dataSize = original->GetImageDataSize(); uint8_t* imageData = original->GetImageData(); diff --git a/Example/TestDcm2Acr.cxx b/Example/TestDcm2Acr.cxx index 86a6ba7b..7441a174 100644 --- a/Example/TestDcm2Acr.cxx +++ b/Example/TestDcm2Acr.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDcm2Acr.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/01/20 16:16:58 $ + 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 @@ -25,23 +25,23 @@ int main(int argc, char* argv[]) std::string toto; std::string zozo; - gdcm::File * f1; + gdcm::FileHelper * f1; - std::cout << " Before gdcmFile()" << std::endl; + std::cout << " Before gdcmFileHelper()" << std::endl; std::cout << "\n\n---------------------------------------" << std::endl; if (argc > 1) { toto = argv[1]; - f1 = new gdcm::File(toto); + f1 = new gdcm::FileHelper(toto); } else { std::string filename = GDCM_DATA_ROOT; filename += "/test.acr"; - f1 = new gdcm::File(filename); + f1 = new gdcm::FileHelper(filename); } - std::cout << " Sortie gdcmFile()" << std::endl; + std::cout << " Sortie gdcmFileHelper()" << std::endl; //e1.PrintPubDict(std::cout); f1->GetHeader()->Print(); diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index 6b1ebaa0..e501807d 100644 --- a/Example/TestFromScratch.cxx +++ b/Example/TestFromScratch.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestFromScratch.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 07:55:16 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) //gdcm::Debug::GetReference().SetDebug(1); std::string filename = argv[1]; - gdcm::File *f1 = new gdcm::File( filename ); + gdcm::FileHelper *f1 = new gdcm::FileHelper( filename ); gdcm::Header *h1 = f1->GetHeader(); int dataSize = f1->GetImageDataSize(); @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) } h2->Print( std::cout ); - gdcm::File *f2 = new gdcm::File( h2 ); + gdcm::FileHelper *f2 = new gdcm::FileHelper( h2 ); f2->SetImageData(imageData, dataSize); f2->SetWriteTypeToDcmExplVR(); diff --git a/Example/TestPapyrus.cxx b/Example/TestPapyrus.cxx index e0f956f1..9f99e31a 100644 --- a/Example/TestPapyrus.cxx +++ b/Example/TestPapyrus.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestPapyrus.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 13:28:23 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmDocument.h" #include "gdcmValEntry.h" #include "gdcmBinEntry.h" @@ -91,7 +91,7 @@ int main(int argc, char* argv[]) return 1; } } - gdcm::File *original = new gdcm::File( filename ); + gdcm::FileHelper *original = new gdcm::FileHelper( filename ); gdcm::Header *h = original->GetHeader(); // Look for private Papyrus Sequence @@ -246,7 +246,7 @@ int main(int argc, char* argv[]) n->ReplaceOrCreate(PixelRepresentation,0x0028,0x0102); // create the file - gdcm::File *file = new gdcm::File(n); + gdcm::FileHelper *file = new gdcm::FileHelper(n); file->SetImageData(PixelArea,lgrImage*nbImages); file->SetWriteTypeToDcmExplVR(); diff --git a/Example/TestReadWriteReadCompare.cxx b/Example/TestReadWriteReadCompare.cxx index 2eab9900..5441c7a7 100644 --- a/Example/TestReadWriteReadCompare.cxx +++ b/Example/TestReadWriteReadCompare.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestReadWriteReadCompare.cxx,v $ Language: C++ - Date: $Date: 2004/11/16 04:26:18 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" //Generated file: #include "gdcmDataImages.h" @@ -69,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 @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) //////////////// Step 3: - gdcm::File* reread = new gdcm::File( "TestReadWriteReadCompare.dcm" ); + gdcm::FileHelper *reread = new gdcm::FileHelper( "TestReadWriteReadCompare.dcm" ); if( !reread->GetHeader()->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Could not reread image " @@ -112,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: diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index 9243880c..4c4607c9 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWrite.cxx,v $ Language: C++ - Date: $Date: 2005/01/11 11:37:13 $ - Version: $Revision: 1.14 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,18 +16,17 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string zozo; - gdcm::Header* e1; - gdcm::File * f1; + gdcm::Header *e1; + gdcm::FileHelper *f1; - //gdcmDocument * d; //not used void* imageData; int dataSize; @@ -74,7 +73,7 @@ int main(int argc, char* argv[]) } // e1->Print(); - f1 = new gdcm::File(e1); + f1 = new gdcm::FileHelper(e1); // --- dataSize = f1->GetImageDataSize(); diff --git a/Example/TestWriteSimple.cxx b/Example/TestWriteSimple.cxx index f194fe05..45b9b4eb 100644 --- a/Example/TestWriteSimple.cxx +++ b/Example/TestWriteSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWriteSimple.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -31,8 +31,8 @@ int main(int argc, char* argv[]) std::string header = argv[1]; const char *output = argv[2]; - gdcm::Header *f1 = new gdcm::Header( header ); - gdcm::File *f2 = new gdcm::File( f1 ); + gdcm::Header *f1 = new gdcm::Header( header ); + gdcm::FileHelper *f2 = new gdcm::FileHelper( f1 ); // If the following call is important, then the API sucks. Why is it // required to allocate PixelData when we are not using it !? @@ -42,9 +42,9 @@ int main(int argc, char* argv[]) int dataSize = f2->GetImageDataSize(); // unsigned char cast is necessary to be able to delete the buffer // since deleting a void* is not allowed in c++ - uint8_t* imageData = (uint8_t*)f2->GetImageData(); + uint8_t *imageData = (uint8_t *)f2->GetImageData(); - f2->SetImageData( imageData, dataSize); + f2->SetImageData( imageData, dataSize ); f2->WriteDcmExplVR( output ); diff --git a/Example/Volume2Dicom.cxx b/Example/Volume2Dicom.cxx index 96010e81..a4721fff 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/01/20 16:16:58 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,7 +26,7 @@ #include "gdcmHeader.h" #include "gdcmDocEntry.h" #include "gdcmBinEntry.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmUtil.h" #define USAGE "USAGE: Input3DImage OutputDirectory" @@ -122,7 +122,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 diff --git a/Example/Write.cxx b/Example/Write.cxx index 0d1d32bc..bec3f306 100644 --- a/Example/Write.cxx +++ b/Example/Write.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: Write.cxx,v $ Language: C++ - Date: $Date: 2005/01/11 11:37:13 $ - Version: $Revision: 1.14 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) std::string zozo; gdcm::Header* e1; - gdcm::File * f1; + gdcm::FileHelper * f1; //gdcmDocument * d; //not used uint8_t* imageData; @@ -69,7 +69,7 @@ int main(int argc, char* argv[]) } // e1->Print(); - f1 = new gdcm::File(e1); + f1 = new gdcm::FileHelper(e1); // --- dataSize = f1->GetImageDataSize(); diff --git a/Example/WriteDicom.cxx b/Example/WriteDicom.cxx index 81a79048..684d6213 100644 --- a/Example/WriteDicom.cxx +++ b/Example/WriteDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteDicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" // Writting of a DICOM file based on a correct dicom header // and data pixel of another image @@ -32,10 +32,10 @@ int main(int argc, char* argv[]) } const char *first = argv[1]; - gdcm::File *f1 = new gdcm::File( first ); + gdcm::FileHelper *f1 = new gdcm::FileHelper( first ); const char *second = argv[2]; - gdcm::File *f2 = new gdcm::File( second ); + gdcm::FileHelper *f2 = new gdcm::FileHelper( second ); // We assume that DICOM fields of second file actually exists : diff --git a/Example/WriteDicomSimple.cxx b/Example/WriteDicomSimple.cxx index 213ce268..19f8a9c8 100644 --- a/Example/WriteDicomSimple.cxx +++ b/Example/WriteDicomSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteDicomSimple.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 23:18:30 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,7 +23,7 @@ * */ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include #include @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) } // Step 3 : Create the file of the image - gdcm::File *file = new gdcm::File(header); + gdcm::FileHelper *file = new gdcm::FileHelper(header); file->SetImageData(imageData,size); // Step 4 : Set the writting mode and write the image diff --git a/Example/WriteRead.cxx b/Example/WriteRead.cxx index 7e75baae..d4b5594d 100644 --- a/Example/WriteRead.cxx +++ b/Example/WriteRead.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteRead.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:56 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/20 16:16:58 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) std::string zozo; gdcm::Header* e1, *e2; - gdcm::File * f1, *f2; + gdcm::FileHelper * f1, *f2; uint8_t* imageData, *imageData2; int dataSize, dataSize2; @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) return 0; } - f1 = new gdcm::File(e1); + f1 = new gdcm::FileHelper(e1); imageData= f1->GetImageData(); dataSize = f1->GetImageDataSize(); @@ -67,7 +67,7 @@ int main(int argc, char* argv[]) <GetImageData(); dataSize2 = f2->GetImageDataSize(); diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index eea858b2..aba92462 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/11 15:58:36 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/01/20 16:16:59 $ + Version: $Revision: 1.24 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include #include @@ -31,7 +31,7 @@ int InternalTest(std::string const & filename, ////// Step 1: std::cout << " 1..."; - gdcm::File* tested = new gdcm::File( filename ); + gdcm::FileHelper* tested = new gdcm::FileHelper( filename ); if( !tested->GetHeader()->IsReadable() ) { std::cout << " Failed" << std::endl @@ -65,7 +65,7 @@ int InternalTest(std::string const & filename, ////// When reference file is not gdcm readable test is failed: std::cout << "3a..."; - gdcm::File* reference = new gdcm::File( referenceFileName ); + gdcm::FileHelper* reference = new gdcm::FileHelper( referenceFileName ); if( !reference->GetHeader()->IsReadable() ) { std::cout << " Failed" << std::endl diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index 1d26baef..d012050a 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/01/19 08:58:33 $ - Version: $Revision: 1.31 $ + Date: $Date: 2005/01/20 16:16:59 $ + Version: $Revision: 1.32 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmValEntry.h" #include "gdcmBinEntry.h" @@ -109,8 +109,8 @@ int CopyDicom(std::string const & filename, d=originalH->GetNextEntry(); } - gdcm::File *original = new gdcm::File( originalH ); - gdcm::File *copy = new gdcm::File( copyH ); + gdcm::FileHelper *original = new gdcm::FileHelper( originalH ); + gdcm::FileHelper *copy = new gdcm::FileHelper( copyH ); size_t dataSize = original->GetImageDataSize(); uint8_t* imageData = original->GetImageData(); @@ -140,7 +140,7 @@ int CopyDicom(std::string const & filename, //////////////// Step 4: std::cout << "4..."; - copy = new gdcm::File( output ); + copy = new gdcm::FileHelper( output ); //Is the file written still gdcm parsable ? if ( !copy->GetHeader()->IsReadable() ) diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index e566dda4..6616afa1 100644 --- a/Testing/TestCopyRescaleDicom.cxx +++ b/Testing/TestCopyRescaleDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyRescaleDicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 07:56:21 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/20 16:16:59 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmValEntry.h" #include "gdcmBinEntry.h" @@ -85,8 +85,8 @@ int CopyRescaleDicom(std::string const & filename, d=originalH->GetNextEntry(); } - gdcm::File *original = new gdcm::File( originalH ); - gdcm::File *copy = new gdcm::File( copyH ); + gdcm::FileHelper *original = new gdcm::FileHelper( originalH ); + gdcm::FileHelper *copy = new gdcm::FileHelper( copyH ); size_t dataSize = original->GetImageDataSize(); @@ -144,7 +144,7 @@ int CopyRescaleDicom(std::string const & filename, //////////////// Step 4: std::cout << "4..."; - copy = new gdcm::File( output ); + copy = new gdcm::FileHelper( output ); //Is the file written still gdcm parsable ? if ( !copy->GetHeader()->IsReadable() ) diff --git a/Testing/TestReadWriteReadCompare.cxx b/Testing/TestReadWriteReadCompare.cxx index cc48edb7..74030d58 100644 --- a/Testing/TestReadWriteReadCompare.cxx +++ b/Testing/TestReadWriteReadCompare.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestReadWriteReadCompare.cxx,v $ Language: C++ - Date: $Date: 2004/11/30 14:17:52 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/01/20 16:16:59 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,7 +39,7 @@ int CompareInternal(std::string const & filename, std::string const & output) //////////////// 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 @@ -70,7 +70,7 @@ int CompareInternal(std::string const & filename, std::string const & output) //////////////// Step 3: - gdcm::File* reread = new gdcm::File( output ); + gdcm::FileHelper* reread = new gdcm::FileHelper( output ); if( !reread->GetHeader()->IsReadable() ) { std::cerr << "Failed" << std::endl diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index 3b1dc14b..2280d76c 100644 --- a/Testing/TestWriteSimple.cxx +++ b/Testing/TestWriteSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWriteSimple.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 23:18:31 $ - Version: $Revision: 1.11 $ + Date: $Date: 2005/01/20 16:16:59 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,7 +23,7 @@ * */ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include #include @@ -155,7 +155,7 @@ int WriteSimple(Image &img) // Step 3 : Create the file of the image std::cout << "3..."; - gdcm::File *file = new gdcm::File(header); + gdcm::FileHelper *file = new gdcm::FileHelper(header); file->SetImageData(imageData,size); // Step 4 : Set the writting mode and write the image @@ -199,7 +199,7 @@ int WriteSimple(Image &img) // Step 5 : Read the written image std::cout << "5..."; - gdcm::File* reread = new gdcm::File( fileName ); + gdcm::FileHelper* reread = new gdcm::FileHelper( fileName ); if( !reread->GetHeader()->IsReadable() ) { std::cerr << "Failed" << std::endl diff --git a/Testing/VTKTestRead.cxx b/Testing/VTKTestRead.cxx index 29089d91..6a083850 100644 --- a/Testing/VTKTestRead.cxx +++ b/Testing/VTKTestRead.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: VTKTestRead.cxx,v $ Language: C++ - Date: $Date: 2005/01/19 14:45:40 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/20 16:16:59 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "vtkGdcmReader.h" #include "vtkImageViewer.h" #include "vtkImageData.h" @@ -52,7 +52,7 @@ int VTKReadTest(vtkTesting *t,vtkImageViewer *viewer, // Instead of directly reading the dicom let's write it down to another file // do a scope to be sure everything gets cleanup { - gdcm::File file( filename ); + gdcm::FileHelper file( filename ); file.GetImageData(); file.SetWriteModeToRaw(); file.WriteDcmExplVR( "TestWrite.dcm" ); diff --git a/gdcmPython/gdcm.i b/gdcmPython/gdcm.i index d12ca6bc..2d3c5ad6 100644 --- a/gdcmPython/gdcm.i +++ b/gdcmPython/gdcm.i @@ -16,7 +16,7 @@ #include "gdcmDocEntrySet.h" #include "gdcmDocument.h" #include "gdcmElementSet.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmGlobal.h" #include "gdcmHeader.h" #include "gdcmSerieHeader.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 828f1832..e4b6e30a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,7 +34,7 @@ SET(libgdcm_la_SOURCES gdcmDocument.cxx gdcmElementSet.cxx gdcmException.cxx - gdcmFile.cxx + gdcmFileHelper.cxx gdcmGlobal.cxx gdcmHeader.cxx gdcmJPEGFragment.cxx diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index 4c5fd14a..745261fb 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.h,v $ Language: C++ - Date: $Date: 2005/01/20 11:39:49 $ - Version: $Revision: 1.39 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.40 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -58,7 +58,7 @@ typedef std::string BaseTagKey; */ class GDCM_EXPORT DocEntrySet : public Base { -friend class File; +friend class FileHelper; public: DocEntrySet() {}; virtual ~DocEntrySet() {}; diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index 21d5558b..a1c445f7 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2005/01/20 11:37:37 $ - Version: $Revision: 1.94 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.95 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -65,10 +65,10 @@ public: /// 'Swap code' accessor (see \ref SwapCode ) int GetSwapCode() { return SwapCode; } // System access (meaning endian related !?) - uint16_t SwapShort(uint16_t); // needed by File - uint32_t SwapLong(uint32_t); // needed by File - uint16_t UnswapShort(uint16_t); // needed by File - uint32_t UnswapLong(uint32_t); // needed by File + uint16_t SwapShort(uint16_t); // needed by Document + uint32_t SwapLong(uint32_t); // needed by Document + uint16_t UnswapShort(uint16_t); // needed by Document + uint32_t UnswapLong(uint32_t); // needed by Document // Ordering of Documents bool operator<(Document &document); @@ -254,7 +254,7 @@ private: uint32_t MaxSizePrintEntry; private: - friend class File; + friend class FileHelper; }; } // end namespace gdcm diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 593a0998..c90075b1 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/16 04:50:42 $ - Version: $Revision: 1.193 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.194 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmGlobal.h" #include "gdcmTS.h" #include "gdcmDocument.h" @@ -49,7 +49,7 @@ typedef std::pair IterHT; * one sets an a posteriori shadow dictionary (efficiency can be * seen as a side effect). */ -File::File( ) +FileHelper::FileHelper( ) { HeaderInternal = new Header( ); SelfHeader = true; @@ -70,7 +70,7 @@ File::File( ) * seen as a side effect). * @param header already built Header */ -File::File(Header *header) +FileHelper::FileHelper(Header *header) { HeaderInternal = header; SelfHeader = false; @@ -91,7 +91,7 @@ File::File(Header *header) * seen as a side effect). * @param filename file to be opened for parsing */ -File::File(std::string const & filename ) +FileHelper::FileHelper(std::string const & filename ) { HeaderInternal = new Header( filename ); SelfHeader = true; @@ -100,10 +100,10 @@ File::File(std::string const & filename ) /** * \brief canonical destructor - * \note If the Header was created by the File constructor, - * it is destroyed by the File + * \note If the header (gdcm::File) was created by the FileHelper constructor, + * it is destroyed by the FileHelper */ -File::~File() +FileHelper::~FileHelper() { if( PixelReadConverter ) { @@ -127,7 +127,7 @@ File::~File() //----------------------------------------------------------------------------- // Print -void File::Print(std::ostream &os, std::string const &) +void FileHelper::Print(std::ostream &os, std::string const &) { HeaderInternal->SetPrintLevel(PrintLevel); HeaderInternal->Print(os); @@ -146,7 +146,7 @@ void File::Print(std::ostream &os, std::string const &) * the size of the pixels) * @return The image size */ -size_t File::GetImageDataSize() +size_t FileHelper::GetImageDataSize() { if ( PixelWriteConverter->GetUserData() ) { @@ -163,7 +163,7 @@ size_t File::GetImageDataSize() * (use GetImageDataSize if you wish) * @return The raw image size */ -size_t File::GetImageDataRawSize() +size_t FileHelper::GetImageDataRawSize() { if ( PixelWriteConverter->GetUserData() ) { @@ -183,7 +183,7 @@ size_t File::GetImageDataRawSize() * @return Pointer to newly allocated pixel data. * NULL if alloc fails */ -uint8_t *File::GetImageData() +uint8_t *FileHelper::GetImageData() { if ( PixelWriteConverter->GetUserData() ) { @@ -216,7 +216,7 @@ uint8_t *File::GetImageData() * @return Pointer to newly allocated pixel data. * \ NULL if alloc fails */ -uint8_t *File::GetImageDataRaw () +uint8_t *FileHelper::GetImageDataRaw () { return GetRaw(); } @@ -246,7 +246,7 @@ uint8_t *File::GetImageDataRaw () * @return On success, the number of bytes actually copied. Zero on * failure e.g. MaxSize is lower than necessary. */ -size_t File::GetImageDataIntoVector (void *destination, size_t maxSize) +size_t FileHelper::GetImageDataIntoVector (void *destination, size_t maxSize) { if ( ! GetRaw() ) { @@ -292,7 +292,7 @@ size_t File::GetImageDataIntoVector (void *destination, size_t maxSize) * * @return boolean */ -void File::SetImageData(uint8_t *inData, size_t expectedSize) +void FileHelper::SetImageData(uint8_t *inData, size_t expectedSize) { SetUserData(inData,expectedSize); } @@ -301,7 +301,7 @@ void File::SetImageData(uint8_t *inData, size_t expectedSize) * \brief Set the image datas defined by the user * \warning When writting the file, this datas are get as default datas to write */ -void File::SetUserData(uint8_t *data, size_t expectedSize) +void FileHelper::SetUserData(uint8_t *data, size_t expectedSize) { PixelWriteConverter->SetUserData(data,expectedSize); } @@ -310,7 +310,7 @@ void File::SetUserData(uint8_t *data, size_t expectedSize) * \brief Get the image datas defined by the user * \warning When writting the file, this datas are get as default data to write */ -uint8_t *File::GetUserData() +uint8_t *FileHelper::GetUserData() { return PixelWriteConverter->GetUserData(); } @@ -319,7 +319,7 @@ uint8_t *File::GetUserData() * \brief Get the image data size defined by the user * \warning When writting the file, this datas are get as default data to write */ -size_t File::GetUserDataSize() +size_t FileHelper::GetUserDataSize() { return PixelWriteConverter->GetUserDataSize(); } @@ -328,7 +328,7 @@ size_t File::GetUserDataSize() * \brief Get the image datas from the file. * If a LUT is found, the data are expanded to be RGB */ -uint8_t *File::GetRGBData() +uint8_t *FileHelper::GetRGBData() { return PixelReadConverter->GetRGB(); } @@ -337,7 +337,7 @@ uint8_t *File::GetRGBData() * \brief Get the image data size from the file. * If a LUT is found, the data are expanded to be RGB */ -size_t File::GetRGBDataSize() +size_t FileHelper::GetRGBDataSize() { return PixelReadConverter->GetRGBSize(); } @@ -346,7 +346,7 @@ size_t File::GetRGBDataSize() * \brief Get the image datas from the file. * If a LUT is found, the datas are not expanded ! */ -uint8_t *File::GetRawData() +uint8_t *FileHelper::GetRawData() { return PixelReadConverter->GetRaw(); } @@ -355,7 +355,7 @@ uint8_t *File::GetRawData() * \brief Get the image data size from the file. * If a LUT is found, the data are not expanded ! */ -size_t File::GetRawDataSize() +size_t FileHelper::GetRawDataSize() { return PixelReadConverter->GetRawSize(); } @@ -369,7 +369,7 @@ size_t File::GetRawDataSize() * @return false if write fails */ -bool File::WriteRawData(std::string const &fileName) +bool FileHelper::WriteRawData(std::string const &fileName) { std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary ); if (!fp1) @@ -412,7 +412,7 @@ bool File::WriteRawData(std::string const &fileName) * @return false if write fails */ -bool File::WriteDcmImplVR (std::string const &fileName) +bool FileHelper::WriteDcmImplVR (std::string const &fileName) { SetWriteTypeToDcmImplVR(); return Write(fileName); @@ -427,7 +427,7 @@ bool File::WriteDcmImplVR (std::string const &fileName) * @return false if write fails */ -bool File::WriteDcmExplVR (std::string const &fileName) +bool FileHelper::WriteDcmExplVR (std::string const &fileName) { SetWriteTypeToDcmExplVR(); return Write(fileName); @@ -447,7 +447,7 @@ bool File::WriteDcmExplVR (std::string const &fileName) * @return false if write fails */ -bool File::WriteAcr (std::string const &fileName) +bool FileHelper::WriteAcr (std::string const &fileName) { SetWriteTypeToAcr(); return Write(fileName); @@ -459,7 +459,7 @@ bool File::WriteAcr (std::string const &fileName) * (any already existing file is overwritten) * @return false if write fails */ -bool File::Write(std::string const &fileName) +bool FileHelper::Write(std::string const &fileName) { switch(WriteType) { @@ -533,7 +533,7 @@ bool File::Write(std::string const &fileName) * @param group group number of the Dicom Element to modify * @param elem element number of the Dicom Element to modify */ -bool File::SetEntry(std::string const &content, +bool FileHelper::SetEntry(std::string const &content, uint16_t group, uint16_t elem) { return HeaderInternal->SetEntry(content,group,elem); @@ -549,7 +549,7 @@ bool File::SetEntry(std::string const &content, * @param group group number of the Dicom Element to modify * @param elem element number of the Dicom Element to modify */ -bool File::SetEntry(uint8_t *content, int lgth, +bool FileHelper::SetEntry(uint8_t *content, int lgth, uint16_t group, uint16_t elem) { return HeaderInternal->SetEntry(content,lgth,group,elem); @@ -564,7 +564,7 @@ bool File::SetEntry(uint8_t *content, int lgth, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -bool File::ReplaceOrCreate(std::string const &content, +bool FileHelper::ReplaceOrCreate(std::string const &content, uint16_t group, uint16_t elem) { return HeaderInternal->ReplaceOrCreate(content,group,elem) != NULL; @@ -580,7 +580,7 @@ bool File::ReplaceOrCreate(std::string const &content, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -bool File::ReplaceOrCreate(uint8_t *binArea, int lgth, +bool FileHelper::ReplaceOrCreate(uint8_t *binArea, int lgth, uint16_t group, uint16_t elem) { return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL; @@ -589,7 +589,7 @@ bool File::ReplaceOrCreate(uint8_t *binArea, int lgth, /** * \brief Access to the underlying \ref PixelReadConverter RGBA LUT */ -uint8_t* File::GetLutRGBA() +uint8_t* FileHelper::GetLutRGBA() { return PixelReadConverter->GetLutRGBA(); } @@ -605,7 +605,7 @@ uint8_t* File::GetLutRGBA() * when the user set an image data * @return true if the check successfulls */ -bool File::CheckWriteIntegrity() +bool FileHelper::CheckWriteIntegrity() { if(PixelWriteConverter->GetUserData()) { @@ -648,7 +648,10 @@ bool File::CheckWriteIntegrity() return true; } -void File::SetWriteToRaw() +/** + * \brief + */ +void FileHelper::SetWriteToRaw() { if( HeaderInternal->GetNumberOfScalarComponents() == 3 && !HeaderInternal->HasLUT()) @@ -681,7 +684,11 @@ void File::SetWriteToRaw() } } -void File::SetWriteToRGB() + +/** + * \brief + */ +void FileHelper::SetWriteToRGB() { if(HeaderInternal->GetNumberOfScalarComponents()==3) { @@ -751,7 +758,10 @@ void File::SetWriteToRGB() } } -void File::RestoreWrite() +/** + * \brief + */ +void FileHelper::RestoreWrite() { Archive->Restore(0x0028,0x0002); Archive->Restore(0x0028,0x0004); @@ -772,12 +782,18 @@ void File::RestoreWrite() Archive->Restore(0x0028,0x1203); } -void File::SetWriteFileTypeToACR() +/** + * \brief + */ +void FileHelper::SetWriteFileTypeToACR() { Archive->Push(0x0002,0x0010); } -void File::SetWriteFileTypeToExplicitVR() +/** + * \brief + */ +void FileHelper::SetWriteFileTypeToExplicitVR() { std::string ts = Util::DicomString( Global::GetTS()->GetSpecialTransferSyntax(TS::ExplicitVRLittleEndian) ); @@ -788,7 +804,10 @@ void File::SetWriteFileTypeToExplicitVR() Archive->Push(tss); } -void File::SetWriteFileTypeToImplicitVR() +/** + * \brief + */ +void FileHelper::SetWriteFileTypeToImplicitVR() { std::string ts = Util::DicomString( Global::GetTS()->GetSpecialTransferSyntax(TS::ImplicitVRLittleEndian) ); @@ -799,12 +818,16 @@ void File::SetWriteFileTypeToImplicitVR() Archive->Push(tss); } -void File::RestoreWriteFileType() + +/** + * \brief + */ +void FileHelper::RestoreWriteFileType() { Archive->Restore(0x0002,0x0010); } -void File::SetWriteToLibido() +void FileHelper::SetWriteToLibido() { ValEntry *oldRow = dynamic_cast (HeaderInternal->GetDocEntry(0x0028, 0x0010)); @@ -833,7 +856,10 @@ void File::SetWriteToLibido() Archive->Push(libidoCode); } -void File::SetWriteToNoLibido() +/** + * \brief + */ +void FileHelper::SetWriteToNoLibido() { ValEntry *recCode = dynamic_cast (HeaderInternal->GetDocEntry(0x0008,0x0010)); @@ -848,14 +874,17 @@ void File::SetWriteToNoLibido() } } -void File::RestoreWriteOfLibido() +/** + * \brief + */ +void FileHelper::RestoreWriteOfLibido() { Archive->Restore(0x0028,0x0010); Archive->Restore(0x0028,0x0011); Archive->Restore(0x0008,0x0010); } -ValEntry *File::CopyValEntry(uint16_t group,uint16_t elem) +ValEntry *FileHelper::CopyValEntry(uint16_t group,uint16_t elem) { DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem); ValEntry *newE; @@ -873,7 +902,16 @@ ValEntry *File::CopyValEntry(uint16_t group,uint16_t elem) return newE; } -BinEntry *File::CopyBinEntry(uint16_t group,uint16_t elem) +/** + * \brief Modifies the value of a given Bin Entry (Dicom Element) + * when it exists. Create it with the given value when unexistant. + * @param content (string) Value to be set + * @param group Group number of the Entry + * @param elem Element number of the Entry + * \return pointer to the modified/created Bin Entry (NULL when creation + * failed). + */ +BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem) { DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem); BinEntry *newE; @@ -896,7 +934,7 @@ BinEntry *File::CopyBinEntry(uint16_t group,uint16_t elem) /** * \brief Factorization for various forms of constructors. */ -void File::Initialise() +void FileHelper::Initialise() { WriteMode = WMODE_RAW; WriteType = ExplicitVR; @@ -911,7 +949,10 @@ void File::Initialise() } } -uint8_t *File::GetRaw() +/** + * \brief + */ +uint8_t *FileHelper::GetRaw() { uint8_t *raw = PixelReadConverter->GetRaw(); if ( ! raw ) diff --git a/src/gdcmFile.h b/src/gdcmFile.h index c26b8327..423f79e7 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2005/01/20 11:39:49 $ - Version: $Revision: 1.95 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.96 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -36,7 +36,7 @@ class DocEntryArchive; * for accessing the image/volume content. One can also use it to * write Dicom/ACR-NEMA/RAW files. */ -class GDCM_EXPORT File : public Base +class GDCM_EXPORT FileHelper : public Base { public: enum FileMode @@ -46,11 +46,11 @@ public: }; public: - File( ); - File( Header *header ); - File( std::string const &filename ); + FileHelper( ); + FileHelper( Header *header ); + FileHelper( std::string const &filename ); - virtual ~File(); + virtual ~FileHelper(); void Print(std::ostream &os = std::cout, std::string const & indent = ""); diff --git a/src/gdcmJPEGFragment.h b/src/gdcmJPEGFragment.h index 7540e6db..928049fc 100644 --- a/src/gdcmJPEGFragment.h +++ b/src/gdcmJPEGFragment.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJPEGFragment.h,v $ Language: C++ - Date: $Date: 2005/01/18 04:01:09 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -54,7 +54,7 @@ private: long Length; friend class Document; -friend class File; +friend class FileHelper; friend class PixelReadConvert; friend class JPEGFragmentsInfo; }; diff --git a/src/gdcmJPEGFragmentsInfo.h b/src/gdcmJPEGFragmentsInfo.h index 399d8130..b416f161 100644 --- a/src/gdcmJPEGFragmentsInfo.h +++ b/src/gdcmJPEGFragmentsInfo.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJPEGFragmentsInfo.h,v $ Language: C++ - Date: $Date: 2005/01/17 03:05:55 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -52,7 +52,7 @@ private: JPEGFragmentsList Fragments; friend class Document; -friend class File; +friend class FileHelper; friend class PixelReadConvert; }; } // end namespace gdcm diff --git a/src/gdcmRLEFramesInfo.h b/src/gdcmRLEFramesInfo.h index fb35513e..a83be408 100644 --- a/src/gdcmRLEFramesInfo.h +++ b/src/gdcmRLEFramesInfo.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFramesInfo.h,v $ Language: C++ - Date: $Date: 2005/01/16 04:50:42 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/20 16:17:00 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -45,7 +45,7 @@ class GDCM_EXPORT RLEFramesInfo { typedef std::list< RLEFrame* > RLEFrameList; friend class Document; -friend class File; +friend class FileHelper; friend class PixelReadConvert; RLEFrameList Frames; public: diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 91556c82..e6346dfc 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmReader.cxx,v $ Language: C++ - Date: $Date: 2004/12/09 10:59:59 $ - Version: $Revision: 1.64 $ + Date: $Date: 2005/01/20 16:17:01 $ + Version: $Revision: 1.65 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -65,7 +65,7 @@ // time... // ////////////////////////////////////////////////////////////// -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmHeader.h" #include "vtkGdcmReader.h" @@ -75,7 +75,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.64 $"); +vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.65 $"); vtkStandardNewMacro(vtkGdcmReader); //----------------------------------------------------------------------------- @@ -629,7 +629,7 @@ size_t vtkGdcmReader::LoadImageInMemory( unsigned long & updateProgressCount) { vtkDebugMacro(<< "Copying to memory image [" << fileName.c_str() << "]"); - gdcm::File file( fileName.c_str() ); + gdcm::FileHelper file( fileName.c_str() ); size_t size; // If the data structure of vtk for image/volume representation diff --git a/vtk/vtkGdcmWriter.cxx b/vtk/vtkGdcmWriter.cxx index f121408f..c516e01a 100644 --- a/vtk/vtkGdcmWriter.cxx +++ b/vtk/vtkGdcmWriter.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmWriter.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 18:24:07 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/01/20 16:17:01 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,7 +26,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.10 $"); +vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.11 $"); vtkStandardNewMacro(vtkGdcmWriter); //----------------------------------------------------------------------------- @@ -120,7 +120,7 @@ size_t ReverseData(vtkImageData *image,unsigned char **data) /** * Set the datas informations in the file */ -void SetImageInformation(gdcm::File *file,vtkImageData *image) +void SetImageInformation(gdcm::FileHelper *file,vtkImageData *image) { std::ostringstream str; @@ -312,7 +312,7 @@ void vtkGdcmWriter::RecursiveWrite(int axis, vtkImageData *cache, void vtkGdcmWriter::WriteDcmFile(char *fileName,vtkImageData *image) { // From here, the write of the file begins - gdcm::File *dcmFile = new gdcm::File(); + gdcm::FileHelper *dcmFile = new gdcm::FileHelper(); // Set the image informations SetImageInformation(dcmFile,image); -- 2.45.1