From: jpr Date: Fri, 21 Jan 2005 11:40:52 +0000 (+0000) Subject: Stage 2 of names normalization : X-Git-Tag: Version1.0.bp~226 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c094e185dd6404df031524ccae8e1b51e3b84871;p=gdcm.git Stage 2 of names normalization : - A gdcm::Document is now either a gdcm::DicomDir or a gdcm::File (easy to understand ...) - gdcm::FileHelper replaces old class gdcm::File --- diff --git a/Example/FindTags.cxx b/Example/FindTags.cxx index 4cbba5e0..59b00481 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/20 16:16:58 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmFileHelper.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmUtil.h" #include @@ -51,7 +51,7 @@ int main(int argc, char* argv[]) f1->SetEntry(ManufacturerName ,0x0008,0x0070); // ImagePositionPatient - ImagePositionPatient = f1->GetHeader()->GetEntry(0x0020,0x0032); + ImagePositionPatient = f1->GetFile()->GetEntry(0x0020,0x0032); // Image Position (RET) f1->SetEntry(ImagePositionPatient, 0x0020,0x0030); @@ -79,25 +79,25 @@ int main(int argc, char* argv[]) // SetEntryLength is private now. //TO DO : see is the pb goes on... -//f1->GetHeader()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050); +//f1->GetFile()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050); // Image Location zizi = gdcm::Util::Format("%d",0x7FE0); ImageLocation = gdcm::Util::DicomString(zizi.c_str()); //f1->SetEntry(Location, 0x0028,0x0200); -//f1->GetHeader()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence ! +//f1->GetFile()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence ! // void* imageData= f1->GetImageData(); -// ecriture d'un fichier ACR à partir d'un dcmHeader correct. +// ecriture d'un fichier ACR à partir d'un dcmFile correct. std::cout << "----------------avant PrintEntry---------------------" << std::endl; - f1->GetHeader()->Print(); + f1->GetFile()->Print(); std::cout << "----------------avant WriteDcm---------------------" << std::endl; -// ecriture d'un fichier ACR à partir d'un dcmHeader correct. +// ecriture d'un fichier ACR à partir d'un dcmFile correct. zozo = toto + ".acr"; std::cout << "WriteACR" << std::endl; diff --git a/Example/FlatHashTablePrint.cxx b/Example/FlatHashTablePrint.cxx index e7e806cc..fd134640 100644 --- a/Example/FlatHashTablePrint.cxx +++ b/Example/FlatHashTablePrint.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: FlatHashTablePrint.cxx,v $ Language: C++ - Date: $Date: 2005/01/14 17:31:34 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmDocEntry.h" // Iterate on all the Dicom entries encountered in the gdcmFile (given @@ -31,7 +31,7 @@ int main(int , char* []) return 1; } - gdcm::Header* header = new gdcm::Header( argv[1] ); + gdcm::File* header = new gdcm::File( argv[1] ); gdcm::TagDocEntryHT* Ht = header->BuildFlatHashTable(); for (gdcm::TagDocEntryHT::iterator tag = Ht->begin(); tag != Ht->end(); ++tag) diff --git a/Example/PrintDocument.cxx b/Example/PrintDocument.cxx index 02f2b33e..8d7a0aad 100644 --- a/Example/PrintDocument.cxx +++ b/Example/PrintDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDocument.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 @@ -15,14 +15,14 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include int main(int argc, char* argv[]) { - gdcm::Header *e1; + gdcm::File *e1; std::string fileName; if (argc != 2) { @@ -39,7 +39,7 @@ int main(int argc, char* argv[]) fileName += "/test.acr"; } - e1= new gdcm::Header( fileName.c_str() ); + e1= new gdcm::File( fileName.c_str() ); e1->SetPrintLevel(2); diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 4d6a65fe..de95dc45 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/20 16:16:58 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmDebug.h" #include "gdcmFileHelper.h" @@ -23,7 +23,7 @@ int main(int argc, char* argv[]) { - gdcm::Header *e1; + gdcm::File *e1; gdcm::FileHelper *f1; std::string fileName; if (argc != 2) @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) if (argc > 3) gdcm::Debug::SetDebugOn(); - e1= new gdcm::Header( fileName.c_str() ); + e1= new gdcm::File( fileName.c_str() ); f1 = new gdcm::FileHelper(e1); if (argc > 2) diff --git a/Example/PrintHeader.cxx b/Example/PrintHeader.cxx index 2112f092..23c462b3 100644 --- a/Example/PrintHeader.cxx +++ b/Example/PrintHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/12 11:40:50 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/01/21 11:40:52 $ + Version: $Revision: 1.16 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmDebug.h" #include @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) if (argc > 3) gdcm::Debug::SetDebugOn(); - gdcm::Header *e1 = new gdcm::Header( fileName.c_str() ); + gdcm::File *e1 = new gdcm::File( fileName.c_str() ); if (argc > 2) { diff --git a/Example/TestChangeHeader.cxx b/Example/TestChangeHeader.cxx index 6baada03..c2d4b4d9 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/20 16:16:58 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" // This examples read two images (could be the same). Try to modify @@ -31,20 +31,20 @@ int main(int argc, char* argv[]) return 1; } - gdcm::Header *h1 = new gdcm::Header( argv[1] ); + gdcm::File *h1 = new gdcm::File( argv[1] ); gdcm::FileHelper *f1 = new gdcm::FileHelper( h1 ); gdcm::FileHelper *f2 = new gdcm::FileHelper( argv[2] ); // 0018 1310 US ACQ Acquisition Matrix gdcm::DictEntry *dictEntry = - f2->GetHeader()->GetPubDict()->GetDictEntry( 0x0018, 1310 ); + f2->GetFile()->GetPubDict()->GetDictEntry( 0x0018, 1310 ); std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl; - std::string matrix = f2->GetHeader()->GetEntry(0x0018, 0x1310); + std::string matrix = f2->GetFile()->GetEntry(0x0018, 0x1310); if(matrix != "gdcm::Unfound") { std::cerr << "Aquisition Matrix:" << matrix << std::endl; - f1->GetHeader()->ReplaceOrCreate( matrix, 0x0018, 0x1310); + f1->GetFile()->ReplaceOrCreate( matrix, 0x0018, 0x1310); } f1->GetImageData(); diff --git a/Example/TestCopyDicom.cxx b/Example/TestCopyDicom.cxx index 93b7a227..c69b5255 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/20 16:31:42 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/01/21 11:40:52 $ + Version: $Revision: 1.20 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmDocument.h" #include "gdcmValEntry.h" @@ -83,7 +83,7 @@ int main(int argc, char* argv[]) gdcm::FileHelper *original = new gdcm::FileHelper( filename ); std::cout << "--- Original ----------------------" << std::endl; - //original->GetHeader()->Print(); + //original->GetFile()->Print(); gdcm::FileHelper *copy = new gdcm::FileHelper( output ); @@ -96,15 +96,15 @@ int main(int argc, char* argv[]) // Warning :Accessor gdcmElementSet::GetEntry() should not exist // It was commented out by Mathieu, that was a *good* idea - // (the user does NOT have to know the way we implemented the Header !) + // (the user does NOT have to know the way we implemented the File !) // Waiting for a 'clean' solution, I keep the method ...JPRx - gdcm::DocEntry* d=original->GetHeader()->GetFirstEntry(); + gdcm::DocEntry* d=original->GetFile()->GetFirstEntry(); while(d) { if ( gdcm::BinEntry* b = dynamic_cast(d) ) { - copy->GetHeader()->ReplaceOrCreate( + copy->GetFile()->ReplaceOrCreate( b->GetBinArea(), b->GetLength(), b->GetGroup(), @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) } else if ( gdcm::ValEntry* v = dynamic_cast(d) ) { - copy->GetHeader()->ReplaceOrCreate( + copy->GetFile()->ReplaceOrCreate( v->GetValue(), v->GetGroup(), v->GetElement(), @@ -128,7 +128,7 @@ int main(int argc, char* argv[]) // << std::endl; } - d=original->GetHeader()->GetNextEntry(); + d=original->GetFile()->GetNextEntry(); } //copy->GetImageData(); @@ -136,7 +136,7 @@ int main(int argc, char* argv[]) std::cout << "--- Copy ----------------------" << std::endl; std::cout <GetHeader()->Print(); + copy->GetFile()->Print(); std::cout << "--- ---- ----------------------" << std::endl; copy->WriteDcmExplVR( output ); diff --git a/Example/TestDcm2Acr.cxx b/Example/TestDcm2Acr.cxx index 6204412f..f16e9ef9 100644 --- a/Example/TestDcm2Acr.cxx +++ b/Example/TestDcm2Acr.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDcm2Acr.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:31:42 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 "gdcmFileHelper.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include @@ -44,29 +44,29 @@ int main(int argc, char* argv[]) std::cout << " Sortie gdcmFileHelper()" << std::endl; //e1.PrintPubDict(std::cout); - f1->GetHeader()->Print(); + f1->GetFile()->Print(); //cle = gdcmDictEntry::TranslateToKey(0x0028,0x0008); int dataSize = f1->GetImageDataSize(); std::cout << "dataSize:" << dataSize << std::endl; - // void* imageData= f1->GetHeader()->GetImageData(); + // void* imageData= f1->GetFile()->GetImageData(); // Ecriture d'un Raw File, a afficher avec affim filein= dim= nbit= signe= //f1->WriteRawData("image.raw"); - // ecriture d'un fichier DICOM à partir d'un dcmHeader correct. + // ecriture d'un fichier DICOM à partir d'un dcmFile correct. //f1->WriteDcmImplVR("image.dcm"); - // ecriture d'un fichier ACR à partir d'un dcmHeader correct. + // ecriture d'un fichier ACR à partir d'un dcmFile correct. zozo = toto + ".nema"; f1->WriteAcr(zozo); std::cout << "\n\n---------------------------------------\n\n" << std::endl; - f1->GetHeader()->Print(); + f1->GetFile()->Print(); return 0; } diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index f80dfc55..b11919cc 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/20 16:31:42 $ - Version: $Revision: 1.11 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmDictEntry.h" #include "gdcmDocEntry.h" @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) std::string filename = argv[1]; gdcm::FileHelper *f1 = new gdcm::FileHelper( filename ); - gdcm::Header *h1 = f1->GetHeader(); + gdcm::File *h1 = f1->GetFile(); int dataSize = f1->GetImageDataSize(); std::cout << "DataSize: " << dataSize << std::endl; @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) uint8_t* imageData = f1->GetImageData(); // Hopefully default to something - gdcm::Header *h2 = new gdcm::Header(); + gdcm::File *h2 = new gdcm::File(); // Copy of the header content gdcm::DocEntry* d = h1->GetFirstEntry(); diff --git a/Example/TestPapyrus.cxx b/Example/TestPapyrus.cxx index 9f99e31a..63ae5e04 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 16:16:58 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/21 11:40:52 $ + 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmDocument.h" #include "gdcmValEntry.h" @@ -61,7 +61,7 @@ bool RemoveFile(const char* source) } // ---------------------------------------------------------------------- -// Here we load a supposed to be Papyrus File (gdcm::Header compliant) +// Here we load a supposed to be Papyrus File (gdcm::File compliant) // and then try to get the pixels, using low-level SeqEntry accessors. // Since it's not a general purpose Papyrus related program // (just a light example) we suppose *everything* is clean @@ -92,7 +92,7 @@ int main(int argc, char* argv[]) } } gdcm::FileHelper *original = new gdcm::FileHelper( filename ); - gdcm::Header *h = original->GetHeader(); + gdcm::File *h = original->GetFile(); // Look for private Papyrus Sequence gdcm::SeqEntry *seqPapyrus= h->GetSeqEntry(0x0041, 0x1050); @@ -224,8 +224,8 @@ int main(int argc, char* argv[]) std::string NumberOfFrames = gdcm::Util::Format("%d", nbImages); - gdcm::Header *n = new gdcm::Header(); - n->InitializeDefaultHeader(); + gdcm::File *n = new gdcm::File(); + n->InitializeDefaultFile(); n->ReplaceOrCreate(MediaStSOPinstUID, 0x0002,0x0002); // Whe keep default gdcm Transfer Syntax (Explicit VR Little Endian) diff --git a/Example/TestReadWriteReadCompare.cxx b/Example/TestReadWriteReadCompare.cxx index 5441c7a7..79679194 100644 --- a/Example/TestReadWriteReadCompare.cxx +++ b/Example/TestReadWriteReadCompare.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestReadWriteReadCompare.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:16:58 $ - Version: $Revision: 1.8 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" //Generated file: @@ -33,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 @@ -57,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:" @@ -100,7 +100,7 @@ int main(int argc, char* argv[]) //////////////// Step 3: gdcm::FileHelper *reread = new gdcm::FileHelper( "TestReadWriteReadCompare.dcm" ); - if( !reread->GetHeader()->IsReadable() ) + if( !reread->GetFile()->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Could not reread image " << "written:" << filename << std::endl; diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index 4c4607c9..a34d618c 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/20 16:16:58 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/01/21 11:40:52 $ + Version: $Revision: 1.16 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) { std::string zozo; - gdcm::Header *e1; + gdcm::File *e1; gdcm::FileHelper *f1; void* imageData; @@ -44,13 +44,13 @@ int main(int argc, char *argv[]) } /* if (0) { // Just to keep the code for further use - std::cout <GetHeader()->IsReadable()) { + std::cout <GetFile()->IsReadable()) { std::cout << "Sorry, not a DICOM / ACR File" < after new gdcmHeader" + std::cout << std::endl << "----------------------> after new gdcmFile" << std::endl; e1->PrintEntry(); std::cout <IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <GetHeader()->GetBitsAllocated() == 8) + if ( f1->GetFile()->GetBitsAllocated() == 8) { std::cout << "videoinv for 8 bits" << std::endl; for (int i=0; iSetDateAndTime(filedate, filetime); //h1->SetModality("CT"); diff --git a/Example/Write.cxx b/Example/Write.cxx index 023b54dd..7fcf5b33 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/20 16:31:42 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/01/21 11:40:53 $ + Version: $Revision: 1.17 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) { std::string zozo; - gdcm::Header* e1; + gdcm::File* e1; gdcm::FileHelper * f1; //gdcmDocument * d; //not used @@ -42,13 +42,13 @@ int main(int argc, char* argv[]) } /* if (0) { // Just to keep the code for further use - std::cout <GetHeader()->IsReadable()) { + std::cout <GetFile()->IsReadable()) { std::cout << "Sorry, not a DICOM / ACR File" < after new gdcmHeader" + std::cout << std::endl << "----------------------> after new gdcmFile" << std::endl; e1->PrintEntry(); std::cout <IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <GetHeader()->GetEntry(0x0028, 0x0008); + std::string nbFrames = f2->GetFile()->GetEntry(0x0028, 0x0008); if(nbFrames != "gdcm::Unfound") { - f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008); + f1->GetFile()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008); } - f1->GetHeader()->ReplaceOrCreate( - f2->GetHeader()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010); // nbLig - f1->GetHeader()->ReplaceOrCreate( - f2->GetHeader()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011); // nbCol + f1->GetFile()->ReplaceOrCreate( + f2->GetFile()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010); // nbLig + f1->GetFile()->ReplaceOrCreate( + f2->GetFile()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011); // nbCol // Some other tags should be updated: @@ -63,10 +63,10 @@ int main(int argc, char* argv[]) // TODO : Shouldn't we merge those two functions ? f1->SetImageData( imageData, dataSize); - f1->GetHeader()->Print(); + f1->GetFile()->Print(); - std::string s0 = f2->GetHeader()->GetEntry(0x7fe0, 0x0000); - std::string s10 = f2->GetHeader()->GetEntry(0x7fe0, 0x0010); + std::string s0 = f2->GetFile()->GetEntry(0x7fe0, 0x0000); + std::string s10 = f2->GetFile()->GetEntry(0x7fe0, 0x0010); std::cout << "lgr 7fe0, 0000 " << s0 << std::endl; std::cout << "lgr 7fe0, 0010 " << s10 << std::endl; diff --git a/Example/WriteDicomSimple.cxx b/Example/WriteDicomSimple.cxx index 19f8a9c8..97bfe6dc 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/20 16:16:58 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/21 11:40:53 $ + 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 @@ -22,7 +22,7 @@ * The image content is a horizontal grayscale from * */ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) // Step 1 : Create the header of the image - gdcm::Header *header = new gdcm::Header(); + gdcm::File *header = new gdcm::File(); std::ostringstream str; // Set the image size diff --git a/Example/WriteRead.cxx b/Example/WriteRead.cxx index 526edfbb..b5a5a941 100644 --- a/Example/WriteRead.cxx +++ b/Example/WriteRead.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteRead.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:31:42 $ - Version: $Revision: 1.11 $ + Date: $Date: 2005/01/21 11:40:53 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) { std::string zozo; - gdcm::Header* e1, *e2; + gdcm::File* e1, *e2; gdcm::FileHelper * f1, *f2; uint8_t* imageData, *imageData2; @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) std::cout << argv[1] << std::endl; - e1 = new gdcm::Header( toto ); + e1 = new gdcm::File( toto ); if (!e1->IsReadable()) { std::cerr << "Sorry, " << toto <<" not a Readable DICOM / ACR File" <IsReadable()) { std::cerr << "Sorry, " << zozo << " not a Readable DICOM / ACR File" < #include @@ -207,7 +207,7 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt ) { std::string fileName = DataPath + fileIt->first; std::cout << Indent << "FileName: " << fileName << std::endl; - gdcm::Header* tested = new gdcm::Header( fileName.c_str() ); + gdcm::File* tested = new gdcm::File( fileName.c_str() ); if( !tested->IsReadable() ) { std::cerr << Indent << "Failed\n" diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index aba92462..24e59c98 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/20 16:16:59 $ - Version: $Revision: 1.24 $ + Date: $Date: 2005/01/21 11:40:53 $ + Version: $Revision: 1.25 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include @@ -32,7 +32,7 @@ int InternalTest(std::string const & filename, ////// Step 1: std::cout << " 1..."; gdcm::FileHelper* tested = new gdcm::FileHelper( filename ); - if( !tested->GetHeader()->IsReadable() ) + if( !tested->GetFile()->IsReadable() ) { std::cout << " Failed" << std::endl << " Image not gdcm compatible:" @@ -66,7 +66,7 @@ int InternalTest(std::string const & filename, std::cout << "3a..."; gdcm::FileHelper* reference = new gdcm::FileHelper( referenceFileName ); - if( !reference->GetHeader()->IsReadable() ) + if( !reference->GetFile()->IsReadable() ) { std::cout << " Failed" << std::endl << " reference image " @@ -77,7 +77,7 @@ int InternalTest(std::string const & filename, return 1; } - std::string PixelType = reference->GetHeader()->GetPixelType(); + std::string PixelType = reference->GetFile()->GetPixelType(); ////// Step 3b: std::cout << "3b..."; @@ -88,18 +88,18 @@ int InternalTest(std::string const & filename, uint8_t* referenceImageData = reference->GetImageData(); // Test the image size - if (tested->GetHeader()->GetXSize() != reference->GetHeader()->GetXSize() || - tested->GetHeader()->GetYSize() != reference->GetHeader()->GetYSize() || - tested->GetHeader()->GetZSize() != reference->GetHeader()->GetZSize()) + if (tested->GetFile()->GetXSize() != reference->GetFile()->GetXSize() || + tested->GetFile()->GetYSize() != reference->GetFile()->GetYSize() || + tested->GetFile()->GetZSize() != reference->GetFile()->GetZSize()) { std::cout << "Failed" << std::endl << " Size differs: " - << "X: " << tested->GetHeader()->GetXSize() << " # " - << reference->GetHeader()->GetXSize() << " | " - << "Y: " << tested->GetHeader()->GetYSize() << " # " - << reference->GetHeader()->GetYSize() << " | " - << "Z: " << tested->GetHeader()->GetZSize() << " # " - << reference->GetHeader()->GetZSize() << std::endl; + << "X: " << tested->GetFile()->GetXSize() << " # " + << reference->GetFile()->GetXSize() << " | " + << "Y: " << tested->GetFile()->GetYSize() << " # " + << reference->GetFile()->GetYSize() << " | " + << "Z: " << tested->GetFile()->GetZSize() << " # " + << reference->GetFile()->GetZSize() << std::endl; delete reference; delete tested; return 1; @@ -170,7 +170,7 @@ int TestAllReadCompareDicom(int argc, char* argv[]) << std::endl; std::cout << " apply the following to each filename.xxx: " << 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: find in GDCM_DATA_ROOT/BaselineDicom/filename.dcm" diff --git a/Testing/TestBug.cxx b/Testing/TestBug.cxx index ed7cdc65..4f918c73 100644 --- a/Testing/TestBug.cxx +++ b/Testing/TestBug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestBug.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:58 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/01/21 11:40:54 $ + 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 @@ -19,18 +19,18 @@ // We have to be carefull when the code both use cout + printf VC++ gets // confused, thus make sure we use only one kind of iostream -#include "gdcmHeader.h" +#include "gdcmFile.h" int TestBug(int argc, char* argv[]) { - gdcm::Header* e1; + gdcm::File* e1; if (argc > 1) - e1 = new gdcm::Header( argv[1] ); + e1 = new gdcm::File( argv[1] ); else { std::string filename = GDCM_DATA_ROOT; filename += "/test.acr"; - e1 = new gdcm::Header( filename.c_str() ); + e1 = new gdcm::File( filename.c_str() ); } //e1->PrintPubDict(); //e1->GetPubDict()->GetEntriesByKey(); diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index d012050a..c64f88c8 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/20 16:16:59 $ - Version: $Revision: 1.32 $ + Date: $Date: 2005/01/21 11:40:54 $ + Version: $Revision: 1.33 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmValEntry.h" #include "gdcmBinEntry.h" @@ -71,8 +71,8 @@ int CopyDicom(std::string const & filename, //////////////// Step 1: std::cout << " 1..."; - gdcm::Header *originalH = new gdcm::Header( filename ); - gdcm::Header *copyH = new gdcm::Header( ); + gdcm::File *originalH = new gdcm::File( filename ); + gdcm::File *copyH = new gdcm::File( ); //First of all copy the header field by field @@ -143,7 +143,7 @@ int CopyDicom(std::string const & filename, copy = new gdcm::FileHelper( output ); //Is the file written still gdcm parsable ? - if ( !copy->GetHeader()->IsReadable() ) + if ( !copy->GetFile()->IsReadable() ) { std::cout << " Failed" << std::endl << " " << output << " not readable" << std::endl; @@ -223,7 +223,7 @@ int TestCopyDicom(int argc, char* argv[]) << std::endl; std::cout << " apply the following to each filename.xxx: " << 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(). After that, call GetImageData() and " << "GetImageDataSize() " << std::endl; diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index 6616afa1..275c5327 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/20 16:16:59 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/21 11:40:54 $ + 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 @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmValEntry.h" #include "gdcmBinEntry.h" @@ -43,14 +43,14 @@ int CopyRescaleDicom(std::string const & filename, //////////////// Step 1: std::cout << " 1..."; - gdcm::Header *originalH = new gdcm::Header( filename ); - gdcm::Header *copyH = new gdcm::Header( ); + gdcm::File *originalH = new gdcm::File( filename ); + gdcm::File *copyH = new gdcm::File( ); //First of all copy the header field by field // Warning :Accessor gdcmElementSet::GetEntry() should not exist // It was commented out by Mathieu, that was a *good* idea - // (the user does NOT have to know the way we implemented the Header !) + // (the user does NOT have to know the way we implemented the File !) // Waiting for a 'clean' solution, I keep the method ...JPRx @@ -147,7 +147,7 @@ int CopyRescaleDicom(std::string const & filename, copy = new gdcm::FileHelper( output ); //Is the file written still gdcm parsable ? - if ( !copy->GetHeader()->IsReadable() ) + if ( !copy->GetFile()->IsReadable() ) { std::cout << " Failed" << std::endl << " " << output << " not readable" << std::endl; @@ -164,18 +164,18 @@ int CopyRescaleDicom(std::string const & filename, size_t dataSizeWritten = copy->GetImageDataSize(); uint8_t* imageDataWritten = copy->GetImageData(); - if (originalH->GetXSize() != copy->GetHeader()->GetXSize() || - originalH->GetYSize() != copy->GetHeader()->GetYSize() || - originalH->GetZSize() != copy->GetHeader()->GetZSize()) + if (originalH->GetXSize() != copy->GetFile()->GetXSize() || + originalH->GetYSize() != copy->GetFile()->GetYSize() || + originalH->GetZSize() != copy->GetFile()->GetZSize()) { std::cout << "Failed" << std::endl << " X Size differs: " << "X: " << originalH->GetXSize() << " # " - << copy->GetHeader()->GetXSize() << " | " + << copy->GetFile()->GetXSize() << " | " << "Y: " << originalH->GetYSize() << " # " - << copy->GetHeader()->GetYSize() << " | " + << copy->GetFile()->GetYSize() << " | " << "Z: " << originalH->GetZSize() << " # " - << copy->GetHeader()->GetZSize() << std::endl; + << copy->GetFile()->GetZSize() << std::endl; delete original; delete copy; delete originalH; @@ -251,7 +251,7 @@ int TestCopyRescaleDicom(int argc, char* argv[]) << std::endl; std::cout << " apply the following to each filename.xxx: " << 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(). After that, call GetImageData() and " << "GetImageDataSize() " << std::endl; diff --git a/Testing/TestReadWriteReadCompare.cxx b/Testing/TestReadWriteReadCompare.cxx index 83d7cf29..468b8721 100644 --- a/Testing/TestReadWriteReadCompare.cxx +++ b/Testing/TestReadWriteReadCompare.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestReadWriteReadCompare.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:31:42 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/01/21 11:40:54 $ + Version: $Revision: 1.20 $ 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 "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" //Generated file: @@ -27,7 +27,7 @@ int CompareInternal(std::string const & filename, std::string const & output) //////////////// 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:" @@ -71,7 +71,7 @@ int CompareInternal(std::string const & filename, std::string const & output) //////////////// Step 3: gdcm::FileHelper* reread = new gdcm::FileHelper( output ); - if( !reread->GetHeader()->IsReadable() ) + if( !reread->GetFile()->IsReadable() ) { std::cerr << "Failed" << std::endl << "Test::TestReadWriteReadCompare: Could not reread image " @@ -88,18 +88,18 @@ int CompareInternal(std::string const & filename, std::string const & output) //////////////// Step 4: // Test the image size - if (header->GetXSize() != reread->GetHeader()->GetXSize() || - header->GetYSize() != reread->GetHeader()->GetYSize() || - header->GetZSize() != reread->GetHeader()->GetZSize()) + if (header->GetXSize() != reread->GetFile()->GetXSize() || + header->GetYSize() != reread->GetFile()->GetYSize() || + header->GetZSize() != reread->GetFile()->GetZSize()) { std::cout << "Failed" << std::endl << " X Size differs: " << "X: " << header->GetXSize() << " # " - << reread->GetHeader()->GetXSize() << " | " + << reread->GetFile()->GetXSize() << " | " << "Y: " << header->GetYSize() << " # " - << reread->GetHeader()->GetYSize() << " | " + << reread->GetFile()->GetYSize() << " | " << "Z: " << header->GetZSize() << " # " - << reread->GetHeader()->GetZSize() << std::endl; + << reread->GetFile()->GetZSize() << std::endl; delete header; delete file; delete reread; @@ -158,7 +158,7 @@ int TestReadWriteReadCompare(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 diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index 2280d76c..1399e339 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/20 16:16:59 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/21 11:40:54 $ + 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 @@ -22,7 +22,7 @@ * The image content is a horizontal grayscale from * */ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include @@ -71,7 +71,7 @@ int WriteSimple(Image &img) // Step 1 : Create the header of the image std::cout << " 1..."; - gdcm::Header *header = new gdcm::Header(); + gdcm::File *header = new gdcm::File(); std::ostringstream str; // Set the image size @@ -200,7 +200,7 @@ int WriteSimple(Image &img) // Step 5 : Read the written image std::cout << "5..."; gdcm::FileHelper* reread = new gdcm::FileHelper( fileName ); - if( !reread->GetHeader()->IsReadable() ) + if( !reread->GetFile()->IsReadable() ) { std::cerr << "Failed" << std::endl << "Test::TestReadWriteReadCompare: Could not reread image " @@ -217,18 +217,18 @@ int WriteSimple(Image &img) uint8_t* imageDataWritten = reread->GetImageData(); // Test the image size - if (header->GetXSize() != reread->GetHeader()->GetXSize() || - header->GetYSize() != reread->GetHeader()->GetYSize() || - header->GetZSize() != reread->GetHeader()->GetZSize()) + if (header->GetXSize() != reread->GetFile()->GetXSize() || + header->GetYSize() != reread->GetFile()->GetYSize() || + header->GetZSize() != reread->GetFile()->GetZSize()) { std::cout << "Failed" << std::endl << " X Size differs: " << "X: " << header->GetXSize() << " # " - << reread->GetHeader()->GetXSize() << " | " + << reread->GetFile()->GetXSize() << " | " << "Y: " << header->GetYSize() << " # " - << reread->GetHeader()->GetYSize() << " | " + << reread->GetFile()->GetYSize() << " | " << "Z: " << header->GetZSize() << " # " - << reread->GetHeader()->GetZSize() << std::endl; + << reread->GetFile()->GetZSize() << std::endl; delete header; delete file; delete reread; diff --git a/gdcmPython/testSuite.py b/gdcmPython/testSuite.py index d10c35bb..06f3e53e 100644 --- a/gdcmPython/testSuite.py +++ b/gdcmPython/testSuite.py @@ -38,9 +38,9 @@ class gdcmTestCase(unittest.TestCase): def _BaseTest(self, FileSet): for entry in FileSet: fileName = os.path.join(GDCM_TEST_DATA_PATH, entry[0]) - reader = gdcmHeader(fileName) + reader = gdcmFile(fileName) assert reader.IsReadable(),\ - "File '%s' is not readable by gdcmHeader" % fileName + "File '%s' is not readable by gdcmFile" % fileName valDict = reader.GetEntry() for subEntry in entry[1]: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e4b6e30a..bf808628 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,7 @@ SET(libgdcm_la_SOURCES gdcmException.cxx gdcmFileHelper.cxx gdcmGlobal.cxx - gdcmHeader.cxx + gdcmFile.cxx gdcmJPEGFragment.cxx gdcmJPEGFragmentsInfo.cxx gdcmJpeg8.cxx diff --git a/src/gdcm.h b/src/gdcm.h index 8408d4f8..e572d605 100644 --- a/src/gdcm.h +++ b/src/gdcm.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcm.h,v $ Language: C++ - Date: $Date: 2004/11/26 10:55:04 $ - Version: $Revision: 1.50 $ + Date: $Date: 2005/01/21 11:40:55 $ + Version: $Revision: 1.51 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,9 +30,9 @@ #include "gdcmDictSet.h" #include "gdcmDocument.h" -#include "gdcmHeader.h" -#include "gdcmSerieHeader.h" #include "gdcmFile.h" +#include "gdcmFileHelper.h" +#include "gdcmSerieHeader.h" #include "gdcmUtil.h" diff --git a/src/gdcmBase.h b/src/gdcmBase.h index 35198eb9..9304052d 100644 --- a/src/gdcmBase.h +++ b/src/gdcmBase.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBase.h,v $ Language: C++ - Date: $Date: 2005/01/16 04:50:40 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -44,11 +44,11 @@ public: /// \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy void SetPrintLevel(int level) { PrintLevel = level; }; - /// \brief Gets the print level for the Dicom Header Elements + /// \brief Gets the print level for the Dicom Entries int GetPrintLevel() { return PrintLevel; }; protected: - /// \brief Amount of printed details for each Header Entry (Dicom Element): + /// \brief Amount of printed details for each Dicom Entries : /// 0 : stands for the least detail level. int PrintLevel; }; diff --git a/src/gdcmBinEntry.h b/src/gdcmBinEntry.h index e1f3c045..7ff241cb 100644 --- a/src/gdcmBinEntry.h +++ b/src/gdcmBinEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBinEntry.h,v $ Language: C++ - Date: $Date: 2005/01/16 04:50:41 $ - Version: $Revision: 1.31 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -27,7 +27,7 @@ namespace gdcm //----------------------------------------------------------------------------- /** - * \brief Any Dicom Document (File Header or DicomDir) contains + * \brief Any Dicom Document (File or DicomDir) contains * a set of DocEntry entries * (when successfuly parsed against a given Dicom dictionary) * BinEntry is a specialisation of ValEntry (for non std::string @@ -45,12 +45,12 @@ public: void Print( std::ostream &os = std::cout, std::string const & indent = "" ); void WriteContent( std::ofstream *fp, FileType ft); - /// \brief Returns the area value of the current Dicom Header Entry + /// \brief Returns the area value of the current Dicom Entry /// when it's not string-translatable (e.g : a LUT table) uint8_t *GetBinArea() { return BinArea; } void SetBinArea( uint8_t *area, bool self = true ); - /// Sets the value (string) of the current Dicom Document Entry + /// Sets the value (string) of the current Dicom Entry virtual void SetValue(std::string const &val) { SetValueOnly(val); }; private: /// \brief unsecure memory area to hold 'non string' values diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 95b28004..481ed229 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:16:41 $ - Version: $Revision: 1.111 $ + Date: $Date: 2005/01/21 11:40:55 $ + Version: $Revision: 1.112 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,7 +27,7 @@ #include "gdcmUtil.h" #include "gdcmDebug.h" #include "gdcmGlobal.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmSeqEntry.h" #include "gdcmSQItem.h" #include "gdcmValEntry.h" @@ -182,7 +182,7 @@ void DicomDir::Print(std::ostream &os, std::string const & ) // Public /** * \brief This predicate, based on hopefully reasonable heuristics, - * decides whether or not the current header was properly parsed + * decides whether or not the current document was properly parsed * and contains the mandatory information for being considered as * a well formed and usable DicomDir. * @return true when Document is the one of a reasonable DicomDir, @@ -412,7 +412,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path) DirList dirList(path,1); // gets recursively the file list unsigned int count = 0; VectDocument list; - Header *header; + File *header; DirListType fileList = dirList.GetFilenames(); @@ -427,16 +427,16 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path) break; } - header = new Header( it->c_str() ); + header = new File( it->c_str() ); if( !header ) { - gdcmVerboseMacro( "Failure in new Header " << it->c_str() ); + gdcmVerboseMacro( "Failure in new gdcm::File " << it->c_str() ); continue; } if( header->IsReadable() ) { - // Add the file header to the chained list: + // Add the file to the chained list: list.push_back(header); gdcmVerboseMacro( "Readable " << it->c_str() ); } @@ -450,7 +450,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path) std::sort(list.begin(), list.end(), DicomDir::HeaderLessThan ); std::string tmp = dirList.GetDirName(); - //for each Header of the chained list, add/update the Patient/Study/Serie/Image info + //for each File of the chained list, add/update the Patient/Study/Serie/Image info SetElements(tmp, list); CallEndMethod(); @@ -458,7 +458,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path) itDoc!=list.end(); ++itDoc) { - delete dynamic_cast
(*itDoc); + delete dynamic_cast(*itDoc); } } diff --git a/src/gdcmDocEntry.h b/src/gdcmDocEntry.h index 5dd19d65..2a5ddc89 100644 --- a/src/gdcmDocEntry.h +++ b/src/gdcmDocEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.h,v $ Language: C++ - Date: $Date: 2005/01/19 15:58:00 $ - Version: $Revision: 1.39 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -27,7 +27,7 @@ namespace gdcm { -class Header; +class File; class ValEntry; class BinEntry; class SeqEntry; @@ -43,16 +43,16 @@ public: DocEntry(DictEntry*); virtual ~DocEntry() {}; - /// Returns the Dicom Group number of the current Dicom Header Entry + /// Returns the Dicom Group number of the current Dicom entry uint16_t GetGroup() { return DicomDict->GetGroup(); }; - /// Returns the Dicom Element number of the current Dicom Header Entry + /// Returns the Dicom Element number of the current Dicom entry uint16_t GetElement() { return DicomDict->GetElement();}; - /// Returns the 'key' of the current Dicom Header Entry + /// Returns the 'key' of the current Dicom entry void SetKey( TagKey const &key ) { Key = key; } - /// Returns the 'key' of the current Dicom Header Entry + /// Returns the 'key' of the current Dicom entry std::string const &GetKey() const { return Key; } /// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom @@ -60,68 +60,68 @@ public: std::string const &GetName() const { return DicomDict->GetName(); }; /// \brief Returns the 'Value Representation' (e.g. "PN" : Person Name, - /// "SL" : Signed Long), found in the Dicom Header or in the Dicom - /// Dictionnary, of the current Dicom Header Entry + /// "SL" : Signed Long), found in the Dicom header or in the Dicom + /// Dictionnary, of the current Dicom entry std::string const &GetVR() const { return DicomDict->GetVR(); }; /// \brief Returns the 'Value Multiplicity' (e.g. "1", "1-n", "6"), - /// found in the Dicom Header or in the Dicom Dictionnary - /// of the current Dicom Header Entry + /// found in the Dicom entry or in the Dicom Dictionnary + /// of the current Dicom entry std::string const &GetVM() const { return DicomDict->GetVM(); }; - /// Sets the 'Value Multiplicity' of the current Dicom Header Entry + /// Sets the 'Value Multiplicity' of the current Dicom entry void SetVM( TagName const &v) { DicomDict->SetVM(v); }; /// \brief Returns offset (since the beginning of the file, including - /// the File Preamble, if any) of the value of the current Dicom HeaderEntry - /// \warning offset of the *value*, not of the Dicom Header Entry + /// the File Preamble, if any) of the value of the current Dicom entry + /// \warning offset of the *value*, not of the Dicom entry size_t GetOffset() { return Offset; }; /// \brief Sets only 'Read Length' (*not* 'Usable Length') of the current - /// Dicom Header Entry + /// Dicom entry void SetReadLength(uint32_t l) { ReadLength = l; }; - /// \brief Returns the 'read length' of the current Dicom Header Entry - /// \warning this value is the one stored in the Dicom Header but not + /// \brief Returns the 'read length' of the current Dicom entry + /// \warning this value is the one stored in the Dicom header but not /// mandatoryly the one thats's used (in case on SQ, or delimiters, /// the usable length is set to zero) uint32_t GetReadLength() { return ReadLength; }; /// \brief Sets both 'Read Length' and 'Usable Length' of the current - /// Dicom Header Entry + /// Dicom entry void SetLength(uint32_t l) { Length = l; }; - /// \brief Returns the actual value length of the current Dicom Header Entry - /// \warning this value is not *always* the one stored in the Dicom Header + /// \brief Returns the actual value length of the current Dicom entry + /// \warning this value is not *always* the one stored in the Dicom header /// in case of well knowned bugs uint32_t GetLength() { return Length; }; // The following 3 members, for internal use only ! - /// \brief Sets the offset of the Dicom Element + /// \brief Sets the offset of the Dicom entry /// \warning use with caution ! /// @param of offset to be set void SetOffset(size_t of) { Offset = of; }; - /// Sets to TRUE the ImplicitVr flag of the current Dicom Element + /// Sets to TRUE the ImplicitVr flag of the current Dicom entry void SetImplicitVR() { ImplicitVR = true; }; - /// \brief Tells us if the current Dicom Element was checked as ImplicitVr - /// @return true if the current Dicom Element was checked as ImplicitVr + /// \brief Tells us if the current Dicom entry was checked as ImplicitVr + /// @return true if the current Dicom entry was checked as ImplicitVr bool IsImplicitVR() { return ImplicitVR; }; - /// \brief Tells us if the VR of the current Dicom Element is Unknown + /// \brief Tells us if the VR of the current Dicom entry is Unknown /// @return true if the VR is unknown bool IsVRUnknown() { return DicomDict->IsVRUnknown(); }; - /// \brief Tells us if the VM of the current Dicom Element is Unknown + /// \brief Tells us if the VM of the current Dicom entry is Unknown /// @return true if the VM is unknown bool IsVMUnknown() { return DicomDict->IsVMUnknown(); }; - /// \brief Gets the DicEntry of the current Dicom Element - /// @return The DicEntry of the current Dicom Element + /// \brief Gets the DicEntry of the current Dicom entry + /// @return The DicEntry of the current Dicom entry DictEntry * GetDictEntry() { return DicomDict; }; virtual void WriteContent(std::ofstream *fp, FileType filetype); @@ -136,8 +136,8 @@ public: virtual void Print (std::ostream &os = std::cout, std::string const & indent = ""); protected: - /// \brief Sets the DicEntry of the current Dicom Element - /// \remarks Used only by the Header !!! (possible because of a friend + /// \brief Sets the DicEntry of the current Dicom entry + /// \remarks Used only by the gdcm::File !!! (possible because of a friend /// link between them) /// @param newEntry pointer to the DictEntry void SetDictEntry(DictEntry *newEntry) { DicomDict = newEntry; }; @@ -146,11 +146,11 @@ protected: /// \brief pointer to the underlying Dicom dictionary element DictEntry *DicomDict; - /// \brief Correspond to the real length of the datas + /// \brief Correspond to the real length of the data /// This length might always be even uint32_t Length; - /// \brief Length to read in the file to obtain datas. + /// \brief Length to read in the file to obtain data uint32_t ReadLength; /// \brief Even when reading explicit vr files, some elements happen to @@ -167,8 +167,8 @@ protected: private: // FIXME: In fact we should be more specific and use : - // friend DocEntry * Header::ReadNextElement(void); - friend class Header; + // friend DocEntry *File::ReadNextElement(void); + friend class File; }; } // end namespace gdcm //----------------------------------------------------------------------------- diff --git a/src/gdcmDocEntryArchive.cxx b/src/gdcmDocEntryArchive.cxx index 60e0f2d9..6d74f915 100644 --- a/src/gdcmDocEntryArchive.cxx +++ b/src/gdcmDocEntryArchive.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntryArchive.cxx,v $ Language: C++ - Date: $Date: 2005/01/17 11:13:21 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -28,7 +28,7 @@ namespace gdcm /** * \brief Constructor */ -DocEntryArchive::DocEntryArchive(Header *header): +DocEntryArchive::DocEntryArchive(File *header): HeaderHT(header->TagHT) { } diff --git a/src/gdcmDocEntryArchive.h b/src/gdcmDocEntryArchive.h index bc677476..1c6b4c58 100644 --- a/src/gdcmDocEntryArchive.h +++ b/src/gdcmDocEntryArchive.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntryArchive.h,v $ Language: C++ - Date: $Date: 2005/01/20 11:39:49 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -19,7 +19,7 @@ #ifndef GDCMDOCENTRYARCHIVE_H #define GDCMDOCENTRYARCHIVE_H -#include "gdcmHeader.h" +#include "gdcmFile.h" namespace gdcm { @@ -27,17 +27,17 @@ namespace gdcm //----------------------------------------------------------------------------- /** * \brief Container - * It's goal is to change the Header correctly. At this time, the change is + * It's goal is to change the File header correctly. At this time, the change is * only made for the first level of the Document. In the future, it might * consider Dicom Sequences (SeqEntry, within any SQItem). * The change is made by replacing a DocEntry by an other that is created - * outside the class. The old value is kept. When we restore the Header + * outside the class. The old value is kept. When we restore the File * status, the added DocEntry is deleted and replaced by the old value. */ class GDCM_EXPORT DocEntryArchive { public: - DocEntryArchive(Header *header); + DocEntryArchive(File *f); ~DocEntryArchive(); void Print(std::ostream &os = std::cout); @@ -49,7 +49,7 @@ public: void ClearArchive(void); private: - TagDocEntryHT &HeaderHT; + TagDocEntryHT &HeaderHT; // we keep the name HeaderHT TagDocEntryHT Archive; }; } // end namespace gdcm diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index a1c445f7..6ebc79c9 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 16:17:00 $ - Version: $Revision: 1.95 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -38,12 +38,12 @@ class JPEGFragmentsInfo; //----------------------------------------------------------------------------- /** - * \brief Derived by both Header and DicomDir + * \brief Derived by both gdcm::File and gdcm::DicomDir */ class GDCM_EXPORT Document : public ElementSet { public: -// Informations contained in the parser +// Informations contained in the gdcm::Document virtual bool IsReadable(); FileType GetFileType(); @@ -130,8 +130,8 @@ public: protected: // Methods // Constructor and destructor are protected to forbid end user - // to instanciate from this class Document (only Header and - // DicomDir are meaningfull). + // to instanciate from this class Document (only gdcm::File and + // gdcm::DicomDir are meaningfull). Document(); Document( std::string const &filename ); virtual ~Document(); @@ -161,13 +161,13 @@ protected: /// the well known 'Bad Big Endian' and 'Bad Little Endian' codes int SwapCode; - ///\brief whether we already parsed group 0002 + ///\brief whether we already parsed group 0002 (Meta Elements) bool Group0002Parsed; ///\brief whether file has a DCM Preamble bool HasDCMPreamble; - /// File Pointer, opened during Header parsing. + /// File Pointer, opened during Document parsing. std::ifstream *Fp; /// ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index cec02964..43f6b89b 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:22:52 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/01/21 11:40:55 $ + Version: $Revision: 1.2 $ 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 "gdcmDebug.h" #include "gdcmUtil.h" #include "gdcmBinEntry.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmPixelReadConvert.h" #include "gdcmPixelWriteConvert.h" #include "gdcmDocEntryArchive.h" @@ -38,11 +38,10 @@ typedef std::pair IterHT; // Constructor / Destructor /** * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3 - * file (Header only deals with the ... header) + * file (gdcm::File only deals with the ... header) * Opens (in read only and when possible) an existing file and checks * for DICOM compliance. Returns NULL on failure. * It will be up to the user to load the pixels into memory - * (see GetImageData, GetImageDataRaw) * \note the in-memory representation of all available tags found in * the DICOM header is post-poned to first header information access. * This avoid a double parsing of public part of the header when @@ -51,18 +50,17 @@ typedef std::pair IterHT; */ FileHelper::FileHelper( ) { - HeaderInternal = new Header( ); + FileInternal = new File( ); SelfHeader = true; - Initialise(); + Initialize(); } /** * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3 - * file (Header only deals with the ... header) + * file (File only deals with the ... header) * Opens (in read only and when possible) an existing file and checks * for DICOM compliance. Returns NULL on failure. * It will be up to the user to load the pixels into memory - * (see GetImageData, GetImageDataRaw) * \note the in-memory representation of all available tags found in * the DICOM header is post-poned to first header information access. * This avoid a double parsing of public part of the header when @@ -70,20 +68,19 @@ FileHelper::FileHelper( ) * seen as a side effect). * @param header already built Header */ -FileHelper::FileHelper(Header *header) +FileHelper::FileHelper(File *header) { - HeaderInternal = header; + FileInternal = header; SelfHeader = false; - Initialise(); + Initialize(); } /** * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3 - * file (Header only deals with the ... header) + * file (gdcm::File only deals with the ... header) * Opens (in read only and when possible) an existing file and checks * for DICOM compliance. Returns NULL on failure. * It will be up to the user to load the pixels into memory - * (see GetImageData, GetImageDataRaw) * \note the in-memory representation of all available tags found in * the DICOM header is post-poned to first header information access. * This avoid a double parsing of public part of the header when @@ -93,9 +90,9 @@ FileHelper::FileHelper(Header *header) */ FileHelper::FileHelper(std::string const & filename ) { - HeaderInternal = new Header( filename ); + FileInternal = new File( filename ); SelfHeader = true; - Initialise(); + Initialize(); } /** @@ -120,17 +117,17 @@ FileHelper::~FileHelper() if( SelfHeader ) { - delete HeaderInternal; + delete FileInternal; } - HeaderInternal = 0; + FileInternal = 0; } //----------------------------------------------------------------------------- // Print void FileHelper::Print(std::ostream &os, std::string const &) { - HeaderInternal->SetPrintLevel(PrintLevel); - HeaderInternal->Print(os); + FileInternal->SetPrintLevel(PrintLevel); + FileInternal->Print(os); PixelReadConverter->SetPrintLevel(PrintLevel); PixelReadConverter->Print(os); @@ -196,7 +193,7 @@ uint8_t *FileHelper::GetImageData() return 0; } - if ( HeaderInternal->HasLUT() && PixelReadConverter->BuildRGBImage() ) + if ( FileInternal->HasLUT() && PixelReadConverter->BuildRGBImage() ) { return PixelReadConverter->GetRGB(); } @@ -254,7 +251,7 @@ size_t FileHelper::GetImageDataIntoVector (void *destination, size_t maxSize) return 0; } - if ( HeaderInternal->HasLUT() && PixelReadConverter->BuildRGBImage() ) + if ( FileInternal->HasLUT() && PixelReadConverter->BuildRGBImage() ) { if ( PixelReadConverter->GetRGBSize() > maxSize ) { @@ -508,7 +505,7 @@ bool FileHelper::Write(std::string const &fileName) bool check = CheckWriteIntegrity(); if(check) { - check = HeaderInternal->Write(fileName,WriteType); + check = FileInternal->Write(fileName,WriteType); } RestoreWrite(); @@ -517,7 +514,7 @@ bool FileHelper::Write(std::string const &fileName) // -------------------------------------------------------------- // Special Patch to allow gdcm to re-write ACR-LibIDO formated images // - // ...and we restore the Header to be Dicom Compliant again + // ...and we restore the header to be Dicom Compliant again // just after writting RestoreWriteOfLibido(); // ----------------- End of Special Patch ---------------- @@ -536,7 +533,7 @@ bool FileHelper::Write(std::string const &fileName) bool FileHelper::SetEntry(std::string const &content, uint16_t group, uint16_t elem) { - return HeaderInternal->SetEntry(content,group,elem); + return FileInternal->SetEntry(content,group,elem); } @@ -552,38 +549,38 @@ bool FileHelper::SetEntry(std::string const &content, bool FileHelper::SetEntry(uint8_t *content, int lgth, uint16_t group, uint16_t elem) { - return HeaderInternal->SetEntry(content,lgth,group,elem); + return FileInternal->SetEntry(content,lgth,group,elem); } /** - * \brief Modifies the value of a given Doc Entry (Dicom Element) + * \brief Modifies the value of a given DocEntry (Dicom entry) * 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 Header Entry (NULL when creation + * \return pointer to the modified/created Dicom entry (NULL when creation * failed). */ bool FileHelper::ReplaceOrCreate(std::string const &content, uint16_t group, uint16_t elem) { - return HeaderInternal->ReplaceOrCreate(content,group,elem) != NULL; + return FileInternal->ReplaceOrCreate(content,group,elem) != NULL; } /* - * \brief Modifies the value of a given Header Entry (Dicom Element) + * \brief Modifies the value of a given DocEntry (Dicom entry) * when it exists. Create it with the given value when unexistant. * A copy of the binArea is made to be kept in the Document. * @param binArea (binary) value to be set * @param group Group number of the Entry * @param elem Element number of the Entry - * \return pointer to the modified/created Header Entry (NULL when creation + * \return pointer to the modified/created Dicom entry (NULL when creation * failed). */ bool FileHelper::ReplaceOrCreate(uint8_t *binArea, int lgth, uint16_t group, uint16_t elem) { - return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL; + return FileInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL; } /** @@ -609,19 +606,19 @@ bool FileHelper::CheckWriteIntegrity() { if(PixelWriteConverter->GetUserData()) { - int numberBitsAllocated = HeaderInternal->GetBitsAllocated(); + int numberBitsAllocated = FileInternal->GetBitsAllocated(); if ( numberBitsAllocated == 0 || numberBitsAllocated == 12 ) { numberBitsAllocated = 16; } - size_t decSize = HeaderInternal->GetXSize() - * HeaderInternal->GetYSize() - * HeaderInternal->GetZSize() + size_t decSize = FileInternal->GetXSize() + * FileInternal->GetYSize() + * FileInternal->GetZSize() * ( numberBitsAllocated / 8 ) - * HeaderInternal->GetSamplesPerPixel(); + * FileInternal->GetSamplesPerPixel(); size_t rgbSize = decSize; - if( HeaderInternal->HasLUT() ) + if( FileInternal->HasLUT() ) rgbSize = decSize * 3; switch(WriteMode) @@ -653,15 +650,15 @@ bool FileHelper::CheckWriteIntegrity() */ void FileHelper::SetWriteToRaw() { - if( HeaderInternal->GetNumberOfScalarComponents() == 3 - && !HeaderInternal->HasLUT()) + if( FileInternal->GetNumberOfScalarComponents() == 3 + && !FileInternal->HasLUT()) { SetWriteToRGB(); } else { ValEntry *photInt = CopyValEntry(0x0028,0x0004); - if(HeaderInternal->HasLUT()) + if(FileInternal->HasLUT()) { photInt->SetValue("PALETTE COLOR "); } @@ -674,7 +671,7 @@ void FileHelper::SetWriteToRaw() PixelReadConverter->GetRawSize()); BinEntry *pixel = - CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); + CopyBinEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel()); pixel->SetValue(GDCM_BINLOADED); pixel->SetBinArea(PixelWriteConverter->GetData(),false); pixel->SetLength(PixelWriteConverter->GetDataSize()); @@ -684,13 +681,12 @@ void FileHelper::SetWriteToRaw() } } - /** * \brief */ void FileHelper::SetWriteToRGB() { - if(HeaderInternal->GetNumberOfScalarComponents()==3) + if(FileInternal->GetNumberOfScalarComponents()==3) { PixelReadConverter->BuildRGBImage(); @@ -715,7 +711,7 @@ void FileHelper::SetWriteToRGB() } BinEntry *pixel = - CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); + CopyBinEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel()); pixel->SetValue(GDCM_BINLOADED); pixel->SetBinArea(PixelWriteConverter->GetData(),false); pixel->SetLength(PixelWriteConverter->GetDataSize()); @@ -736,7 +732,7 @@ void FileHelper::SetWriteToRGB() // For old ACR-NEMA // Thus, we have a RGB image and the bits allocated = 24 and // samples per pixels = 1 (in the read file) - if(HeaderInternal->GetBitsAllocated()==24) + if(FileInternal->GetBitsAllocated()==24) { ValEntry *bitsAlloc = CopyValEntry(0x0028,0x0100); bitsAlloc->SetValue("8 "); @@ -766,7 +762,7 @@ void FileHelper::RestoreWrite() Archive->Restore(0x0028,0x0002); Archive->Restore(0x0028,0x0004); Archive->Restore(0x0028,0x0006); - Archive->Restore(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); + Archive->Restore(GetFile()->GetGrPixel(),GetFile()->GetNumPixel()); // For old ACR-NEMA (24 bits problem) Archive->Restore(0x0028,0x0100); @@ -830,9 +826,9 @@ void FileHelper::RestoreWriteFileType() void FileHelper::SetWriteToLibido() { ValEntry *oldRow = dynamic_cast - (HeaderInternal->GetDocEntry(0x0028, 0x0010)); + (FileInternal->GetDocEntry(0x0028, 0x0010)); ValEntry *oldCol = dynamic_cast - (HeaderInternal->GetDocEntry(0x0028, 0x0011)); + (FileInternal->GetDocEntry(0x0028, 0x0011)); if( oldRow && oldCol ) { @@ -862,7 +858,7 @@ void FileHelper::SetWriteToLibido() void FileHelper::SetWriteToNoLibido() { ValEntry *recCode = dynamic_cast - (HeaderInternal->GetDocEntry(0x0008,0x0010)); + (FileInternal->GetDocEntry(0x0008,0x0010)); if( recCode ) { if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" ) @@ -886,7 +882,7 @@ void FileHelper::RestoreWriteOfLibido() ValEntry *FileHelper::CopyValEntry(uint16_t group,uint16_t elem) { - DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem); + DocEntry *oldE = FileInternal->GetDocEntry(group, elem); ValEntry *newE; if(oldE) @@ -896,7 +892,7 @@ ValEntry *FileHelper::CopyValEntry(uint16_t group,uint16_t elem) } else { - newE = GetHeader()->NewValEntry(group,elem); + newE = GetFile()->NewValEntry(group,elem); } return newE; @@ -913,7 +909,7 @@ ValEntry *FileHelper::CopyValEntry(uint16_t group,uint16_t elem) */ BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem) { - DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem); + DocEntry *oldE = FileInternal->GetDocEntry(group, elem); BinEntry *newE; if(oldE) @@ -923,7 +919,7 @@ BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem) } else { - newE = GetHeader()->NewBinEntry(group,elem); + newE = GetFile()->NewBinEntry(group,elem); } return newE; @@ -934,18 +930,18 @@ BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem) /** * \brief Factorization for various forms of constructors. */ -void FileHelper::Initialise() +void FileHelper::Initialize() { WriteMode = WMODE_RAW; WriteType = ExplicitVR; PixelReadConverter = new PixelReadConvert; PixelWriteConverter = new PixelWriteConvert; - Archive = new DocEntryArchive( HeaderInternal ); + Archive = new DocEntryArchive( FileInternal ); - if ( HeaderInternal->IsReadable() ) + if ( FileInternal->IsReadable() ) { - PixelReadConverter->GrabInformationsFromHeader( HeaderInternal ); + PixelReadConverter->GrabInformationsFromHeader( FileInternal ); } } @@ -958,10 +954,10 @@ uint8_t *FileHelper::GetRaw() if ( ! raw ) { // The Raw image migth not be loaded yet: - std::ifstream *fp = HeaderInternal->OpenFile(); + std::ifstream *fp = FileInternal->OpenFile(); PixelReadConverter->ReadAndDecompressPixelData( fp ); if(fp) - HeaderInternal->CloseFile(); + FileInternal->CloseFile(); raw = PixelReadConverter->GetRaw(); if ( ! raw ) diff --git a/src/gdcmFileHelper.h b/src/gdcmFileHelper.h index efbc1375..13134d77 100644 --- a/src/gdcmFileHelper.h +++ b/src/gdcmFileHelper.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFileHelper.h,v $ Language: C++ - Date: $Date: 2005/01/20 16:35:10 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/21 11:40:55 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,7 +24,7 @@ namespace gdcm { -class Header; +class File; class ValEntry; class BinEntry; class PixelReadConvert; @@ -32,7 +32,7 @@ class PixelWriteConvert; class DocEntryArchive; //----------------------------------------------------------------------------- /** - * \brief In addition to Dicom Header exploration, this class is designed + * \brief In addition to Dicom header exploration, this class is designed * for accessing the image/volume content. One can also use it to * write Dicom/ACR-NEMA/RAW files. */ @@ -47,15 +47,15 @@ public: public: FileHelper( ); - FileHelper( Header *header ); + FileHelper( File *header ); FileHelper( std::string const &filename ); virtual ~FileHelper(); void Print(std::ostream &os = std::cout, std::string const & indent = ""); - /// Accessor to \ref Header - Header *GetHeader() { return HeaderInternal; } + /// Accessor to \ref File + File *GetFile() { return FileInternal; } size_t GetImageDataSize(); size_t GetImageDataRawSize(); @@ -131,13 +131,13 @@ protected: BinEntry *CopyBinEntry(uint16_t group,uint16_t elem); private: - void Initialise(); + void Initialize(); uint8_t *GetRaw(); // members variables: - /// Header to use to load the file - Header *HeaderInternal; + /// gdcm::File to use to load the file + File *FileInternal; /// \brief Whether the underlying \ref Header was loaded by /// the constructor or passed to the constructor. When false diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index 8048fbab..281eb696 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.cxx,v $ Language: C++ - Date: $Date: 2005/01/17 03:05:55 $ - Version: $Revision: 1.30 $ + Date: $Date: 2005/01/21 11:40:55 $ + Version: $Revision: 1.31 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,14 +16,8 @@ =========================================================================*/ -////////////////// TEMPORARY NOTE -// look for "fixMem" and convert that to a member of this class -// Removing the prefix fixMem and dealing with allocations should do the trick -// -// grep PixelReadConvert everywhere and clean up ! - #include "gdcmDebug.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmGlobal.h" #include "gdcmTS.h" #include "gdcmPixelReadConvert.h" @@ -837,7 +831,7 @@ void PixelReadConvert::ComputeRawAndRGBSizes() } } -void PixelReadConvert::GrabInformationsFromHeader( Header *header ) +void PixelReadConvert::GrabInformationsFromHeader( File *header ) { // Number of Bits Allocated for storing a Pixel is defaulted to 16 // when absent from the header. @@ -895,7 +889,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) HasLUT = header->HasLUT(); if ( HasLUT ) { - // Just in case some access to a Header element requires disk access. + // Just in case some access to a File element requires disk access. LutRedDescriptor = header->GetEntry( 0x0028, 0x1101 ); LutGreenDescriptor = header->GetEntry( 0x0028, 0x1102 ); LutBlueDescriptor = header->GetEntry( 0x0028, 0x1103 ); @@ -904,8 +898,8 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) // [ refer to invocation of Document::SetMaxSizeLoadEntry() in // Document::Document() ], the loading of the value (content) of a // [Bin|Val]Entry occurence migth have been hindered (read simply NOT - // loaded). Hence, we first try to obtain the LUTs data from the header - // and when this fails we read the LUTs data directely from disk. + // loaded). Hence, we first try to obtain the LUTs data from the file + // and when this fails we read the LUTs data directly from disk. /// \TODO Reading a [Bin|Val]Entry directly from disk is a kludge. /// We should NOT bypass the [Bin|Val]Entry class. Instead /// an access to an UNLOADED content of a [Bin|Val]Entry occurence @@ -943,7 +937,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) } /** - * \brief Build Red/Green/Blue/Alpha LUT from Header + * \brief Build Red/Green/Blue/Alpha LUT from File * when (0028,0004),Photometric Interpretation = [PALETTE COLOR ] * and (0028,1101),(0028,1102),(0028,1102) * - xxx Palette Color Lookup Table Descriptor - are found diff --git a/src/gdcmPixelReadConvert.h b/src/gdcmPixelReadConvert.h index 13722201..8aceec49 100644 --- a/src/gdcmPixelReadConvert.h +++ b/src/gdcmPixelReadConvert.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.h,v $ Language: C++ - Date: $Date: 2005/01/16 04:50:42 $ - Version: $Revision: 1.11 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -26,7 +26,7 @@ namespace gdcm { -class Header; +class File; class RLEFramesInfo; class JPEGFragmentsInfo; @@ -53,7 +53,7 @@ public: void Print( std::ostream &os = std::cout, std::string const & indent = "" ); // In progress - void GrabInformationsFromHeader( Header *header ); + void GrabInformationsFromHeader( File *f ); bool ReadAndDecompressPixelData( std::ifstream *fp ); void Squeeze(); bool BuildRGBImage(); diff --git a/src/gdcmSerieHeader.cxx b/src/gdcmSerieHeader.cxx index 3349af58..2bee2ffa 100644 --- a/src/gdcmSerieHeader.cxx +++ b/src/gdcmSerieHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 11:56:52 $ - Version: $Revision: 1.11 $ + Date: $Date: 2005/01/21 11:40:55 $ + 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 @@ -18,7 +18,7 @@ #include "gdcmSerieHeader.h" #include "gdcmDirList.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmDebug.h" #include @@ -28,7 +28,7 @@ namespace gdcm { -typedef std::vector GdcmHeaderVector; +typedef std::vector GdcmFileVector; //----------------------------------------------------------------------------- // Constructor / Destructor SerieHeader::SerieHeader() @@ -41,7 +41,7 @@ SerieHeader::SerieHeader() SerieHeader::~SerieHeader() { /// \todo - for ( GdcmHeaderList::const_iterator it = CoherentGdcmFileList.begin(); + for ( GdcmFileList::const_iterator it = CoherentGdcmFileList.begin(); it != CoherentGdcmFileList.end(); ++it) { delete *it; @@ -61,7 +61,7 @@ SerieHeader::~SerieHeader() void SerieHeader::AddFileName(std::string const &filename) { //directly use string and not const char*: - Header *header = new Header( filename ); + File *header = new File( filename ); if( header->IsReadable() ) { // 0020 000e UI REL Series Instance UID @@ -156,7 +156,7 @@ bool SerieHeader::ImagePositionPatientOrdering() std::vector distlist; //!\todo rewrite this for loop. - for ( GdcmHeaderList::const_iterator + for ( GdcmFileList::const_iterator it = CoherentGdcmFileList.begin(); it != CoherentGdcmFileList.end(); ++it ) { @@ -220,7 +220,7 @@ bool SerieHeader::ImagePositionPatientOrdering() // Then I order the slices according to the value "dist". Finally, once // I've read in all the slices, I calculate the z-spacing as the difference // between the "dist" values for the first two slices. - GdcmHeaderVector CoherentGdcmFileVector(n); + GdcmFileVector CoherentGdcmFileVector(n); // CoherentGdcmFileVector.reserve( n ); CoherentGdcmFileVector.resize( n ); // gdcmAssertMacro( CoherentGdcmFileVector.capacity() >= n ); @@ -230,7 +230,7 @@ bool SerieHeader::ImagePositionPatientOrdering() n = 0; //VC++ don't understand what scope is !! it -> it2 - for (GdcmHeaderList::const_iterator it2 = CoherentGdcmFileList.begin(); + for (GdcmFileList::const_iterator it2 = CoherentGdcmFileList.begin(); it2 != CoherentGdcmFileList.end(); ++it2, ++n) { //2*n sort algo !! @@ -250,7 +250,7 @@ bool SerieHeader::ImagePositionPatientOrdering() CoherentGdcmFileList.clear(); //this doesn't delete list's element, node only //VC++ don't understand what scope is !! it -> it3 - for (GdcmHeaderVector::const_iterator it3 = CoherentGdcmFileVector.begin(); + for (GdcmFileVector::const_iterator it3 = CoherentGdcmFileVector.begin(); it3 != CoherentGdcmFileVector.end(); ++it3) { CoherentGdcmFileList.push_back( *it3 ); @@ -273,7 +273,7 @@ bool SerieHeader::ImageNumberOrdering() int n = 0;//CoherentGdcmFileList.size() is a O(N) operation unsigned char *partition; - GdcmHeaderList::const_iterator it = CoherentGdcmFileList.begin(); + GdcmFileList::const_iterator it = CoherentGdcmFileList.begin(); min = max = (*it)->GetImageNumber(); for (; it != CoherentGdcmFileList.end(); ++it, ++n) @@ -292,10 +292,10 @@ bool SerieHeader::ImageNumberOrdering() partition = new unsigned char[n]; memset(partition, 0, n); - GdcmHeaderVector CoherentGdcmFileVector(n); + GdcmFileVector CoherentGdcmFileVector(n); //VC++ don't understand what scope is !! it -> it2 - for (GdcmHeaderList::const_iterator it2 = CoherentGdcmFileList.begin(); + for (GdcmFileList::const_iterator it2 = CoherentGdcmFileList.begin(); it2 != CoherentGdcmFileList.end(); ++it2) { pos = (*it2)->GetImageNumber(); @@ -311,7 +311,7 @@ bool SerieHeader::ImageNumberOrdering() //VC++ don't understand what scope is !! it -> it3 CoherentGdcmFileList.clear(); //this doesn't delete list's element, node only - for ( GdcmHeaderVector::const_iterator it3 = CoherentGdcmFileVector.begin(); + for ( GdcmFileVector::const_iterator it3 = CoherentGdcmFileVector.begin(); it3 != CoherentGdcmFileVector.end(); ++it3 ) { CoherentGdcmFileList.push_back( *it3 ); diff --git a/src/gdcmSerieHeader.h b/src/gdcmSerieHeader.h index b6a8a76d..99b325cd 100644 --- a/src/gdcmSerieHeader.h +++ b/src/gdcmSerieHeader.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.h,v $ Language: C++ - Date: $Date: 2005/01/14 21:30:53 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/21 11:40:56 $ + 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 @@ -24,18 +24,16 @@ namespace gdcm { -class Header; +class File; //----------------------------------------------------------------------------- /** - * \ingroup SerieHeader * \brief * - This class should be used for a stack of 2D dicom images. - * - For a multiframe dicom image better use directly SerieHeader -*/ + */ class GDCM_EXPORT SerieHeader { public: - typedef std::list GdcmHeaderList; + typedef std::list GdcmFileList; SerieHeader(); ~SerieHeader(); @@ -48,14 +46,14 @@ public: /// \brief Gets the *coherent* File List /// @return the *coherent* File List /// Caller must call OrderGdcmFileList first - const GdcmHeaderList &GetGdcmFileList() { return CoherentGdcmFileList; } + const GdcmFileList &GetGdcmFileList() { return CoherentGdcmFileList; } private: bool ImagePositionPatientOrdering(); bool ImageNumberOrdering(); bool FileNameOrdering(); - GdcmHeaderList CoherentGdcmFileList; + GdcmFileList CoherentGdcmFileList; /// Ref to the current Serie Instance UID to avoid mixing two series /// within the same directory std::string CurrentSerieUID; diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 9d121654..39d0ba7b 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 16:19:57 $ - Version: $Revision: 1.112 $ + Date: $Date: 2005/01/21 11:40:56 $ + Version: $Revision: 1.113 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -670,7 +670,7 @@ std::string Util::GetIPAddress() // In this case we should maybe check the string was not truncated. // But I don't known how to check that... #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) - // with WinSock DLL we need to initialise the WinSock before using gethostname + // with WinSock DLL we need to initialize the WinSock before using gethostname WORD wVersionRequested = MAKEWORD(1,0); WSADATA WSAData; int err = WSAStartup(wVersionRequested,&WSAData); diff --git a/src/gdcmValEntry.h b/src/gdcmValEntry.h index a7ea3f5c..34275c6d 100644 --- a/src/gdcmValEntry.h +++ b/src/gdcmValEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.h,v $ Language: C++ - Date: $Date: 2005/01/16 04:50:42 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/01/21 11:40:56 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,8 +27,8 @@ namespace gdcm { //----------------------------------------------------------------------------- /** - * \brief Any Dicom Document (File Header or DicomDir) contains - * a set of DocEntry entries + * \brief Any Dicom Document (File header or DicomDir) contains + * a set of DocEntry - Dicom entries - * (when successfuly parsed against a given Dicom dictionary) * ValEntry is an elementary DocEntry (as opposed to SeqEntry) */ @@ -40,11 +40,11 @@ public: ~ValEntry(); /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a - /// 'string', event if it's stored as an integer in the header of the - /// current Dicom Document Entry + /// 'string', event if it's physically stored as an integer in the header of the + /// current Document (File or DicomDir) std::string const &GetValue() const { return Value; }; - /// Sets the value (string) of the current Dicom Document Entry. + /// Sets the value (string) of the current Dicom entry. /// The size is updated virtual void SetValue(std::string const &val); @@ -53,13 +53,13 @@ public: virtual void WriteContent(std::ofstream *fp, FileType filetype); protected: - /// Sets the value (string) of the current Dicom Document Entry + /// Sets the value (string) of the current Dicom entry void SetValueOnly(std::string const &val) { Value = val; }; private: // Members : - /// \brief Document Entry value, internaly represented as a std::string + /// \brief Dicom entry value, internaly represented as a std::string. /// The Value Representation (\ref VR) is independently used /// in order to interpret (decode) this field. std::string Value; diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index e6346dfc..6db14bad 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmReader.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 16:17:01 $ - Version: $Revision: 1.65 $ + Date: $Date: 2005/01/21 11:40:56 $ + Version: $Revision: 1.66 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -41,18 +41,18 @@ // is compared to this new value to find a modification in the class // parameters // 2b/ the core of ExecuteData then needs gdcmFile (which in turns -// initialises gdcmHeader in the constructor) in order to access +// initialises gdcmFile in the constructor) in order to access // the data-image. // // Possible solution: // maintain a list of gdcmFiles (created by say ExecuteInformation) created -// once and for all accross the life of vtkGdcmHeader (it would only load +// once and for all accross the life of vtkGdcmFile (it would only load // new gdcmFile if the user changes the list). ExecuteData would then use // those gdcmFile and hence avoid calling the construtor: // - advantage: the header of the files would only be parser once. // - drawback: once execute information is called (i.e. on creation of -// a vtkGdcmHeader) the gdcmFile structure is loaded in memory. -// The average size of a gdcmHeader being of 100Ko, is one +// a vtkGdcmFile) the gdcmFile structure is loaded in memory. +// The average size of a gdcmFile being of 100Ko, is one // loads 10 stacks of images with say 200 images each, you // end-up with a loss of 200Mo... // @@ -66,7 +66,7 @@ // ////////////////////////////////////////////////////////////// #include "gdcmFileHelper.h" -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "vtkGdcmReader.h" //#include @@ -75,7 +75,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.65 $"); +vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.66 $"); vtkStandardNewMacro(vtkGdcmReader); //----------------------------------------------------------------------------- @@ -461,8 +461,8 @@ int vtkGdcmReader::CheckFileCoherence() fclose(fp); // Stage 1.2: check for Gdcm parsability - gdcm::Header GdcmHeader(filename->c_str() ); - if (!GdcmHeader.IsReadable()) + gdcm::File GdcmFile(filename->c_str() ); + if (!GdcmFile.IsReadable()) { vtkErrorMacro(<< "Gdcm cannot parse file " << filename->c_str()); vtkErrorMacro(<< "Removing this file from readed files " @@ -472,7 +472,7 @@ int vtkGdcmReader::CheckFileCoherence() } // Stage 1.3: further gdcm compatibility on PixelType - std::string type = GdcmHeader.GetPixelType(); + std::string type = GdcmFile.GetPixelType(); if ( (type != "8U") && (type != "8S") && (type != "16U") && (type != "16S") && (type != "32U") && (type != "32S") ) @@ -486,9 +486,9 @@ int vtkGdcmReader::CheckFileCoherence() } // Stage 2: check coherence of the set of files - int NX = GdcmHeader.GetXSize(); - int NY = GdcmHeader.GetYSize(); - int NZ = GdcmHeader.GetZSize(); + int NX = GdcmFile.GetXSize(); + int NY = GdcmFile.GetYSize(); + int NZ = GdcmFile.GetZSize(); if (FoundReferenceFile) { // Stage 2.1: mandatory coherence stage: @@ -547,27 +547,27 @@ int vtkGdcmReader::CheckFileCoherence() ReferenceNZ = NZ; ReturnedTotalNumberOfPlanes += NZ - 1; // First plane already added this->ImageType = type; - this->PixelSize = GdcmHeader.GetPixelSize(); + this->PixelSize = GdcmFile.GetPixelSize(); - if( GdcmHeader.HasLUT() && this->AllowLookupTable ) + if( GdcmFile.HasLUT() && this->AllowLookupTable ) { // I could raise an error is AllowLookupTable is on and HasLUT() off - this->NumComponents = GdcmHeader.GetNumberOfScalarComponentsRaw(); + this->NumComponents = GdcmFile.GetNumberOfScalarComponentsRaw(); } else { - this->NumComponents = GdcmHeader.GetNumberOfScalarComponents(); //rgb or mono + this->NumComponents = GdcmFile.GetNumberOfScalarComponents(); //rgb or mono } //Set image spacing - this->DataSpacing[0] = GdcmHeader.GetXSpacing(); - this->DataSpacing[1] = GdcmHeader.GetYSpacing(); - this->DataSpacing[2] = GdcmHeader.GetZSpacing(); + this->DataSpacing[0] = GdcmFile.GetXSpacing(); + this->DataSpacing[1] = GdcmFile.GetYSpacing(); + this->DataSpacing[2] = GdcmFile.GetZSpacing(); //Set image origin - //this->DataOrigin[0] = GdcmHeader.GetXOrigin(); - //this->DataOrigin[1] = GdcmHeader.GetYOrigin(); - //this->DataOrigin[2] = GdcmHeader.GetZOrigin(); + //this->DataOrigin[0] = GdcmFile.GetXOrigin(); + //this->DataOrigin[1] = GdcmFile.GetYOrigin(); + //this->DataOrigin[2] = GdcmFile.GetZOrigin(); } } // End of loop on filename @@ -639,15 +639,15 @@ size_t vtkGdcmReader::LoadImageInMemory( // line comes first (for some axis related reasons?). Hence we need // to load the image line by line, starting from the end. - int numColumns = file.GetHeader()->GetXSize(); - int numLines = file.GetHeader()->GetYSize(); - int numPlanes = file.GetHeader()->GetZSize(); - int lineSize = NumComponents * numColumns * file.GetHeader()->GetPixelSize(); + int numColumns = file.GetFile()->GetXSize(); + int numLines = file.GetFile()->GetYSize(); + int numPlanes = file.GetFile()->GetZSize(); + int lineSize = NumComponents * numColumns * file.GetFile()->GetPixelSize(); int planeSize = lineSize * numLines; unsigned char *src; - if( file.GetHeader()->HasLUT() && AllowLookupTable ) + if( file.GetFile()->HasLUT() && AllowLookupTable ) { size = file.GetImageDataSize(); src = (unsigned char*) file.GetImageDataRaw(); diff --git a/vtk/vtkGdcmWriter.cxx b/vtk/vtkGdcmWriter.cxx index 9a1b14b1..e60ee267 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/20 16:31:43 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/21 11:40:56 $ + 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 @@ -16,7 +16,7 @@ =========================================================================*/ -#include "gdcmHeader.h" +#include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmDebug.h" #include "vtkGdcmWriter.h" @@ -26,7 +26,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.12 $"); +vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.13 $"); vtkStandardNewMacro(vtkGdcmWriter); //-----------------------------------------------------------------------------