From 3e82e8b67eddf5d4b95b6aa2a2e2615aced4c452 Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 2 Feb 2005 10:02:16 +0000 Subject: [PATCH] Normalization --- Example/BuildUpDicomDir.cxx | 6 ++-- Example/FindTags.cxx | 32 ++++++++--------- Example/FlatHashTablePrint.cxx | 10 +++--- Example/PrintDocument.cxx | 6 ++-- Example/PrintFile.cxx | 6 ++-- Example/TestChangeHeader.cxx | 6 ++-- Example/TestCopyDicom.cxx | 21 +++++------ Example/TestDcm2Acr.cxx | 27 +++++++------- Example/TestFromScratch.cxx | 10 +++--- Example/TestPapyrus.cxx | 12 +++---- Example/TestReadWriteReadCompare.cxx | 6 ++-- Example/TestWrite.cxx | 32 ++++++++--------- Example/TestWriteSimple.cxx | 8 ++--- Example/Volume2Dicom.cxx | 12 ++++--- Example/Write.cxx | 35 +++++++++--------- Example/WriteDicom.cxx | 8 ++--- Example/WriteDicomSimple.cxx | 6 ++-- Example/WriteRead.cxx | 33 ++++++++--------- Example/makeDicomDir.cxx | 7 ++-- Testing/CMakeLists.txt | 14 +++----- Testing/TestAllEntryVerify.cxx | 54 ++++++++++++++-------------- Testing/TestBug.cxx | 11 +++--- Testing/TestChangeHeader.cxx | 8 ++--- Testing/TestCopyDicom.cxx | 22 ++++++------ Testing/TestCopyRescaleDicom.cxx | 6 ++-- Testing/TestDicomDirElement.cxx | 6 ++-- Testing/TestDicomString.cxx | 9 ++--- Testing/TestDict.cxx | 10 +++--- Testing/TestDirList.cxx | 6 ++-- Testing/TestHash.cxx | 6 ++-- Testing/TestReadWriteReadCompare.cxx | 53 ++++++++++++++------------- Testing/TestTS.cxx | 17 +++++---- Testing/TestUtil.cxx | 6 ++-- Testing/TestVR.cxx | 8 ++--- Testing/TestWriteSimple.cxx | 10 +++--- Testing/VTKTestRead.cxx | 10 +++--- Testing/VTKTestReadSeq.cxx | 10 +++--- Testing/VTKTestWrite.cxx | 10 +++--- src/gdcmBinEntry.cxx | 12 +++---- src/gdcmContentEntry.cxx | 9 ++--- src/gdcmDebug.cxx | 7 ++-- src/gdcmDicomDir.cxx | 10 +++--- src/gdcmDicomDirPatient.cxx | 8 ++--- src/gdcmDicomDirStudy.cxx | 10 +++--- src/gdcmDictSet.cxx | 8 ++--- src/gdcmDocEntry.cxx | 10 +++--- src/gdcmDocEntrySet.cxx | 22 ++++++------ src/gdcmDocument.cxx | 23 ++++++------ src/gdcmFile.cxx | 16 ++++----- src/gdcmFileHelper.cxx | 6 ++-- src/gdcmJpeg.cxx | 10 +++--- src/gdcmPixelReadConvert.cxx | 38 ++++++++++---------- src/gdcmRLEFramesInfo.cxx | 26 ++++++++------ src/gdcmTS.cxx | 6 ++-- src/gdcmUtil.cxx | 8 ++--- src/gdcmValEntry.cxx | 13 +++---- 56 files changed, 401 insertions(+), 400 deletions(-) diff --git a/Example/BuildUpDicomDir.cxx b/Example/BuildUpDicomDir.cxx index 6de2f202..5fcbb33c 100644 --- a/Example/BuildUpDicomDir.cxx +++ b/Example/BuildUpDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: BuildUpDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:22 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/02/02 10:06:31 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -33,7 +33,7 @@ * and writes a file named NewDICOMDIR. */ -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string dirName = "NewDICOMDIR"; diff --git a/Example/FindTags.cxx b/Example/FindTags.cxx index 38d4b2e4..566c8634 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/25 15:44:22 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/02 10:06:31 $ + 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,24 +22,24 @@ #include #include // for sscanf -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - std::string toto, titi; + std::string fileName; gdcm::FileHelper *f1; if(argc > 1 ) f1 = new gdcm::FileHelper(argv[1]); else { - toto = GDCM_DATA_ROOT; - toto += "/test.acr"; - f1 = new gdcm::FileHelper(toto); + fileName = GDCM_DATA_ROOT; + fileName += "/test.acr"; + f1 = new gdcm::FileHelper(fileName); } std::string ManufacturerName="SIEMENS "; std::string RecCode="ACR-NEMA 2.0"; std::string ImagePositionPatient, Location, ImageLocation; - std::string zozo; + std::string fileNameToWrite; char c; float x, y, z, l; @@ -58,12 +58,12 @@ int main(int argc, char* argv[]) sscanf(ImagePositionPatient.c_str(), "%f%c%f%c%f", &x,&c,&y,&c,&z); -// ceci est probablement une mauvaise idée ! +// probablely a bad idea ! // (peut casser l'ordre des images si la pile d'images // traverse l'axe des X, ou des Y, ou des Z) //l=sqrt(x*x + y*y + z*z); -// ceci ne marchera pas si on se déplace à Z constant :-( +// Will not work if we move on a Z constant :-( l=z; // existerait-il qq chose qui marche à tout coup? @@ -77,7 +77,7 @@ int main(int argc, char* argv[]) // a eclaircir ! // SetEntryLength is private now. -//TO DO : see is the pb goes on... +//TO DO : see if the pb goes on... //f1->GetFile()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050); @@ -88,20 +88,20 @@ int main(int argc, char* argv[]) //f1->SetValEntry(Location, 0x0028,0x0200); //f1->GetFile()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence ! -// void* imageData= f1->GetImageData(); +// void *imageData= f1->GetImageData(); // ecriture d'un fichier ACR à partir d'un dcmFile correct. - std::cout << "----------------avant PrintEntry---------------------" << std::endl; + std::cout << "----------------before PrintEntry---------------------" << std::endl; f1->GetFile()->Print(); - std::cout << "----------------avant WriteDcm---------------------" << std::endl; + std::cout << "----------------before WriteDcm---------------------" << std::endl; // ecriture d'un fichier ACR à partir d'un dcmFile correct. - zozo = toto + ".acr"; + fileNameToWrite = fileName + ".acr"; std::cout << "WriteACR" << std::endl; - f1->WriteAcr(zozo); + f1->WriteAcr(fileNameToWrite); std::cout << "----------------apres Write---------------------" << std::endl; diff --git a/Example/FlatHashTablePrint.cxx b/Example/FlatHashTablePrint.cxx index fd134640..183ec8c1 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/21 11:40:52 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/02/02 10:06:31 $ + 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 @@ -22,7 +22,7 @@ // as line argument) and print them. This is an illustration of the // usage of \ref gdcmDocument::BuildFlatHashTable(). -int main(int , char* []) +int main(int, char*[]) { /* if (argc < 2) { @@ -31,8 +31,8 @@ int main(int , char* []) return 1; } - gdcm::File* header = new gdcm::File( argv[1] ); - gdcm::TagDocEntryHT* Ht = header->BuildFlatHashTable(); + 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 8d7a0aad..c2a6ceec 100644 --- a/Example/PrintDocument.cxx +++ b/Example/PrintDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/21 11:40:52 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/02 10:06:31 $ + 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 @@ -19,7 +19,7 @@ #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { gdcm::File *e1; diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index bb9789ab..f449c696 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/02/01 11:13:08 $ - Version: $Revision: 1.28 $ + Date: $Date: 2005/02/02 10:06:31 $ + Version: $Revision: 1.29 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,7 +21,7 @@ #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { gdcm::File *e1; gdcm::FileHelper *f1; diff --git a/Example/TestChangeHeader.cxx b/Example/TestChangeHeader.cxx index b8de5e27..4e8b7503 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/25 15:44:22 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/02 10:06:31 $ + 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 @@ -21,7 +21,7 @@ // This examples read two images (could be the same). Try to modify // Acquisition Matrix and then write the image again -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { if (argc < 3) { diff --git a/Example/TestCopyDicom.cxx b/Example/TestCopyDicom.cxx index 8e7a43b2..423a3ded 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/25 15:44:22 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/02/02 10:06:31 $ + 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 @@ -28,7 +28,7 @@ #endif // return true if the file exists -bool FileExists(const char* filename) +bool FileExists(const char *filename) { #ifdef _MSC_VER # define access _access @@ -46,7 +46,7 @@ bool FileExists(const char* filename) } } -bool RemoveFile(const char* source) +bool RemoveFile(const char *source) { #ifdef _MSC_VER #define _unlink unlink @@ -88,27 +88,22 @@ int main(int argc, char* argv[]) gdcm::FileHelper *copy = new gdcm::FileHelper( output ); size_t dataSize = original->GetImageDataSize(); - uint8_t* imageData = original->GetImageData(); + uint8_t *imageData = original->GetImageData(); (void)imageData; (void)dataSize; //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 File !) - // Waiting for a 'clean' solution, I keep the method ...JPRx - gdcm::DocEntry* d=original->GetFile()->GetFirstEntry(); + gdcm::DocEntry *d = original->GetFile()->GetFirstEntry(); while(d) { - if ( gdcm::BinEntry* b = dynamic_cast(d) ) + if ( gdcm::BinEntry *b = dynamic_cast(d) ) { copy->GetFile()->InsertBinEntry( b->GetBinArea(),b->GetLength(), b->GetGroup(),b->GetElement(), b->GetVR() ); } - else if ( gdcm::ValEntry* v = dynamic_cast(d) ) + else if ( gdcm::ValEntry *v = dynamic_cast(d) ) { copy->GetFile()->InsertValEntry( v->GetValue(), v->GetGroup(),v->GetElement(), diff --git a/Example/TestDcm2Acr.cxx b/Example/TestDcm2Acr.cxx index f16e9ef9..0582cbf6 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/21 11:40:52 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/02/02 10:06:31 $ + 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 @@ -20,20 +20,20 @@ #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - std::string toto; - std::string zozo; + std::string fileName; + std::string fileNameToWrite; - gdcm::FileHelper * f1; + gdcm::FileHelper *f1; std::cout << " Before gdcmFileHelper()" << std::endl; std::cout << "\n\n---------------------------------------" << std::endl; if (argc > 1) { - toto = argv[1]; - f1 = new gdcm::FileHelper(toto); + fileName = argv[1]; + f1 = new gdcm::FileHelper(fileName); } else { @@ -41,17 +41,14 @@ int main(int argc, char* argv[]) filename += "/test.acr"; f1 = new gdcm::FileHelper(filename); } - std::cout << " Sortie gdcmFileHelper()" << std::endl; + std::cout << " After gdcmFileHelper()" << std::endl; - //e1.PrintPubDict(std::cout); f1->GetFile()->Print(); - //cle = gdcmDictEntry::TranslateToKey(0x0028,0x0008); - int dataSize = f1->GetImageDataSize(); std::cout << "dataSize:" << dataSize << std::endl; - // void* imageData= f1->GetFile()->GetImageData(); + // void *imageData= f1->GetFile()->GetImageData(); // Ecriture d'un Raw File, a afficher avec affim filein= dim= nbit= signe= //f1->WriteRawData("image.raw"); @@ -62,8 +59,8 @@ int main(int argc, char* argv[]) // ecriture d'un fichier ACR à partir d'un dcmFile correct. - zozo = toto + ".nema"; - f1->WriteAcr(zozo); + fileNameToWrite = fileName + ".nema"; + f1->WriteAcr(fileNameToWrite); std::cout << "\n\n---------------------------------------\n\n" << std::endl; f1->GetFile()->Print(); diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index 0c8f32fd..7bb68847 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/02/01 11:13:08 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -49,16 +49,16 @@ int main(int argc, char *argv[]) int dataSize = f1->GetImageDataSize(); std::cout << "DataSize: " << dataSize << std::endl; // Since we know the image is 16bits: - uint8_t* imageData = f1->GetImageData(); + uint8_t *imageData = f1->GetImageData(); // Hopefully default to something gdcm::File *h2 = new gdcm::File(); // Copy of the header content - gdcm::DocEntry* d = h1->GetFirstEntry(); + gdcm::DocEntry *d = h1->GetFirstEntry(); while(d) { - if ( gdcm::ValEntry* v = dynamic_cast(d) ) + if ( gdcm::ValEntry *v = dynamic_cast(d) ) { // Do not bother with field from private dict if( v->GetName() != "gdcm::Unknown" ) diff --git a/Example/TestPapyrus.cxx b/Example/TestPapyrus.cxx index b64b6e52..28ad2245 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/02/01 10:34:59 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -34,7 +34,7 @@ #endif // return true if the file exists -bool FileExists(const char* filename) +bool FileExists(const char *filename) { #ifdef _MSC_VER # define access _access @@ -52,7 +52,7 @@ bool FileExists(const char* filename) } } -bool RemoveFile(const char* source) +bool RemoveFile(const char *source) { #ifdef _MSC_VER #define _unlink unlink @@ -68,7 +68,7 @@ bool RemoveFile(const char* source) // and we don't perform any integrity check // ---------------------------------------------------------------------- -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { if (argc < 3) { @@ -184,7 +184,7 @@ int main(int argc, char* argv[]) return 0; } // to be sure to be at the beginning - Fp->seekg(0, std::ios::end); + Fp->seekg(0, std::ios::end); uint32_t offset; std::string previousRows = Rows; diff --git a/Example/TestReadWriteReadCompare.cxx b/Example/TestReadWriteReadCompare.cxx index 79679194..98a3a08a 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/21 11:40:52 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -21,7 +21,7 @@ //Generated file: #include "gdcmDataImages.h" -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { if (argc<2) { diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index 8fce916b..ee92a4b1 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/24 16:10:49 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -22,12 +22,12 @@ int main(int argc, char *argv[]) { - std::string zozo; + std::string fileNameToWrite; gdcm::File *e1; gdcm::FileHelper *f1; - void* imageData; + void *imageData; int dataSize; if (argc < 3) { @@ -62,10 +62,10 @@ int main(int argc, char *argv[]) << "--------------------- file :" << argv[1] << std::endl; - std::string toto = argv[1]; + std::string fileName = argv[1]; std::string mode = argv[2]; - e1 = new gdcm::File( toto.c_str() ); + e1 = new gdcm::File( fileName.c_str() ); if (!e1->IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <WriteAcr(zozo); + f1->WriteAcr(fileNameToWrite); break; case 'd' : // Not document in the 'usage', because the method is knowed to be bugged. @@ -130,27 +130,27 @@ int main(int argc, char *argv[]) // ecriture d'un fichier DICOM Implicit VR // à partir d'un dcmFile correct. - zozo = toto + ".DCM"; + fileNameToWrite = fileName + ".DCM"; std::cout << "WriteDCM Implicit VR" << std::endl; - f1->WriteDcmImplVR(zozo); + f1->WriteDcmImplVR(fileNameToWrite); break; case 'x' : // ecriture d'un fichier DICOM Explicit VR // à partir d'un dcmFile correct. - zozo = toto + ".XDCM"; + fileNameToWrite = fileName + ".XDCM"; std::cout << "WriteDCM Explicit VR" << std::endl; - f1->WriteDcmExplVR(zozo); + f1->WriteDcmExplVR(fileNameToWrite); break; case 'r' : // Ecriture d'un Raw File, a afficher avec // affim filein= dimx= dimy= nbit= signe= - zozo = toto + ".RAW"; + fileNameToWrite = fileName + ".RAW"; std::cout << "WriteRaw" << std::endl; - f1->WriteRawData(zozo); + f1->WriteRawData(fileNameToWrite); break; case 'v' : @@ -171,9 +171,9 @@ int main(int argc, char *argv[]) ((uint16_t*)imageData)[i] += 60000; //32767; } } - zozo = toto + ".VDCM"; + fileNameToWrite = fileName + ".VDCM"; std::cout << "WriteDCM Explicit VR + VideoInv" << std::endl; - f1->WriteDcmExplVR(zozo); + f1->WriteDcmExplVR(fileNameToWrite); break; } diff --git a/Example/TestWriteSimple.cxx b/Example/TestWriteSimple.cxx index 7c76e13e..ee4f15f9 100644 --- a/Example/TestWriteSimple.cxx +++ b/Example/TestWriteSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWriteSimple.cxx,v $ Language: C++ - Date: $Date: 2005/01/22 12:39:11 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -18,7 +18,7 @@ #include "gdcmFile.h" #include "gdcmFileHelper.h" -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { if (argc < 3) { @@ -31,7 +31,7 @@ int main(int argc, char* argv[]) const char *output = argv[2]; gdcm::File *f1 = new gdcm::File( header ); - gdcm::FileHelper *f2 = new gdcm::FileHelper( f1 ); + 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 !? diff --git a/Example/Volume2Dicom.cxx b/Example/Volume2Dicom.cxx index 98bd8dc3..3b852d27 100644 --- a/Example/Volume2Dicom.cxx +++ b/Example/Volume2Dicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: Volume2Dicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/21 11:40:53 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -41,9 +41,10 @@ const unsigned int Dimension = 3; void gdcmwrite(const char *inputfile, std::string directory); -void GetFileDateAndTime(const char *inputfile, std::string &date, std::string &time); +void GetFileDateAndTime(const char *inputfile, + std::string &date, std::string &time); -int main( int argc, char * argv[] ) +int main( int argc, char *argv[] ) { if (argc < 2) { @@ -158,7 +159,8 @@ int main( int argc, char * argv[] ) // just an utility function to retrieve date and time of a file -void GetFileDateAndTime(const char *inputfile, std::string &date, std::string &time) +void GetFileDateAndTime(const char *inputfile, std::string &date, + std::string &time) { struct stat buf; if (stat(inputfile, &buf) == 0) diff --git a/Example/Write.cxx b/Example/Write.cxx index d2b6ca10..5a864870 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/24 16:10:49 $ - Version: $Revision: 1.18 $ + Date: $Date: 2005/02/02 10:06:32 $ + Version: $Revision: 1.19 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,15 +20,14 @@ #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - std::string zozo; + std::string FileNameToWrite; - gdcm::File* e1; - gdcm::FileHelper * f1; + gdcm::File *e1; + gdcm::FileHelper *f1; - //gdcmDocument * d; //not used - uint8_t* imageData; + uint8_t *imageData; int dataSize; if (argc < 3) { @@ -60,9 +59,9 @@ int main(int argc, char* argv[]) << "--------------------- file :" << argv[1] << std::endl; - std::string toto = argv[1]; + std::string FileName = argv[1]; - e1 = new gdcm::File( toto.c_str() ); + e1 = new gdcm::File( FileName.c_str() ); if (!e1->IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <WriteAcr(zozo); + f1->WriteAcr(FileNameToWrite); break; case 'd' : // ecriture d'un fichier DICOM Implicit VR // à partir d'un dcmFile correct. - zozo = toto + ".DCM"; + FileNameToWrite = FileName + ".DCM"; std::cout << "WriteDCM Implicit VR" << std::endl; - f1->WriteDcmImplVR(zozo); + f1->WriteDcmImplVR(FileNameToWrite); break; case 'x' : // ecriture d'un fichier DICOM Explicit VR // à partir d'un dcmFile correct. - zozo = toto + ".DCM"; + FileNameToWrite = FileName + ".DCM"; std::cout << "WriteDCM Implicit VR" << std::endl; - f1->WriteDcmExplVR(zozo); + f1->WriteDcmExplVR(FileNameToWrite); break; case 'r' : // Ecriture d'un Raw File, a afficher avec // affim filein= dimx= dimy= nbit= signe= - zozo = toto + ".RAW"; + FileNameToWrite = FileName + ".RAW"; std::cout << "WriteRaw" << std::endl; - f1->WriteRawData(zozo); + f1->WriteRawData(FileNameToWrite); break; } diff --git a/Example/WriteDicom.cxx b/Example/WriteDicom.cxx index e450f33f..406a00ac 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/25 15:44:22 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -21,7 +21,7 @@ // Writting of a DICOM file based on a correct dicom header // and data pixel of another image -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { if (argc < 3) @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) // and that does the job int dataSize = f2->GetImageDataSize(); - uint8_t* imageData = f2->GetImageData(); + uint8_t *imageData = f2->GetImageData(); std::cout << "dataSize :" << dataSize << std::endl; diff --git a/Example/WriteDicomSimple.cxx b/Example/WriteDicomSimple.cxx index f5b4e273..03ae9b3c 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/25 15:44:22 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -39,7 +39,7 @@ #define COLOR_WINDOW 256 #define COLOR_LEVEL 128 -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { if (argc < 3) { diff --git a/Example/WriteRead.cxx b/Example/WriteRead.cxx index b5a5a941..8ff10006 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/21 11:40:53 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -20,13 +20,14 @@ #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - std::string zozo; - - gdcm::File* e1, *e2; - gdcm::FileHelper * f1, *f2; + std::string fileNameToWrite; + gdcm::File *e1; + gdcm::File *e2; + gdcm::FileHelper *f1; + gdcm::FileHelper *f2; uint8_t* imageData, *imageData2; int dataSize, dataSize2; @@ -36,15 +37,15 @@ int main(int argc, char* argv[]) return 1; } - std::string toto = argv[1]; + std::string fileName = argv[1]; // --------------------- we read the input image std::cout << argv[1] << std::endl; - e1 = new gdcm::File( toto ); + e1 = new gdcm::File( fileName ); if (!e1->IsReadable()) { - std::cerr << "Sorry, " << toto <<" not a Readable DICOM / ACR File" + std::cerr << "Sorry, " << fileName <<" not a Readable DICOM / ACR File" <WriteDcmExplVR(zozo); + f1->WriteDcmExplVR(fileNameToWrite); // --------------------- we read the written image - e2 = new gdcm::File( zozo ); + e2 = new gdcm::File( fileNameToWrite ); if (!e2->IsReadable()) { - std::cerr << "Sorry, " << zozo << " not a Readable DICOM / ACR File" + std::cerr << "Sorry, " << fileNameToWrite << " not a Readable DICOM / ACR File" < MapEntryValues; -typedef MapEntryValues* MapEntryValuesPtr; +typedef MapEntryValues *MapEntryValuesPtr; typedef std::string FileNameType; typedef std::map< FileNameType, MapEntryValuesPtr > MapFileValuesType; @@ -61,21 +61,21 @@ public: bool Check( std::string fileName ); private: - bool AddKeyValuePairToMap( std::string& key, std::string& value ); + bool AddKeyValuePairToMap( std::string &key, std::string &value ); - std::istream& eatwhite(std::istream& is); - void eatwhite(std::string& toClean); - std::string ExtractFirstString(std::string& toSplit); - void CleanUpLine( std::string& line ); + std::istream& eatwhite(std::istream &is); + void eatwhite(std::string &toClean); + std::string ExtractFirstString(std::string &toSplit); + void CleanUpLine( std::string &line ); bool Check( MapFileValuesType::iterator &fileIt ); - std::string ExtractValue(std::string& toSplit) throw ( ParserException ); - void ParseRegularLine( std::string& line ) throw ( ParserException ); + std::string ExtractValue(std::string &toSplit) throw ( ParserException ); + void ParseRegularLine( std::string &line ) throw ( ParserException ); void FirstPassReferenceFile() throw ( ParserException ); bool SecondPassReferenceFile() throw ( ParserException ); - void HandleFileName( std::string& line ) throw ( ParserException ); - void HandleKey( std::string& line ) throw ( ParserException ); - bool HandleValue( std::string& line ) throw ( ParserException ); + void HandleFileName( std::string &line ) throw ( ParserException ); + void HandleKey( std::string &line ) throw ( ParserException ); + bool HandleValue( std::string &line ) throw ( ParserException ); static uint16_t axtoi( char* ); private: @@ -104,7 +104,7 @@ private: std::string CurrentValue; /// The current MapEntryValues pointer: - MapEntryValues* CurrentMapEntryValuesPtr; + MapEntryValues *CurrentMapEntryValuesPtr; }; ReferenceFileParser::ReferenceFileParser() @@ -160,13 +160,13 @@ uint16_t ReferenceFileParser::axtoi(char *hexStg) return intValue; } -void ReferenceFileParser::SetDataPath( std::string& inDataPath ) +void ReferenceFileParser::SetDataPath( std::string &inDataPath ) { DataPath = inDataPath; } -bool ReferenceFileParser::AddKeyValuePairToMap( std::string& key, - std::string& value ) +bool ReferenceFileParser::AddKeyValuePairToMap( std::string &key, + std::string &value ) { if ( !CurrentMapEntryValuesPtr ) return false; @@ -277,7 +277,7 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt ) return true; } -std::istream& ReferenceFileParser::eatwhite( std::istream& is ) +std::istream &ReferenceFileParser::eatwhite( std::istream &is ) { char c; while (is.get(c)) { @@ -295,7 +295,7 @@ void ReferenceFileParser::eatwhite( std::string& toClean ) toClean.erase( 0, toClean.find_first_of( " " ) + 1 ); } -std::string ReferenceFileParser::ExtractFirstString( std::string& toSplit ) +std::string ReferenceFileParser::ExtractFirstString( std::string &toSplit ) { std::string firstString; eatwhite( toSplit ); @@ -310,7 +310,7 @@ std::string ReferenceFileParser::ExtractFirstString( std::string& toSplit ) return firstString; } -std::string ReferenceFileParser::ExtractValue( std::string& toSplit ) +std::string ReferenceFileParser::ExtractValue( std::string &toSplit ) throw ( ParserException ) { eatwhite( toSplit ); @@ -477,7 +477,7 @@ void ReferenceFileParser::FirstPassReferenceFile() throw ( ParserException ) from.seekg( 0, std::ios::beg ); } -bool ReferenceFileParser::Open( std::string& referenceFileName ) +bool ReferenceFileParser::Open( std::string &referenceFileName ) { from.open( referenceFileName.c_str(), std::ios::in ); if ( !from.is_open() ) @@ -500,7 +500,7 @@ bool ReferenceFileParser::Open( std::string& referenceFileName ) return true; //?? } -void ReferenceFileParser::CleanUpLine( std::string& line ) +void ReferenceFileParser::CleanUpLine( std::string &line ) { // Cleanup from comments: if ( line.find_first_of( "#" ) != std::string::npos ) @@ -514,7 +514,7 @@ void ReferenceFileParser::CleanUpLine( std::string& line ) eatwhite( line ); } -void ReferenceFileParser::HandleFileName( std::string& line ) +void ReferenceFileParser::HandleFileName( std::string &line ) throw ( ParserException ) { if ( line.length() == 0 ) @@ -526,7 +526,7 @@ void ReferenceFileParser::HandleFileName( std::string& line ) CurrentFileName = ExtractFirstString(line); } -void ReferenceFileParser::HandleKey( std::string& line ) +void ReferenceFileParser::HandleKey( std::string &line ) throw ( ParserException ) { if ( CurrentKey.length() != 0 ) @@ -541,7 +541,7 @@ void ReferenceFileParser::HandleKey( std::string& line ) } } -bool ReferenceFileParser::HandleValue( std::string& line ) +bool ReferenceFileParser::HandleValue( std::string &line ) throw ( ParserException ) { if ( line.length() == 0 ) @@ -564,7 +564,7 @@ bool ReferenceFileParser::HandleValue( std::string& line ) return true; } -void ReferenceFileParser::ParseRegularLine( std::string& line) +void ReferenceFileParser::ParseRegularLine( std::string &line) throw ( ParserException ) { if ( line.length() == 0 ) @@ -648,7 +648,7 @@ bool ReferenceFileParser::SecondPassReferenceFile() return true; //?? } -int TestAllEntryVerify(int argc, char* argv[]) +int TestAllEntryVerify(int argc, char *argv[]) { if ( argc > 2 ) { diff --git a/Testing/TestBug.cxx b/Testing/TestBug.cxx index 4f918c73..4f5b7a28 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/21 11:40:54 $ - Version: $Revision: 1.18 $ + Date: $Date: 2005/02/02 10:05:26 $ + Version: $Revision: 1.19 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,9 +21,9 @@ #include "gdcmFile.h" -int TestBug(int argc, char* argv[]) +int TestBug(int argc, char *argv[]) { - gdcm::File* e1; + gdcm::File *e1; if (argc > 1) e1 = new gdcm::File( argv[1] ); @@ -32,8 +32,7 @@ int TestBug(int argc, char* argv[]) filename += "/test.acr"; e1 = new gdcm::File( filename.c_str() ); } - //e1->PrintPubDict(); - //e1->GetPubDict()->GetEntriesByKey(); + e1->GetPubDict()->Print(); delete e1; diff --git a/Testing/TestChangeHeader.cxx b/Testing/TestChangeHeader.cxx index 7d7723f2..e4898a0c 100644 --- a/Testing/TestChangeHeader.cxx +++ b/Testing/TestChangeHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestChangeHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:29:33 $ - Version: $Revision: 1.32 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -22,7 +22,7 @@ // and pixels of an other image -int TestChangeHeader(int argc, char* argv[]) +int TestChangeHeader(int argc, char *argv[]) { if (argc < 3) { @@ -77,7 +77,7 @@ int TestChangeHeader(int argc, char* argv[]) int dataSize = f2->GetImageDataSize(); printf ("dataSize %d\n",dataSize); - uint8_t* imageData= f2->GetImageData(); + uint8_t *imageData= f2->GetImageData(); // TODO : Why don't we merge theese 2 functions ? diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index 8c3ad749..d274440e 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/26 16:43:10 $ - Version: $Revision: 1.37 $ + Date: $Date: 2005/02/02 10:05:26 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -48,7 +48,7 @@ bool FileExists(const char* filename) } } -bool RemoveFile(const char* source) +bool RemoveFile(const char *source) { #ifdef _MSC_VER #define _unlink unlink @@ -56,8 +56,8 @@ bool RemoveFile(const char* source) return unlink(source) != 0 ? false : true; } -int CopyDicom(std::string const & filename, - std::string const & output ) +int CopyDicom(std::string const &filename, + std::string const &output ) { std::cout << " Testing: " << filename << std::endl; if( FileExists( output.c_str() ) ) @@ -78,16 +78,16 @@ int CopyDicom(std::string const & filename, //////////////// Step 2: std::cout << "2..."; - gdcm::DocEntry* d=originalH->GetFirstEntry(); + gdcm::DocEntry *d=originalH->GetFirstEntry(); while(d) { - if ( gdcm::BinEntry* b = dynamic_cast(d) ) + if ( gdcm::BinEntry *b = dynamic_cast(d) ) { copyH->InsertBinEntry( b->GetBinArea(),b->GetLength(), b->GetGroup(),b->GetElement(), b->GetVR() ); } - else if ( gdcm::ValEntry* v = dynamic_cast(d) ) + else if ( gdcm::ValEntry *v = dynamic_cast(d) ) { copyH->InsertValEntry( v->GetValue(), v->GetGroup(),v->GetElement(), @@ -105,7 +105,7 @@ int CopyDicom(std::string const & filename, gdcm::FileHelper *copy = new gdcm::FileHelper( copyH ); size_t dataSize = original->GetImageDataSize(); - uint8_t* imageData = original->GetImageData(); + uint8_t *imageData = original->GetImageData(); // Useless to set the image data, because it's already made when // copying the corresponding BinEntry that contains the pixel data @@ -149,7 +149,7 @@ int CopyDicom(std::string const & filename, //////////////// Step 5: std::cout << "5..."; size_t dataSizeWritten = copy->GetImageDataSize(); - uint8_t* imageDataWritten = copy->GetImageData(); + uint8_t *imageDataWritten = copy->GetImageData(); if (dataSize != dataSizeWritten) { @@ -188,7 +188,7 @@ int CopyDicom(std::string const & filename, // Here we load a gdcmFile and then try to create from scratch a copy of it, // copying field by field the dicom image -int TestCopyDicom(int argc, char* argv[]) +int TestCopyDicom(int argc, char *argv[]) { if ( argc == 3 ) { diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index dc9b2a92..f93f5e68 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/26 16:43:10 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -50,7 +50,7 @@ int CopyRescaleDicom(std::string const & filename, //////////////// Step 2: std::cout << "2..."; - // Copy of the header content + // Copy of the file content gdcm::DocEntry* d = originalF->GetFirstEntry(); while(d) { diff --git a/Testing/TestDicomDirElement.cxx b/Testing/TestDicomDirElement.cxx index ddea03e5..a5f1c9f7 100644 --- a/Testing/TestDicomDirElement.cxx +++ b/Testing/TestDicomDirElement.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomDirElement.cxx,v $ Language: C++ - Date: $Date: 2005/01/26 16:43:10 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -29,6 +29,8 @@ int TestDicomDirElement(int , char *[]) } ddElt->Print( std::cout ); + // TODO : User add an Entry (e.g Physician Name ) + delete ddElt; return 0; } diff --git a/Testing/TestDicomString.cxx b/Testing/TestDicomString.cxx index c778fa11..006d3b45 100644 --- a/Testing/TestDicomString.cxx +++ b/Testing/TestDicomString.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomString.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 23:18:31 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -18,7 +18,7 @@ #include "gdcmUtil.h" #include -int TestDicomString(int , char* []) +int TestDicomString(int, char *[]) { int i; const char *s = "\0\0"; @@ -36,7 +36,8 @@ std::string zeros(x, 0); char s1[] = "\0"; char s2[] = "\0\0"; char s3[] = "\0\0\0"; -char s4[] = "\0abc";*/ +char s4[] = "\0abc"; +*/ return 0; } diff --git a/Testing/TestDict.cxx b/Testing/TestDict.cxx index 54c87a5b..8cf93f70 100644 --- a/Testing/TestDict.cxx +++ b/Testing/TestDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDict.cxx,v $ Language: C++ - Date: $Date: 2005/01/26 16:43:10 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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,15 +23,15 @@ #include #include -int TestDict(int , char* []) +int TestDict(int , char *[]) { - std::cout << "-------- Test Default Dicom Dictionary : ----------" << std::endl; + std::cout << "----- Test Default Dicom Dictionary : ----------" << std::endl; // Just to improve test coverage: gdcm::Dict *tempDict = new gdcm::Dict("dummyFileNameThatDoesntExist"); // Default dict is supposed to be used. tempDict->Print(); - std::cout << "-------- end Test Default Dicom Dictionary : --------" << std::endl; + std::cout << "---- end Test Default Dicom Dictionary : -------" << std::endl; // Lets delete it. delete tempDict; diff --git a/Testing/TestDirList.cxx b/Testing/TestDirList.cxx index b60cdc38..cd34df8f 100644 --- a/Testing/TestDirList.cxx +++ b/Testing/TestDirList.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDirList.cxx,v $ Language: C++ - Date: $Date: 2005/01/14 23:57:06 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -17,7 +17,7 @@ =========================================================================*/ #include "gdcmDirList.h" -int TestDirList(int , char* []) +int TestDirList(int , char *[]) { std::string path = GDCM_DATA_ROOT; std::cerr << path << std::endl; diff --git a/Testing/TestHash.cxx b/Testing/TestHash.cxx index 28c6875e..385bb14d 100644 --- a/Testing/TestHash.cxx +++ b/Testing/TestHash.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestHash.cxx,v $ Language: C++ - Date: $Date: 2004/11/16 04:28:20 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -21,7 +21,7 @@ #include #include -int TestHash( int, char * [] ) +int TestHash( int, char *[] ) { std::cout << "Test::TestHash : " << std::endl; std::cout << " Checks that the basic STL functionalities required " diff --git a/Testing/TestReadWriteReadCompare.cxx b/Testing/TestReadWriteReadCompare.cxx index 468b8721..8a821950 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/21 11:40:54 $ - Version: $Revision: 1.20 $ + Date: $Date: 2005/02/02 10:05:26 $ + Version: $Revision: 1.21 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,21 +27,21 @@ int CompareInternal(std::string const & filename, std::string const & output) //////////////// Step 1 (see above description): - gdcm::File *header = new gdcm::File( filename ); - if( !header->IsReadable() ) + gdcm::File *file = new gdcm::File( filename ); + if( !file->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:" << filename << std::endl; - delete header; + delete file; return 1; } std::cout << " step 1..."; //////////////// Step 2: - gdcm::FileHelper* file = new gdcm::FileHelper( header ); - int dataSize = file->GetImageDataSize(); - uint8_t* imageData = file->GetImageData(); //EXTREMELY IMPORTANT + gdcm::FileHelper *filehelper = new gdcm::FileHelper( file ); + int dataSize = filehelper->GetImageDataSize(); + uint8_t *imageData = filehelper->GetImageData(); //EXTREMELY IMPORTANT // Sure, it is : It's up to the user to decide if he wants to // GetImageData or if he wants to GetImageDataRaw // (even if we do it by setting a flag, he will have to decide) @@ -62,46 +62,46 @@ int CompareInternal(std::string const & filename, std::string const & output) // --> I did. ctest doesn't break. But ... is it enought to say it's OK ? - file->SetImageData(imageData, dataSize); + filehelper->SetImageData(imageData, dataSize); - file->SetWriteModeToRGB(); - file->WriteDcmExplVR( output ); + filehelper->SetWriteModeToRGB(); + filehelper->WriteDcmExplVR( output ); std::cout << "2..."; //////////////// Step 3: - gdcm::FileHelper* reread = new gdcm::FileHelper( output ); + gdcm::FileHelper *reread = new gdcm::FileHelper( output ); if( !reread->GetFile()->IsReadable() ) { std::cerr << "Failed" << std::endl << "Test::TestReadWriteReadCompare: Could not reread image " << "written:" << filename << std::endl; - delete header; delete file; + delete filehelper; delete reread; return 1; } std::cout << "3..."; // For the next step: int dataSizeWritten = reread->GetImageDataSize(); - uint8_t* imageDataWritten = reread->GetImageData(); + uint8_t *imageDataWritten = reread->GetImageData(); //////////////// Step 4: // Test the image size - if (header->GetXSize() != reread->GetFile()->GetXSize() || - header->GetYSize() != reread->GetFile()->GetYSize() || - header->GetZSize() != reread->GetFile()->GetZSize()) + if (file->GetXSize() != reread->GetFile()->GetXSize() || + file->GetYSize() != reread->GetFile()->GetYSize() || + file->GetZSize() != reread->GetFile()->GetZSize()) { std::cout << "Failed" << std::endl << " X Size differs: " - << "X: " << header->GetXSize() << " # " + << "X: " << file->GetXSize() << " # " << reread->GetFile()->GetXSize() << " | " - << "Y: " << header->GetYSize() << " # " + << "Y: " << file->GetYSize() << " # " << reread->GetFile()->GetYSize() << " | " - << "Z: " << header->GetZSize() << " # " + << "Z: " << file->GetZSize() << " # " << reread->GetFile()->GetZSize() << std::endl; - delete header; delete file; + delete filehelper; delete reread; return 1; } @@ -112,34 +112,33 @@ int CompareInternal(std::string const & filename, std::string const & output) std::cout << "Failed" << std::endl << " Pixel areas lengths differ: " << dataSize << " # " << dataSizeWritten << std::endl; - delete header; delete file; + delete filehelper; delete reread; return 1; } // Test the data's content - if (int res = memcmp(imageData, imageDataWritten, dataSize) !=0) + if (memcmp(imageData, imageDataWritten, dataSize) !=0) { - (void)res; std::cout << "Failed" << std::endl << " Pixel differ (as expanded in memory)." << std::endl; - delete header; delete file; + delete filehelper; delete reread; return 1; } std::cout << "4...OK." << std::endl ; //////////////// Clean up: - delete header; delete file; + delete filehelper; delete reread; return 0; } -int TestReadWriteReadCompare(int argc, char* argv[]) +int TestReadWriteReadCompare(int argc, char *argv[]) { int result = 0; if (argc == 3) diff --git a/Testing/TestTS.cxx b/Testing/TestTS.cxx index 77d528b9..7b3c457c 100644 --- a/Testing/TestTS.cxx +++ b/Testing/TestTS.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestTS.cxx,v $ Language: C++ - Date: $Date: 2005/01/23 10:12:32 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -46,7 +46,8 @@ int TestTS(int , char *[]) std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.55" ) << std::endl; // JPEG Lossless, Non-Hierarchical (Process 14) std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.57" ) << std::endl; - // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1]) + // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, + // [Selection Value 1]) std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.70" ) << std::endl; // JPEG 2000 Lossless std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.90" ) << std::endl; @@ -61,14 +62,16 @@ int TestTS(int , char *[]) std::cout << "Test TS:" << std::endl; std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.4.55") << std::endl; //if ( key == "1.2.840.10008.1.2.4.55" -// || key == "1.2.840.10008.1.2.4.57" -// || key == "1.2.840.10008.1.2.4.70" ) +// || key == "1.2.840.10008.1.2.4.57" +// || key == "1.2.840.10008.1.2.4.70" ) std::cout << ts.IsRLELossless( "1.2.840.10008.1.2.5") << std::endl; std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl; std::cout << ts.IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl; std::cout << ts.IsJPEG( "1.2.840.10008.1.2.5") << std::endl; - std::cout << ts.GetSpecialTransferSyntax( ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl; - std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" ) << std::endl; + std::cout << ts.GetSpecialTransferSyntax( + ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl; + std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" ) + << std::endl; return ts.GetValue( "" ) != gdcm::GDCM_UNFOUND; } diff --git a/Testing/TestUtil.cxx b/Testing/TestUtil.cxx index 969d28d7..9574fece 100644 --- a/Testing/TestUtil.cxx +++ b/Testing/TestUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestUtil.cxx,v $ Language: C++ - Date: $Date: 2005/01/27 12:02:26 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -22,7 +22,7 @@ #include "gdcmDebug.h" #include -int TestUtil(int , char * []) +int TestUtil(int , char *[]) { // Time std::cout << "Time:" << gdcm::Util::GetCurrentDateTime() << std::endl; diff --git a/Testing/TestVR.cxx b/Testing/TestVR.cxx index ddcee2d3..36710c63 100644 --- a/Testing/TestVR.cxx +++ b/Testing/TestVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestVR.cxx,v $ Language: C++ - Date: $Date: 2005/01/28 09:31:51 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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,7 +31,7 @@ int TestVR(int , char *[]) gdcm::VR *vr = new gdcm::VR(); - // There should be 16 entries + // There should be 16 entries ... vr->Print( std::cout ); vr->IsVROfStringRepresentable( "PN" ); @@ -41,7 +41,7 @@ int TestVR(int , char *[]) vr->IsVROfBinaryRepresentable( "PN" ); vr->IsVROfSequence( "" ); - + vr->IsVROfSequence( "SQ" ); delete vr; return 0; } diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index 60b31813..51d04094 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/26 16:43:10 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -200,7 +200,7 @@ int WriteSimple(Image &img) // Step 5 : Read the written image std::cout << "5..."; - gdcm::FileHelper* reread = new gdcm::FileHelper( fileName ); + gdcm::FileHelper *reread = new gdcm::FileHelper( fileName ); if( !reread->GetFile()->IsReadable() ) { std::cerr << "Failed" << std::endl @@ -215,7 +215,7 @@ int WriteSimple(Image &img) // Step 6 : Compare to the written image std::cout << "6..."; size_t dataSizeWritten = reread->GetImageDataSize(); - uint8_t* imageDataWritten = reread->GetImageData(); + uint8_t *imageDataWritten = reread->GetImageData(); // Test the image size if (fileToBuild->GetXSize() != reread->GetFile()->GetXSize() || @@ -276,7 +276,7 @@ int WriteSimple(Image &img) return 0; } -int TestWriteSimple(int argc, char* argv[]) +int TestWriteSimple(int argc, char *argv[]) { if (argc < 1) { diff --git a/Testing/VTKTestRead.cxx b/Testing/VTKTestRead.cxx index 3ac95d26..89015c9e 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/25 15:45:49 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -37,8 +37,8 @@ #endif int VTKReadTest(vtkTesting *t,vtkImageViewer *viewer, - std::string const & filename, - std::string const & referenceFileName) + std::string const &filename, + std::string const &referenceFileName) { int retVal = 0; //by default this is an error @@ -194,7 +194,7 @@ int VTKTestRead(int argc, char *argv[]) } int ret = 0; - vtkTesting* t = vtkTesting::New(); + vtkTesting *t = vtkTesting::New(); vtkImageViewer *viewer; if( show ) viewer = vtkImageViewer::New(); diff --git a/Testing/VTKTestReadSeq.cxx b/Testing/VTKTestReadSeq.cxx index 1bc77c1d..e7a35127 100644 --- a/Testing/VTKTestReadSeq.cxx +++ b/Testing/VTKTestReadSeq.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: VTKTestReadSeq.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:45:49 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -34,9 +34,9 @@ #define vtkFloatingPointType float #endif -int VTKReadSeqTest(vtkTesting *t,vtkImageViewer *viewer, - std::string const & filename, - std::string const & referenceFileName) +int VTKReadSeqTest(vtkTesting *t, vtkImageViewer *viewer, + std::string const &filename, + std::string const &referenceFileName) { int retVal = 0; //by default this is an error diff --git a/Testing/VTKTestWrite.cxx b/Testing/VTKTestWrite.cxx index 0ec988e6..ea204cf1 100644 --- a/Testing/VTKTestWrite.cxx +++ b/Testing/VTKTestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: VTKTestWrite.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:45:49 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/02/02 10:05:26 $ + 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 @@ -36,8 +36,8 @@ #endif int VTKWriteTest(vtkTesting *t,vtkImageViewer *viewer, - std::string const & filename, - std::string const & referenceFileName) + std::string const &filename, + std::string const &referenceFileName) { int retVal = 0; //by default this is an error @@ -197,7 +197,7 @@ int VTKTestWrite(int argc, char *argv[]) } int ret = 0; - vtkTesting* t = vtkTesting::New(); + vtkTesting *t = vtkTesting::New(); vtkImageViewer *viewer; if( show ) viewer = vtkImageViewer::New(); diff --git a/src/gdcmBinEntry.cxx b/src/gdcmBinEntry.cxx index 37e9267f..e4460c60 100644 --- a/src/gdcmBinEntry.cxx +++ b/src/gdcmBinEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBinEntry.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:54 $ - Version: $Revision: 1.60 $ + Date: $Date: 2005/02/02 10:02:16 $ + Version: $Revision: 1.61 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -32,7 +32,8 @@ namespace gdcm /** * \brief Constructor from a given BinEntry */ -BinEntry::BinEntry(DictEntry *e) : ContentEntry(e) +BinEntry::BinEntry(DictEntry *e) + :ContentEntry(e) { BinArea = 0; SelfArea = true; @@ -42,7 +43,8 @@ BinEntry::BinEntry(DictEntry *e) : ContentEntry(e) * \brief Constructor from a given BinEntry * @param e Pointer to existing Doc entry */ -BinEntry::BinEntry(DocEntry *e) : ContentEntry(e->GetDictEntry()) +BinEntry::BinEntry(DocEntry *e) + : ContentEntry(e->GetDictEntry()) { Copy(e); @@ -168,7 +170,6 @@ void BinEntry::Print(std::ostream &os, std::string const & ) void* binArea = GetBinArea(); if (binArea) { - //s << " [" << GDCM_BINLOADED s << " [" << GetValue() << "; length = " << GetLength() << "]"; } @@ -180,7 +181,6 @@ void BinEntry::Print(std::ostream &os, std::string const & ) } else { - //s << " [gdcm::Binary data NOT loaded]"; s << " [" <GetDictEntry()) + : DocEntry(e->GetDictEntry()) { Copy(e); } diff --git a/src/gdcmDebug.cxx b/src/gdcmDebug.cxx index f9a9adde..3e9ca4e2 100644 --- a/src/gdcmDebug.cxx +++ b/src/gdcmDebug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 13:00:16 $ - Version: $Revision: 1.21 $ + Date: $Date: 2005/02/02 10:02:16 $ + Version: $Revision: 1.22 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -57,7 +57,6 @@ void Debug::SetDebugFlag (bool flag) /** * \brief Gets the debug flag value - * @param level Get the debug flag * @return debug flag value */ bool Debug::GetDebugFlag () @@ -84,7 +83,7 @@ bool Debug::GetDebugToFile () /** * \brief Set Accessor - * @param flag Set the debug flag to redirect to file + * @param filename File to redirect debug info * Absolutely nothing is check. You have to pass in * a correct filename */ diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index f6582801..1c205cb9 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/02/01 13:00:16 $ - Version: $Revision: 1.125 $ + Date: $Date: 2005/02/02 10:02:16 $ + Version: $Revision: 1.126 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -59,7 +59,7 @@ namespace gdcm * \brief Constructor : creates an empty DicomDir */ DicomDir::DicomDir() - :Document( ) + :Document( ) { Initialize(); // sets all private fields to NULL NewMeta(); @@ -68,7 +68,7 @@ DicomDir::DicomDir() /** * \brief Constructor Parses recursively the directory and creates the DicomDir * or uses an already built DICOMDIR, depending on 'parseDir' value. - * @param fileName name + * @param fileName name * - of the root directory (parseDir = true) * - of the DICOMDIR (parseDir = false) * @param parseDir boolean @@ -378,7 +378,7 @@ bool DicomDir::WriteDicomDir(std::string const &fileName) * \brief create a Document-like chained list from a root Directory * @param path entry point of the tree-like structure */ -void DicomDir::CreateDicomDirChainedList(std::string const & path) +void DicomDir::CreateDicomDirChainedList(std::string const &path) { CallStartMethod(); DirList dirList(path,1); // gets recursively the file list diff --git a/src/gdcmDicomDirPatient.cxx b/src/gdcmDicomDirPatient.cxx index c35b2f10..58ad1294 100644 --- a/src/gdcmDicomDirPatient.cxx +++ b/src/gdcmDicomDirPatient.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirPatient.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:55 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/02/02 10:02:16 $ + 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 @@ -31,8 +31,8 @@ namespace gdcm * \brief Constructor * \note End user must use : DicomDir::NewPatient() */ -DicomDirPatient::DicomDirPatient(bool empty): - DicomDirObject() +DicomDirPatient::DicomDirPatient(bool empty) + :DicomDirObject() { if( !empty ) { diff --git a/src/gdcmDicomDirStudy.cxx b/src/gdcmDicomDirStudy.cxx index 0c6fab78..5d30d595 100644 --- a/src/gdcmDicomDirStudy.cxx +++ b/src/gdcmDicomDirStudy.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirStudy.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:55 $ - Version: $Revision: 1.35 $ + Date: $Date: 2005/02/02 10:02:16 $ + Version: $Revision: 1.36 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,8 +30,8 @@ namespace gdcm * \brief Constructor * \note End user must use : DicomDirPatient::NewStudy() */ -DicomDirStudy::DicomDirStudy(bool empty): - DicomDirObject() +DicomDirStudy::DicomDirStudy(bool empty) + :DicomDirObject() { if( !empty ) { @@ -75,7 +75,7 @@ void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t) */ DicomDirSerie *DicomDirStudy::NewSerie() { - DicomDirSerie* st = new DicomDirSerie(); + DicomDirSerie *st = new DicomDirSerie(); Series.push_back(st); return st; } diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 02063318..7256c6b1 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:55 $ - Version: $Revision: 1.57 $ + Date: $Date: 2005/02/02 10:02:16 $ + Version: $Revision: 1.58 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -69,8 +69,8 @@ DictSet::~DictSet() * @param name Symbolic name that be used as identifier of the newly * created dictionary. */ -Dict *DictSet::LoadDictFromFile(std::string const & filename, - DictKey const & name) +Dict *DictSet::LoadDictFromFile(std::string const &filename, + DictKey const &name) { Dict *newDict = new Dict(filename); AppendDict(newDict, name); diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index d90383c0..3e218c41 100644 --- a/src/gdcmDocEntry.cxx +++ b/src/gdcmDocEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:55 $ - Version: $Revision: 1.50 $ + Date: $Date: 2005/02/02 10:02:17 $ + 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 @@ -60,7 +60,7 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype) { uint32_t ffff = 0xffffffff; uint16_t group = GetGroup(); - VRKey vr = GetVR(); + VRKey vr = GetVR(); uint16_t el = GetElement(); uint32_t lgr = GetLength(); @@ -74,8 +74,8 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype) // // ----------- Writes the common part // - binary_write( *fp, group); //group - binary_write( *fp, el); //element + binary_write( *fp, group); //group number + binary_write( *fp, el); //element number if ( filetype == ExplicitVR ) { diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index e2370812..9f4d7c42 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:55 $ - Version: $Revision: 1.50 $ + Date: $Date: 2005/02/02 10:02:17 $ + 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 @@ -56,7 +56,7 @@ std::string DocEntrySet::GetEntryValue(uint16_t group, uint16_t elem) */ void *DocEntrySet::GetEntryBinArea(uint16_t group, uint16_t elem) { - BinEntry *entry = GetBinEntry(group,elem); + BinEntry *entry = GetBinEntry(group, elem); if( entry ) return entry->GetBinArea(); return 0; @@ -72,7 +72,7 @@ void *DocEntrySet::GetEntryBinArea(uint16_t group, uint16_t elem) */ int DocEntrySet::GetEntryLength(uint16_t group, uint16_t elem) { - DocEntry *entry = GetDocEntry(group,elem); + DocEntry *entry = GetDocEntry(group, elem); if( entry ) return entry->GetLength(); return -1; @@ -93,7 +93,7 @@ int DocEntrySet::GetEntryLength(uint16_t group, uint16_t elem) */ std::string DocEntrySet::GetEntryVR(uint16_t group, uint16_t elem) { - DocEntry *entry = GetDocEntry(group,elem); + DocEntry *entry = GetDocEntry(group, elem); if( entry ) return entry->GetVR(); return GDCM_UNFOUND; @@ -166,7 +166,7 @@ SeqEntry *DocEntrySet::GetSeqEntry(uint16_t group, uint16_t elem) * @param group group number of the Dicom Element to modify * @param elem element number of the Dicom Element to modify */ -bool DocEntrySet::SetValEntry(std::string const& content, +bool DocEntrySet::SetValEntry(std::string const &content, uint16_t group, uint16_t elem) { ValEntry *entry = GetValEntry(group, elem); @@ -305,7 +305,7 @@ ValEntry *DocEntrySet::InsertValEntry(std::string const &value, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -BinEntry *DocEntrySet::InsertBinEntry(uint8_t *binArea,int lgth, +BinEntry *DocEntrySet::InsertBinEntry(uint8_t *binArea, int lgth, uint16_t group, uint16_t elem, TagName const &vr ) { @@ -479,8 +479,8 @@ ValEntry *DocEntrySet::NewValEntry(uint16_t group,uint16_t elem, * @param elem element number of the new Entry * @param vr VR of the new Entry */ -BinEntry *DocEntrySet::NewBinEntry(uint16_t group,uint16_t elem, - TagName const & vr) +BinEntry *DocEntrySet::NewBinEntry(uint16_t group, uint16_t elem, + TagName const &vr) { DictEntry *dictEntry = GetDictEntry(group, elem, vr); gdcmAssertMacro(dictEntry); @@ -501,7 +501,7 @@ BinEntry *DocEntrySet::NewBinEntry(uint16_t group,uint16_t elem, * @param group group number of the new Entry * @param elem element number of the new Entry */ -SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group,uint16_t elem) +SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group, uint16_t elem) { DictEntry *dictEntry = GetDictEntry(group, elem, "SQ"); gdcmAssertMacro(dictEntry); @@ -551,7 +551,7 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem) * @return Corresponding DictEntry when it exists, NULL otherwise. */ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem, - TagName const & vr) + TagName const &vr) { DictEntry *dictEntry = GetDictEntry(group,elem); DictEntry *goodEntry = dictEntry; diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index afd0e6ef..0f76b64a 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:55 $ - Version: $Revision: 1.218 $ + Date: $Date: 2005/02/02 10:02:17 $ + Version: $Revision: 1.219 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -57,7 +57,8 @@ const unsigned int Document::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff; * \brief constructor * @param filename 'Document' (File or DicomDir) to be opened for parsing */ -Document::Document( std::string const &filename ) : ElementSet(-1) +Document::Document( std::string const &filename ) + :ElementSet(-1) { SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); Filename = filename; @@ -74,10 +75,10 @@ Document::Document( std::string const &filename ) : ElementSet(-1) gdcmVerboseMacro( "Starting parsing of file: " << Filename.c_str()); // Fp->seekg( 0, std::ios::beg); - Fp->seekg(0, std::ios::end); + Fp->seekg(0, std::ios::end); long lgt = Fp->tellg(); - Fp->seekg( 0, std::ios::beg); + Fp->seekg(0, std::ios::beg); CheckSwap(); long beg = Fp->tellg(); @@ -153,7 +154,8 @@ Document::Document( std::string const &filename ) : ElementSet(-1) * \brief This default constructor doesn't parse the file. You should * then invoke \ref Document::SetFileName and then the parsing. */ -Document::Document() : ElementSet(-1) +Document::Document() + :ElementSet(-1) { Fp = 0; @@ -1602,10 +1604,10 @@ void Document::FixDocEntryFoundLength(DocEntry *entry, */ bool Document::IsDocEntryAnInteger(DocEntry *entry) { - uint16_t elem = entry->GetElement(); - uint16_t group = entry->GetGroup(); + uint16_t elem = entry->GetElement(); + uint16_t group = entry->GetGroup(); const std::string &vr = entry->GetVR(); - uint32_t length = entry->GetLength(); + uint32_t length = entry->GetLength(); // When we have some semantics on the element we just read, and if we // a priori know we are dealing with an integer, then we shall be @@ -1648,7 +1650,7 @@ void Document::Initialize() { RefPubDict = Global::GetDicts()->GetDefaultPubDict(); RefShaDict = NULL; - Filetype = Unknown; + Filetype = Unknown; } /** @@ -1918,7 +1920,6 @@ DocEntry *Document::ReadNextDocEntry() { // We reached the EOF (or an error occured) therefore // header parsing has to be considered as finished. - //std::cout << e; return 0; } diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index cf11b665..0b31c5ce 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/02/01 10:29:55 $ - Version: $Revision: 1.206 $ + Date: $Date: 2005/02/02 10:02:17 $ + Version: $Revision: 1.207 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,8 +37,8 @@ namespace gdcm * \brief Constructor * @param filename name of the file whose header we want to analyze */ -File::File( std::string const &filename ): - Document( filename ) +File::File( std::string const &filename ) + :Document( filename ) { RLEInfo = new RLEFramesInfo; JPEGInfo = new JPEGFragmentsInfo; @@ -248,7 +248,7 @@ bool File::Write(std::string fileName, FileType filetype) BinEntry *b = GetBinEntry(GrPixel,NumPixel); if ( GetPixelSize() == 16 ) { - uint16_t *im16 = (uint16_t*)b->GetBinArea(); + uint16_t *im16 = (uint16_t *)b->GetBinArea(); int lgr = b->GetLength(); for( int i = 0; i < lgr / 2; i++ ) { @@ -258,7 +258,7 @@ bool File::Write(std::string fileName, FileType filetype) #endif //GDCM_WORDS_BIGENDIAN */ - Document::WriteContent(fp,filetype); + Document::WriteContent(fp, filetype); /* #ifdef GDCM_WORDS_BIGENDIAN @@ -928,7 +928,7 @@ int File::GetBitsAllocated() */ int File::GetSamplesPerPixel() { - const std::string& strSize = GetEntryValue(0x0028,0x0002); + const std::string &strSize = GetEntryValue(0x0028,0x0002); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro( "(0028,0002) is supposed to be mandatory"); @@ -945,7 +945,7 @@ int File::GetSamplesPerPixel() */ bool File::IsMonochrome() { - const std::string& PhotometricInterp = GetEntryValue( 0x0028, 0x0004 ); + const std::string &PhotometricInterp = GetEntryValue( 0x0028, 0x0004 ); if ( Util::DicomStringEqual(PhotometricInterp, "MONOCHROME1") || Util::DicomStringEqual(PhotometricInterp, "MONOCHROME2") ) { diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 33d9f0f8..fb243911 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/02/01 10:29:55 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/02/02 10:02:18 $ + 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 @@ -88,7 +88,7 @@ FileHelper::FileHelper(File *header) * seen as a side effect). * @param filename file to be opened for parsing */ -FileHelper::FileHelper(std::string const & filename ) +FileHelper::FileHelper(std::string const &filename ) { FileInternal = new File( filename ); SelfHeader = true; diff --git a/src/gdcmJpeg.cxx b/src/gdcmJpeg.cxx index 66a6dca6..762de9d4 100644 --- a/src/gdcmJpeg.cxx +++ b/src/gdcmJpeg.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJpeg.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 04:00:04 $ - Version: $Revision: 1.39 $ + Date: $Date: 2005/02/02 10:02:18 $ + 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 @@ -56,11 +56,11 @@ namespace gdcm * @return 1 on success, 0 on error */ -bool gdcm_write_JPEG_file (std::ofstream* fp, void* im_buf, +bool gdcm_write_JPEG_file (std::ofstream *fp, void *im_buf, int image_width, int image_height, int quality) { - JSAMPLE* image_buffer = (JSAMPLE*) im_buf; + JSAMPLE *image_buffer = (JSAMPLE*) im_buf; /* This struct contains the JPEG compression parameters and pointers to * working space (which is allocated as needed by the JPEG library). @@ -208,7 +208,7 @@ METHODDEF(void) my_error_exit (j_common_ptr cinfo) { * @return 1 on success, 0 on error */ void *SampBuffer; -bool JPEGFragment::ReadJPEGFile (std::ifstream* fp, void* image_buffer , int& statesuspension) +bool JPEGFragment::ReadJPEGFile (std::ifstream *fp, void *image_buffer, int &statesuspension) { pImage = (uint8_t*)image_buffer; // This struct contains the JPEG decompression parameters and pointers to diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index 27ff8e2b..db3880e4 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/02/01 10:29:55 $ - Version: $Revision: 1.43 $ + Date: $Date: 2005/02/02 10:02:18 $ + Version: $Revision: 1.44 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,14 +37,14 @@ namespace gdcm // Constructor / Destructor PixelReadConvert::PixelReadConvert() { - RGB = 0; - RGBSize = 0; - Raw = 0; - RawSize = 0; - LutRGBA = 0; - LutRedData = 0; + RGB = 0; + RGBSize = 0; + Raw = 0; + RawSize = 0; + LutRGBA = 0; + LutRedData = 0; LutGreenData = 0; - LutBlueData =0; + LutBlueData = 0; } PixelReadConvert::~PixelReadConvert() @@ -91,7 +91,7 @@ void PixelReadConvert::ReadAndDecompress12BitsTo16Bits( std::ifstream *fp ) throw ( FormatError ) { int nbPixels = XSize * YSize; - uint16_t* localDecompres = (uint16_t*)Raw; + uint16_t *localDecompres = (uint16_t*)Raw; for( int p = 0; p < nbPixels; p += 2 ) { @@ -163,7 +163,7 @@ void PixelReadConvert::ConvertSwapZone() uint32_t s32; uint16_t high; uint16_t low; - uint32_t* im32 = (uint32_t*)Raw; + uint32_t *im32 = (uint32_t*)Raw; switch ( SwapCode ) { case 1234: @@ -279,7 +279,7 @@ bool PixelReadConvert::ConvertReArrangeBits() throw ( FormatError ) { uint16_t mask = 0xffff; mask = mask >> ( BitsAllocated - BitsStored ); - uint16_t* deb = (uint16_t*)Raw; + uint16_t *deb = (uint16_t*)Raw; for(int i = 0; i> (BitsStored - HighBitPosition - 1)) & mask; @@ -290,7 +290,7 @@ bool PixelReadConvert::ConvertReArrangeBits() throw ( FormatError ) { uint32_t mask = 0xffffffff; mask = mask >> ( BitsAllocated - BitsStored ); - uint32_t* deb = (uint32_t*)Raw; + uint32_t *deb = (uint32_t*)Raw; for(int i = 0; i> (BitsStored - HighBitPosition - 1)) & mask; @@ -372,9 +372,9 @@ void PixelReadConvert::ConvertRGBPlanesToRGBPixels() int l = XSize * YSize * ZSize; - uint8_t* a = copyRaw; - uint8_t* b = copyRaw + l; - uint8_t* c = copyRaw + l + l; + uint8_t *a = copyRaw; + uint8_t *b = copyRaw + l; + uint8_t *c = copyRaw + l + l; for (int j = 0; j < l; j++) { @@ -790,7 +790,7 @@ void PixelReadConvert::BuildLUTRGBA() // We give up the checking to avoid some (useless ?) overhead // (optimistic asumption) int i; - uint8_t* a = LutRGBA + 0; + uint8_t *a = LutRGBA + 0; for( i=0; i < lengthR; ++i ) { *a = LutRedData[i*mult+1]; @@ -845,7 +845,7 @@ bool PixelReadConvert::BuildRGBImage() // Build RGB Pixels AllocateRGB(); - uint8_t* localRGB = RGB; + uint8_t *localRGB = RGB; for (size_t i = 0; i < RawSize; ++i ) { int j = Raw[i] * 4; @@ -869,7 +869,7 @@ bool PixelReadConvert::BuildRGBImage() * @param indent Indentation string to be prepended during printing. * @param os Stream to print to. */ -void PixelReadConvert::Print( std::ostream &os, std::string const & indent ) +void PixelReadConvert::Print( std::ostream &os, std::string const &indent ) { os << indent << "--- Pixel information -------------------------" diff --git a/src/gdcmRLEFramesInfo.cxx b/src/gdcmRLEFramesInfo.cxx index b9337640..26797b4d 100644 --- a/src/gdcmRLEFramesInfo.cxx +++ b/src/gdcmRLEFramesInfo.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 13:00:16 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/02 10:02:18 $ + 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 @@ -62,9 +62,15 @@ RLEFrame *RLEFramesInfo::GetNextFrame() * Dicom encapsulated file and decompress it. * @param fp already open File Pointer * at which the pixel data should be copied + * @param raw raw + * @param xSize x Size + * @param ySize y Size + * @param BitsAllocated Bits allocated * @return Boolean */ -bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, int xSize, int ySize, int zSize, int bitsAllocated ) +bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, + int xSize, int ySize, int zSize, + int bitsAllocated ) { uint8_t *subRaw = raw; long rawSegmentSize = xSize * ySize; @@ -94,8 +100,8 @@ bool RLEFramesInfo::DecompressRLEFile( std::ifstream *fp , uint8_t *raw, int xSi * @param numberOfFrames number of frames * @return Boolean always true */ -bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits( uint8_t* raw, int xSize, - int ySize,int numberOfFrames ) +bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits(uint8_t *raw, int xSize, + int ySize, int numberOfFrames) { size_t pixelNumber = xSize * ySize; size_t rawSize = xSize * ySize * numberOfFrames; @@ -105,12 +111,12 @@ bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits( uint8_t* raw, int xSize, // per pixel we cannot work in place within Raw and hence // we copy it in a safe place, say copyRaw. - uint8_t* copyRaw = new uint8_t[rawSize * 2]; + uint8_t *copyRaw = new uint8_t[rawSize * 2]; memmove( copyRaw, raw, rawSize * 2 ); - uint8_t* x = raw; - uint8_t* a = copyRaw; - uint8_t* b = a + pixelNumber; + uint8_t *x = raw; + uint8_t *a = copyRaw; + uint8_t *b = a + pixelNumber; for ( int i = 0; i < numberOfFrames; i++ ) { @@ -122,7 +128,7 @@ bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits( uint8_t* raw, int xSize, } delete[] copyRaw; - /// \todo check that operator new []didn't fail, and sometimes return false + /// \todo check that operator new [] didn't fail, and sometimes return false return true; } diff --git a/src/gdcmTS.cxx b/src/gdcmTS.cxx index 3b951c32..fcf4d5b3 100644 --- a/src/gdcmTS.cxx +++ b/src/gdcmTS.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmTS.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:56 $ - Version: $Revision: 1.39 $ + Date: $Date: 2005/02/02 10:02:18 $ + 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 @@ -119,7 +119,7 @@ int TS::Count(TSKey const &key) return TsMap.count(key); } -TSAtr const & TS::GetValue(TSKey const &key) +TSAtr const &TS::GetValue(TSKey const &key) { // First thing clean up the string sometime the transfer syntax is padded with spaces std::string copy = key; diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 552b5840..4bff2d78 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/02/01 10:29:56 $ - Version: $Revision: 1.128 $ + Date: $Date: 2005/02/02 10:02:18 $ + Version: $Revision: 1.129 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -35,7 +35,7 @@ #include //only included in implementation file #if defined(_MSC_VER) || defined(__MINGW32__) - #include // for gethostname & gethostbyname + #include // for gethostname and gethostbyname #undef GetCurrentTime #else #ifndef __BORLANDC__ @@ -127,7 +127,7 @@ std::string Util::Format(const char *format, ...) */ void Util::Tokenize (const std::string &str, std::vector &tokens, - const std::string& delimiters) + const std::string &delimiters) { std::string::size_type lastPos = str.find_first_not_of(delimiters,0); std::string::size_type pos = str.find_first_of (delimiters,lastPos); diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index cc1f3638..9a7d6538 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:29:56 $ - Version: $Revision: 1.54 $ + Date: $Date: 2005/02/02 10:02:18 $ + Version: $Revision: 1.55 $ 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,8 @@ namespace gdcm * \brief Constructor from a given DictEntry * @param e Pointer to existing dictionary entry */ -ValEntry::ValEntry(DictEntry *e) : ContentEntry(e) +ValEntry::ValEntry(DictEntry *e) + : ContentEntry(e) { } @@ -45,7 +46,7 @@ ValEntry::ValEntry(DictEntry *e) : ContentEntry(e) * @param e Pointer to existing Doc entry */ ValEntry::ValEntry(DocEntry *e) - : ContentEntry(e->GetDictEntry()) + : ContentEntry(e->GetDictEntry()) { Copy(e); } @@ -174,7 +175,7 @@ void ValEntry::Print(std::ostream &os, std::string const &) { uint16_t g = GetGroup(); uint16_t e = GetElement(); - VRKey vr = GetVR(); + VRKey vr = GetVR(); std::ostringstream s; std::string st; std::string d2; @@ -188,7 +189,7 @@ void ValEntry::Print(std::ostream &os, std::string const &) return; } - TS * ts = Global::GetTS(); + TS *ts = Global::GetTS(); TSAtr v = GetValue(); // not applicable for SQ ... d2 = Util::CreateCleanString(v); // replace non printable characters by '.' -- 2.45.1