From 6278320cc85da00d2d56ffbf07806e84966892c3 Mon Sep 17 00:00:00 2001 From: jpr Date: Mon, 15 Sep 2008 15:49:19 +0000 Subject: [PATCH] use GDCM_NAME_SPACE:: instead of gdcm::, even in Examples ... --- CMake/GDCMConfig.cmake.in | 3 + Example/PcpdenseToDicom.cxx | 6 +- Testing/TestAllEntryVerify.cxx | 12 +- Testing/TestAllPrint.cxx | 8 +- Testing/TestAllReadCompareDicom.cxx | 6 +- Testing/TestAnonymize.cxx | 36 +++--- Testing/TestBuildUpDicomDir.cxx | 6 +- Testing/TestChangeHeader.cxx | 8 +- Testing/TestDataEntry.cxx | 32 ++--- Testing/TestDicomDir.cxx | 12 +- Testing/TestFileAccessors.cxx | 10 +- Testing/TestInline.cxx | 123 +++++++++++++++++++- Testing/TestLoadAllDocumentsNoPrivNoSeq.cxx | 8 +- Testing/TestLoadAllDocumentsNoShadow.cxx | 6 +- Testing/TestMakeDicomDir.cxx | 10 +- Testing/TestPrintAllDocument.cxx | 6 +- Testing/TestSerieHelper.cxx | 8 +- Testing/VTKTestRead.cxx | 6 +- Testing/VTKTestWrite.cxx | 6 +- Testing/dynmodule.cxx | 6 +- Testing/loadmodule.cxx | 6 +- src/gdcmDocument.cxx | 6 +- src/gdcmDocument.h | 20 ++-- src/gdcmFileHelper.cxx | 32 ++--- 24 files changed, 250 insertions(+), 132 deletions(-) diff --git a/CMake/GDCMConfig.cmake.in b/CMake/GDCMConfig.cmake.in index dd7be933..51fa4f66 100644 --- a/CMake/GDCMConfig.cmake.in +++ b/CMake/GDCMConfig.cmake.in @@ -17,6 +17,9 @@ SET(GDCM_LIBRARIES "@GDCM_LIBRARIES@") # The list of available languages. #SET(GDCM_LANGUAGES "Python") +# The gdcm namespace +SET(GDCM_NAME_SPACE @GDCM_NAME_SPACE@) + # The CMake macros dir. SET(GDCM_CMAKE_DIR "@GDCM_CMAKE_DIR_CONFIG@") diff --git a/Example/PcpdenseToDicom.cxx b/Example/PcpdenseToDicom.cxx index f9a818cf..b00c2091 100644 --- a/Example/PcpdenseToDicom.cxx +++ b/Example/PcpdenseToDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PcpdenseToDicom.cxx,v $ Language: C++ - Date: $Date: 2008/09/08 08:10:33 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/09/15 15:49:20 $ + 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 @@ -333,7 +333,7 @@ int main(int argc, char *argv[]) } - delete []image; + delete []image; return 1; } diff --git a/Testing/TestAllEntryVerify.cxx b/Testing/TestAllEntryVerify.cxx index 641b8f78..8ecd4072 100644 --- a/Testing/TestAllEntryVerify.cxx +++ b/Testing/TestAllEntryVerify.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllEntryVerify.cxx,v $ Language: C++ - Date: $Date: 2005/10/18 08:35:45 $ - Version: $Revision: 1.29 $ + Date: $Date: 2008/09/15 15:49:20 $ + Version: $Revision: 1.30 $ 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 @@ #include typedef std::string EntryValueType; // same type as DataEntry::value -typedef std::map< gdcm::TagKey, EntryValueType > MapEntryValues; +typedef std::map< GDCM_NAME_SPACE::TagKey, EntryValueType > MapEntryValues; typedef MapEntryValues *MapEntryValuesPtr; typedef std::string FileNameType; typedef std::map< FileNameType, MapEntryValuesPtr > MapFileValuesType; @@ -227,8 +227,8 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt ) std::string fileName = DataPath + fileIt->first; std::cout << Indent << "FileName: " << fileName << std::endl; - gdcm::File *tested; - tested = new gdcm::File( ); + GDCM_NAME_SPACE::File *tested; + tested = new GDCM_NAME_SPACE::File( ); tested->SetFileName( fileName.c_str() ); tested->Load( ); if( !tested->IsReadable() ) @@ -599,7 +599,7 @@ void ReferenceFileParser::ParseRegularLine( std::string &line) bool ReferenceFileParser::SecondPassReferenceFile() throw ( ParserException ) { - gdcm::TagKey key; + GDCM_NAME_SPACE::TagKey key; EntryValueType value; std::string line; bool inBlock = false; diff --git a/Testing/TestAllPrint.cxx b/Testing/TestAllPrint.cxx index 31916f12..c0179cad 100644 --- a/Testing/TestAllPrint.cxx +++ b/Testing/TestAllPrint.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllPrint.cxx,v $ Language: C++ - Date: $Date: 2006/03/17 14:33:54 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -47,8 +47,8 @@ int TestAllPrint(int, char *[]) filename += "/"; filename += gdcmDataImages[i]; - gdcm::File file; - //file.SetLoadMode( gdcm::LD_NOSEQ | gdcm::LD_NOSHADOWSEQ ); + GDCM_NAME_SPACE::File file; + //file.SetLoadMode( GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOWSEQ ); file.SetFileName( filename ); if( !file.Load() ) return 1; diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index b73ed5e6..5d08ea35 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2007/07/26 09:25:38 $ - Version: $Revision: 1.61 $ + Date: $Date: 2008/09/15 15:49:21 $ + Version: $Revision: 1.62 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -688,7 +688,7 @@ GDCM_NAME_SPACE::Debug::WarningOn(); } //if (gdcmDataImages[i] == "D_CLUNIE_CT2_RLE.dcm") -// gdcm::Debug::DebugOn(); // track pb on BigEndian Proc +// GDCM_NAME_SPACE::Debug::DebugOn(); // track pb on BigEndian Proc //else GDCM_NAME_SPACE::Debug::DebugOff(); diff --git a/Testing/TestAnonymize.cxx b/Testing/TestAnonymize.cxx index 0fff3b83..eb36d99f 100644 --- a/Testing/TestAnonymize.cxx +++ b/Testing/TestAnonymize.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAnonymize.cxx,v $ Language: C++ - Date: $Date: 2005/10/18 08:35:46 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -54,8 +54,8 @@ int Anonymize(std::string const &filename, std::cout << " 1..."; std::cout << std::endl; - gdcm::File *f; - f = new gdcm::File( ); + GDCM_NAME_SPACE::File *f; + f = new GDCM_NAME_SPACE::File( ); f->SetFileName( filename ); f->Load(); @@ -65,8 +65,8 @@ int Anonymize(std::string const &filename, // Write a new file // ============================================================ - // We need a gdcm::FileHelper, since we want to load the pixels - gdcm::FileHelper *fh = new gdcm::FileHelper(f); + // We need a GDCM_NAME_SPACE::FileHelper, since we want to load the pixels + GDCM_NAME_SPACE::FileHelper *fh = new GDCM_NAME_SPACE::FileHelper(f); // --- Don't forget to load the Pixels ... // We shall not use them, but we have to load them @@ -102,7 +102,7 @@ int Anonymize(std::string const &filename, delete fh; // Read the file we just wrote - f = new gdcm::File( output ); + f = new GDCM_NAME_SPACE::File( output ); std::cout << " Anonymized File... Re-Read ! " << std::endl; @@ -111,21 +111,21 @@ int Anonymize(std::string const &filename, // Compare and abort if different. v = f->GetEntryValue(0x0008, 0x0080); - if ( v != gdcm::GDCM_UNFOUND ) + if ( v != GDCM_NAME_SPACE::GDCM_UNFOUND ) if (v.find("Xanadoo") >= v.length() ) plouf = true; v = f->GetEntryValue(0x0010, 0x0010); - if ( v != gdcm::GDCM_UNFOUND ) + if ( v != GDCM_NAME_SPACE::GDCM_UNFOUND ) if (v.find("Fantomas") >= v.length() ) plouf = true; - if ( v != gdcm::GDCM_UNFOUND ) + if ( v != GDCM_NAME_SPACE::GDCM_UNFOUND ) v = f->GetEntryValue(0x0010, 0x0020); if (v.find("1515") >= v.length() ) plouf = true; - if ( v != gdcm::GDCM_UNFOUND ) + if ( v != GDCM_NAME_SPACE::GDCM_UNFOUND ) v = f->GetEntryValue(0x0010, 0x000d); if (v.find("9.99.999.9999") >= v.length() ) plouf = true; @@ -145,7 +145,7 @@ int Anonymize(std::string const &filename, // Read the file we just anonymize and check - f = new gdcm::File( output ); + f = new GDCM_NAME_SPACE::File( output ); // First, we set values to replace the ones we want to hide @@ -162,7 +162,7 @@ int Anonymize(std::string const &filename, // --------------------- we overwrite the file // No need to load the pixels. - // The gdcm::File remains untouched in memory + // The GDCM_NAME_SPACE::File remains untouched in memory std::cout <<"Let's AnonymizeNoLoad " << std::endl;; f->AnonymizeNoLoad(); @@ -171,22 +171,22 @@ int Anonymize(std::string const &filename, // No need to write the File : modif were done on disc ! delete f; - f = new gdcm::File( output ); + f = new GDCM_NAME_SPACE::File( output ); std::string val; plouf = false; val = f->GetEntryValue(0x0010, 0x0010); - if ( val != gdcm::GDCM_UNFOUND ) + if ( val != GDCM_NAME_SPACE::GDCM_UNFOUND ) if (val.find("XXL") >= v.length() ) plouf = true; - if ( val != gdcm::GDCM_UNFOUND ) + if ( val != GDCM_NAME_SPACE::GDCM_UNFOUND ) val = f->GetEntryValue(0x0010, 0x0020); if (val.find("007") >= v.length() ) plouf = true; - if ( val != gdcm::GDCM_UNFOUND ) + if ( val != GDCM_NAME_SPACE::GDCM_UNFOUND ) val = f->GetEntryValue(0x0010, 0x000d); if (val.find("6.66.666.6666") >= v.length() ) plouf = true; @@ -205,7 +205,7 @@ int Anonymize(std::string const &filename, int TestAnonymize(int argc, char *argv[]) { - //gdcm::Debug::DebugOn(); + //GDCM_NAME_SPACE::Debug::DebugOn(); if ( argc == 3 ) { diff --git a/Testing/TestBuildUpDicomDir.cxx b/Testing/TestBuildUpDicomDir.cxx index 11aff99f..0fa3ceda 100644 --- a/Testing/TestBuildUpDicomDir.cxx +++ b/Testing/TestBuildUpDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestBuildUpDicomDir.cxx,v $ Language: C++ - Date: $Date: 2007/08/20 13:25:32 $ - Version: $Revision: 1.12 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -40,7 +40,7 @@ int TestBuildUpDicomDir(int argc, char *argv[]) std::cerr << "Usage: " << argv[0] << " dummy " << std::endl; } - // gdcm::Debug::DebugOn(); + // GDCM_NAME_SPACE::Debug::DebugOn(); bool errorFound = false; GDCM_NAME_SPACE::DicomDir *dcmdir; diff --git a/Testing/TestChangeHeader.cxx b/Testing/TestChangeHeader.cxx index bfdc2ba2..dc7919a1 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/07/08 13:39:57 $ - Version: $Revision: 1.35 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -36,11 +36,11 @@ int TestChangeHeader(int argc, char *argv[]) std::string firstArgument = argv[1]; - gdcm::File *f1 = new gdcm::File(); + GDCM_NAME_SPACE::File *f1 = new GDCM_NAME_SPACE::File(); f1->SetFileName(firstArgument); f1->Load( ); std::string secondArgument = argv[2]; - gdcm::File *f2 = new gdcm::File(secondArgument); + GDCM_NAME_SPACE::File *f2 = new GDCM_NAME_SPACE::File(secondArgument); //f1->PrintPubElVal(); diff --git a/Testing/TestDataEntry.cxx b/Testing/TestDataEntry.cxx index 190f50a4..05755d35 100644 --- a/Testing/TestDataEntry.cxx +++ b/Testing/TestDataEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDataEntry.cxx,v $ Language: C++ - Date: $Date: 2006/04/07 14:14:40 $ - Version: $Revision: 1.12 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -41,13 +41,13 @@ int TestDataEntry(int , char *[]) (we don't use any longer DictEntry to build a DocEntry! unsigned int i; - gdcm::DictEntry *dict; - gdcm::DataEntry *entry; + GDCM_NAME_SPACE::DictEntry *dict; + GDCM_NAME_SPACE::DataEntry *entry; - dict = gdcm::DictEntry::New(0x0003,0x0004); + dict = GDCM_NAME_SPACE::DictEntry::New(0x0003,0x0004); // SetVR *before* making the DataEntry! dict->SetVR("US"); - entry = gdcm::DataEntry::New(dict); + entry = GDCM_NAME_SPACE::DataEntry::New(dict); std::cout << "Test for VR = " << dict->GetVR() << "..." << std::endl; @@ -105,10 +105,10 @@ int TestDataEntry(int , char *[]) entry->Delete(); //------------------------------------------------------------------ - dict = gdcm::DictEntry::New(0x0000,0x0000); + dict = GDCM_NAME_SPACE::DictEntry::New(0x0000,0x0000); // SetVR *before* making the DataEntry! dict->SetVR("LT"); - entry = gdcm::DataEntry::New(dict); + entry = GDCM_NAME_SPACE::DataEntry::New(dict); std::cout << "Test for VR = " << dict->GetVR() << "..." << std::endl; entry->SetString(data); @@ -172,10 +172,10 @@ int TestDataEntry(int , char *[]) entry->Delete(); //------------------------------------------------------------------ - dict = gdcm::DictEntry::New(0x0000,0x0000); + dict = GDCM_NAME_SPACE::DictEntry::New(0x0000,0x0000); // SetVR *before* making the DataEntry! dict->SetVR("US"); - entry = gdcm::DataEntry::New(dict); + entry = GDCM_NAME_SPACE::DataEntry::New(dict); std::cout << "Test for VR = " << dict->GetVR() << "..." << std::endl; @@ -273,9 +273,9 @@ int TestDataEntry(int , char *[]) entry->Delete(); //------------------------------------------------------------------ - dict = gdcm::DictEntry::New(0x0000,0x0000); + dict = GDCM_NAME_SPACE::DictEntry::New(0x0000,0x0000); dict->SetVR("UL"); - entry = gdcm::DataEntry::New(dict); + entry = GDCM_NAME_SPACE::DataEntry::New(dict); std::cout << "Test for VR = " << dict->GetVR() << "..." << std::endl; entry->SetString(data); @@ -372,9 +372,9 @@ int TestDataEntry(int , char *[]) entry->Delete(); //------------------------------------------------------------------ - dict = gdcm::DictEntry::New(0x0000,0x0000); + dict = GDCM_NAME_SPACE::DictEntry::New(0x0000,0x0000); dict->SetVR("FL"); - entry = gdcm::DataEntry::New(dict); + entry = GDCM_NAME_SPACE::DataEntry::New(dict); std::cout << "Test for VR = " << dict->GetVR() << "..." << std::endl; entry->SetString(fdata); @@ -471,9 +471,9 @@ int TestDataEntry(int , char *[]) entry->Delete(); //------------------------------------------------------------------ - dict = gdcm::DictEntry::New(0x0000,0x0000); + dict = GDCM_NAME_SPACE::DictEntry::New(0x0000,0x0000); dict->SetVR("FD"); - entry = gdcm::DataEntry::New(dict); + entry = GDCM_NAME_SPACE::DataEntry::New(dict); std::cout << "Test for VR = " << dict->GetVR() << "..." << std::endl; entry->SetString(fdata); diff --git a/Testing/TestDicomDir.cxx b/Testing/TestDicomDir.cxx index b30e4535..b2dad187 100644 --- a/Testing/TestDicomDir.cxx +++ b/Testing/TestDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomDir.cxx,v $ Language: C++ - Date: $Date: 2007/06/21 14:59:06 $ - Version: $Revision: 1.46 $ + Date: $Date: 2008/09/15 15:49:21 $ + Version: $Revision: 1.47 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -29,8 +29,8 @@ #include -// check *all* the dicom elements (gdcm::DocEntry) -// of this gdcm::DicomDirObject +// check *all* the dicom elements (GDCM_NAME_SPACE::DocEntry) +// of this GDCM_NAME_SPACE::DicomDirObject int CompareSQItem(GDCM_NAME_SPACE::SQItem *pa1, GDCM_NAME_SPACE::SQItem *pa2 ) { GDCM_NAME_SPACE::DocEntry *e1; @@ -133,7 +133,7 @@ int TestDicomDir(int argc, char *argv[]) <<"' is readable"<GetFirstPatient() ) { std::cout<<" DicomDir '"<GetFirstPatient(); while ( pa1 ) - { // we process all the PATIENT of this gdcm::DicomDir + { // we process all the PATIENT of this GDCM_NAME_SPACE::DicomDir std::cout << pa1->GetEntryString(0x0010, 0x0010) << std::endl; // Patient's Name st1 = pa1->GetFirstStudy(); diff --git a/Testing/TestFileAccessors.cxx b/Testing/TestFileAccessors.cxx index b242ccbb..a685a593 100644 --- a/Testing/TestFileAccessors.cxx +++ b/Testing/TestFileAccessors.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestFileAccessors.cxx,v $ Language: C++ - Date: $Date: 2007/06/21 14:59:06 $ - Version: $Revision: 1.11 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -60,7 +60,7 @@ int TestFileAccessors(int argc, char *argv[]) float iop[6]; float ipp[3]; - // gdcm::Debug::DebugOn(); + // GDCM_NAME_SPACE::Debug::DebugOn(); while( gdcmDataImages[i] != 0 ) { @@ -69,9 +69,9 @@ int TestFileAccessors(int argc, char *argv[]) // for all the OS. // if (gdcmDataImages[i] == "00191113.dcm" ) - // gdcm::Debug::DebugOn(); + // GDCM_NAME_SPACE::Debug::DebugOn(); // else - // gdcm::Debug::DebugOff(); + // GDCM_NAME_SPACE::Debug::DebugOff(); std::string filename; if (argc ==2) diff --git a/Testing/TestInline.cxx b/Testing/TestInline.cxx index b427e37f..ffbfd595 100755 --- a/Testing/TestInline.cxx +++ b/Testing/TestInline.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestInline.cxx,v $ Language: C++ - Date: $Date: 2008/04/10 12:15:34 $ - Version: $Revision: 1.19 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -527,7 +527,7 @@ int TestInline(int argc, char *argv[]) std::cout << "Use inline, .h defined, WITH inline keyword, param passed by pointer" << std::endl; - gdcm::Util util; + GDCM_NAME_SPACE::Util util; GET_TIME(tms1); for(i = 0 ; i< nbLoop ; i++) @@ -560,7 +560,7 @@ int TestInline(int argc, char *argv[]) GET_TIME(tms1); for(i = 0 ; i< nbLoop ; i++) { - gdcm::Util::sthifpswap (&a, &b); + GDCM_NAME_SPACE::Util::sthifpswap (&a, &b); } GET_TIME(tms2); HOW_LONG(tms2,tms1); @@ -573,11 +573,124 @@ int TestInline(int argc, char *argv[]) GET_TIME(tms1); for(i = 0 ; i< nbLoop ; i++) { - gdcm::Util::sthNoifpswap (&a, &b); + GDCM_NAME_SPACE::Util::sthNoifpswap (&a, &b); } GET_TIME(tms2); HOW_LONG(tms2,tms1); + + // ---------------------------------------- + + // Just to point out that playing with pointers doesn't save so much time ... + + std::cout << "Play with arrays\n================" << std::endl; + + nbLoop=1000; + + std::cout << "Copy 2 arrays [i][j]" + << std::endl; + + unsigned short int z1[128][3118], z2[128][3118]; + GET_TIME(tms1); + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pv1=&z1[0][0], *pv2=&z2[0][0]; + for (int j=0;j<3118;j++) + for(int i=0; i<128;i++) + z2[i][j] = z1[i][j]; + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + std::cout << "Copy 2 arrays ([i][j], pointer)" + << std::endl; + + GET_TIME(tms1); + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pv1=&z1[0][0], *pv2=&z2[0][0]; + for (int j=0;j<3118;j++) + for(int i=0; i<128;i++) + z2[i][j] = *pv1++; + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + std::cout << "Copy 2 arrays (2 pointers)" << std::endl; + GET_TIME(tms1); + // unsigned short int w1[3118*128], w2[3118][128]; + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pw1=&z1[0][0], *pw2=&z2[0][0]; + for (int j=0;j<3118;j++) + for(int i=0; i<128;i++) + *pw2++ = *pw1++; + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + + std::cout << "Copy 2 arrays (memcpy)" << std::endl; + GET_TIME(tms1); + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pw1=&z1[0][0], *pw2=&z2[0][0]; + memcpy(pw2,pw1,3118*128*sizeof(unsigned short int)); + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + + + std::cout << "Transpose 2 arrays [i][j]" + << std::endl; + + unsigned short int t1[3118][128], t2[128][3118]; + GET_TIME(tms1); + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pv1=&t1[0][0], *pv2=&t2[0][0]; + for (int j=0;j<3118;j++) + for(int i=0; i<128;i++) + t2[i][j] = t1[j][i]; + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + + std::cout << "Transpose 2 arrays ([i][j], pointer)" + << std::endl; + + unsigned short int w1[3118*128], w2[3118][128]; + GET_TIME(tms1); + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pw1=w1, *pw2=&w2[0][0]; + for (int j=0;j<3118;j++) + for(int i=0; i<128;i++) + w2[i][j] = *pw1++; + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + + std::cout << "Transpose 2 arrays (2 pointers)" + << std::endl; + + unsigned short int v1[3118*128], v2[128*3118]; + GET_TIME(tms1); + for(i = 0 ; i< nbLoop ; i++) + { + unsigned short int *pv1=v1, *pv2=v2; + for (int j=0;j<3118;j++) + for(int i=0; i<128;i++) + *(pv2+i*128+j) = *pv1++; + } + GET_TIME(tms2); + HOW_LONG(tms2,tms1); + + + //return 1; // will generate an error, // just to allow us to see the full log in the dashboard return 0; diff --git a/Testing/TestLoadAllDocumentsNoPrivNoSeq.cxx b/Testing/TestLoadAllDocumentsNoPrivNoSeq.cxx index 8fa5711b..187f4cb5 100644 --- a/Testing/TestLoadAllDocumentsNoPrivNoSeq.cxx +++ b/Testing/TestLoadAllDocumentsNoPrivNoSeq.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestLoadAllDocumentsNoPrivNoSeq.cxx,v $ Language: C++ - Date: $Date: 2007/06/21 14:59:06 $ - Version: $Revision: 1.5 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -103,9 +103,9 @@ int TestLoadAllDocumentsNoPrivNoSeq(int, char *[]) std::string strImageOrientationPatient = f->GetEntryValue(0x0020,0x0037); - if ( strImageOrientationPatient != gdcm::GDCM_UNFOUND ) + if ( strImageOrientationPatient != GDCM_NAME_SPACE::GDCM_UNFOUND ) { - gdcm::Orientation o; + GDCM_NAME_SPACE::Orientation o; double orient = o.TypeOrientation( f ); std::cout << " ---------------------- Orientation " << orient << std::endl; diff --git a/Testing/TestLoadAllDocumentsNoShadow.cxx b/Testing/TestLoadAllDocumentsNoShadow.cxx index abbcf935..82571133 100755 --- a/Testing/TestLoadAllDocumentsNoShadow.cxx +++ b/Testing/TestLoadAllDocumentsNoShadow.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestLoadAllDocumentsNoShadow.cxx,v $ Language: C++ - Date: $Date: 2007/07/27 21:20:13 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -47,7 +47,7 @@ int TestLoadAllDocumentsNoShadow(int, char *[]) filename += "/"; filename += gdcmDataImages[i]; - GDCM_NAME_SPACE::File *file = gdcm::File::New();; + GDCM_NAME_SPACE::File *file = GDCM_NAME_SPACE::File::New();; file->SetLoadMode( GDCM_NAME_SPACE::LD_NOSHADOW ); file->SetFileName( filename ); std::cout << "File Name [" << filename << "]" << std::endl; diff --git a/Testing/TestMakeDicomDir.cxx b/Testing/TestMakeDicomDir.cxx index edfecb66..388c3b53 100644 --- a/Testing/TestMakeDicomDir.cxx +++ b/Testing/TestMakeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestMakeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2007/06/21 14:59:06 $ - Version: $Revision: 1.13 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -85,14 +85,14 @@ void EndMethod(void *endMethod) * (or GDCM_DATA_ROOT by default) * - Orders the gdcm-readable found Files * according their Patient/Study/Serie/Image characteristics - * - Makes the gdcm::DicomDir. + * - Makes the GDCM_NAME_SPACE::DicomDir. * - Writes a file named "NewDICOMDIR". * - Reads "NewDICOMDIR" file. */ int TestMakeDicomDir(int argc, char *argv[]) { - //gdcm::Debug::DebugOn(); + //GDCM_NAME_SPACE::Debug::DebugOn(); std::string dirName; if (argc > 1) @@ -120,7 +120,7 @@ int TestMakeDicomDir(int argc, char *argv[]) GDCM_NAME_SPACE::CommandManager::SetCommand(dcmdir,GDCM_NAME_SPACE::CMD_ENDPROGRESS,cmd); cmd->Delete(); - // dcmdir->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW); + // dcmdir->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW); // some images have a wrong length for element 0x0000 of private groups dcmdir->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ); dcmdir->SetDirectoryName(dirName); diff --git a/Testing/TestPrintAllDocument.cxx b/Testing/TestPrintAllDocument.cxx index 5b8db1d6..23d5e817 100644 --- a/Testing/TestPrintAllDocument.cxx +++ b/Testing/TestPrintAllDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestPrintAllDocument.cxx,v $ Language: C++ - Date: $Date: 2007/06/22 11:01:58 $ - Version: $Revision: 1.17 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -48,7 +48,7 @@ int TestPrintAllDocument(int argc, char *argv[]) unsigned int l; l = strlen("PALETTE COLOR "); - //gdcm::Debug::DebugOn(); + //GDCM_NAME_SPACE::Debug::DebugOn(); while( gdcmDataImages[i] != 0 ) { diff --git a/Testing/TestSerieHelper.cxx b/Testing/TestSerieHelper.cxx index c31129ec..81de64be 100644 --- a/Testing/TestSerieHelper.cxx +++ b/Testing/TestSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2008/02/13 19:08:34 $ - Version: $Revision: 1.12 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -33,7 +33,7 @@ int TestSerieHelper(int argc, char *argv[]) } //if (argc > 2) - // gdcm::Debug::DebugOn(); + // GDCM_NAME_SPACE::Debug::DebugOn(); std::cout << "-------------- Dir Name :[" << dirName << "]" << std::endl; @@ -51,7 +51,7 @@ int TestSerieHelper(int argc, char *argv[]) << std::endl; int nbFiles; - // For all the SingleSerieUID filesets of the gdcm::Serie + // For all the SingleSerieUID filesets of the GDCM_NAME_SPACE::Serie GDCM_NAME_SPACE::FileList *l = s->GetFirstSingleSerieUIDFileSet(); while (l) { diff --git a/Testing/VTKTestRead.cxx b/Testing/VTKTestRead.cxx index 90f677b6..4524aff4 100644 --- a/Testing/VTKTestRead.cxx +++ b/Testing/VTKTestRead.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: VTKTestRead.cxx,v $ Language: C++ - Date: $Date: 2007/09/18 07:58:38 $ - Version: $Revision: 1.15 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -205,7 +205,7 @@ int VTKTestRead(int argc, char *argv[]) return ret; } - //gdcm::Debug::DebugOn(); // Comment out when no bug is to be tracked + //GDCM_NAME_SPACE::Debug::DebugOn(); // Comment out when no bug is to be tracked // Test for all images int i = 0; diff --git a/Testing/VTKTestWrite.cxx b/Testing/VTKTestWrite.cxx index 9f2aa9be..384d42d1 100644 --- a/Testing/VTKTestWrite.cxx +++ b/Testing/VTKTestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: VTKTestWrite.cxx,v $ Language: C++ - Date: $Date: 2007/09/18 07:58:38 $ - Version: $Revision: 1.12 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -203,7 +203,7 @@ int VTKTestWrite(int argc, char *argv[]) } } -// gdcm::Debug::DebugOn(); +// GDCM_NAME_SPACE::Debug::DebugOn(); int ret = 0; vtkTesting *t = vtkTesting::New(); diff --git a/Testing/dynmodule.cxx b/Testing/dynmodule.cxx index 340180ca..92e8a574 100644 --- a/Testing/dynmodule.cxx +++ b/Testing/dynmodule.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: dynmodule.cxx,v $ Language: C++ - Date: $Date: 2005/11/08 08:31:42 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -30,7 +30,7 @@ extern "C" __ELX_DLLEXPORT void afunc(void) // Create an instance of a gdcm class. This makes sure // that the problematic gdcm-library is linked. - gdcm::File *file = gdcm::File::New(); + GDCM_NAME_SPACE::File *file = GDCM_NAME_SPACE::File::New(); file->SetLoadMode(0); // To avoid warning std::cerr << "End of function afunc" << std::endl; diff --git a/Testing/loadmodule.cxx b/Testing/loadmodule.cxx index 0d72007c..7e814b59 100644 --- a/Testing/loadmodule.cxx +++ b/Testing/loadmodule.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: loadmodule.cxx,v $ Language: C++ - Date: $Date: 2005/11/07 10:18:20 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/09/15 15:49:21 $ + 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 @@ -77,7 +77,7 @@ int main(int, char* []) // Create an instance of the GDCMImageIO class. This makes sure // that the problematic gdcm-library is linked. //itk::GDCMImageIO::Pointer gdcmio = itk::GDCMImageIO::New(); - gdcm::File *file = gdcm::File::New(); + GDCM_NAME_SPACE::File *file = GDCM_NAME_SPACE::File::New(); file->Print(); // to avoid warning std::cerr << "Closing libs" << std::endl; diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 37404378..11b88a2e 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2008/06/12 13:18:15 $ - Version: $Revision: 1.380 $ + Date: $Date: 2008/09/15 15:49:22 $ + Version: $Revision: 1.381 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -284,10 +284,12 @@ bool Document::DoTheLoadingDocumentJob( ) std::string RecCode; RecCode = GetEntryString(0x0008, 0x0010); // recognition code (RET) + if(RecCode.find("ACRNEMA_LIBIDO") == 0 || // any version RecCode.find("CANRME_AILIBOD") == 0) // for brain-damaged softwares // with "little-endian strings" { + Filetype = ACR_LIBIDO; std::string rows = GetEntryString(0x0028, 0x0010); std::string columns = GetEntryString(0x0028, 0x0011); diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index 50fcead9..ab2782a5 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2008/02/13 18:53:33 $ - Version: $Revision: 1.153 $ + Date: $Date: 2008/09/15 15:49:22 $ + Version: $Revision: 1.154 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,7 +37,7 @@ class Dict; //----------------------------------------------------------------------------- /** - * \brief Derived by both gdcm::File and gdcm::DicomDir + * \brief Derived by both GDCM_NAME_SPACE::File and GDCM_NAME_SPACE::DicomDir */ class GDCM_EXPORT Document : public ElementSet { @@ -59,7 +59,7 @@ public: bool SetShaDict(Dict *dict); bool SetShaDict(DictKey const &dictName); -// Informations contained in the gdcm::Document +// Informations contained in the GDCM_NAME_SPACE::Document bool IsParsable(); virtual bool IsReadable(); bool IsDicomV3(); @@ -110,8 +110,8 @@ public: protected: // Methods // Constructor and destructor are protected to forbid end user - // to instanciate from this class Document (only gdcm::File and - // gdcm::DicomDir are meaningfull). + // to instanciate from this class Document (only GDCM_NAME_SPACE::File and + // GDCM_NAME_SPACE::DicomDir are meaningfull). Document(); virtual ~Document(); @@ -174,12 +174,12 @@ protected: /// Probabely, some more to add int LoadMode; - /// \brief Whether the gdcm::Document is already parsed/loaded : - /// False from the creation of the gdcm::Document untill - /// gdcm::Document:Load() + /// \brief Whether the GDCM_NAME_SPACE::Document is already parsed/loaded : + /// False from the creation of the GDCM_NAME_SPACE::Document untill + /// GDCM_NAME_SPACE::Document:Load() bool IsDocumentAlreadyLoaded; // FIXME : probabely useless now - /// Whether the gdcm::Document was modified since the last Load() + /// Whether the GDCM_NAME_SPACE::Document was modified since the last Load() bool IsDocumentModified; private: diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 33807ec5..f27d8d99 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2008/06/12 13:18:15 $ - Version: $Revision: 1.137 $ + Date: $Date: 2008/09/15 15:49:22 $ + Version: $Revision: 1.138 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -51,11 +51,11 @@ These lines will be moved to the document-to-be 'User's Guide' -// To read an image, user needs a gdcm::File -gdcm::File *f = new gdcm::File(fileName); +// To read an image, user needs a GDCM_NAME_SPACE::File +GDCM_NAME_SPACE::File *f = new GDCM_NAME_SPACE::File(fileName); // or (advanced) : // user may also decide he doesn't want to load some parts of the header -gdcm::File *f = new gdcm::File(); +GDCM_NAME_SPACE::File *f = new GDCM_NAME_SPACE::File(); f->SetFileName(fileName); f->SetLoadMode(LD_NOSEQ); // or f->SetLoadMode(LD_NOSHADOW); // or @@ -67,8 +67,8 @@ f->Load(); // user can now check some values std::string v = f->GetEntryValue(groupNb,ElementNb); -// to get the pixels, user needs a gdcm::FileHelper -gdcm::FileHelper *fh = new gdcm::FileHelper(f); +// to get the pixels, user needs a GDCM_NAME_SPACE::FileHelper +GDCM_NAME_SPACE::FileHelper *fh = new GDCM_NAME_SPACE::FileHelper(f); // user may ask not to convert Palette (if any) to RGB uint8_t *pixels = fh->GetImageDataRaw(); @@ -77,8 +77,8 @@ int imageLength = fh->GetImageDataRawSize(); // He can now use the pixels, create a new image, ... uint8_t *userPixels = ... -//To re-write the image, user re-uses the gdcm::FileHelper -gdcm::File *fh = new gdcm::FileHelper(); +//To re-write the image, user re-uses the GDCM_NAME_SPACE::FileHelper +GDCM_NAME_SPACE::File *fh = new GDCM_NAME_SPACE::FileHelper(); fh->SetTypeToRaw(); // Even if it was possible to convert Palette to RGB // (WriteMode is set) @@ -157,7 +157,7 @@ fh->Write(newFileName); ElementSet::WriteContent(fp, writetype); writes recursively all DataElements RestoreWrite(); - (moves back to the gdcm::File all the archived elements) + (moves back to the GDCM_NAME_SPACE::File all the archived elements) */ @@ -170,7 +170,7 @@ typedef std::map GroupHT; // Hash Table // Constructor / Destructor /** * \brief Constructor dedicated to deal with the *pixels* area of a ACR/DICOMV3 - * file (gdcm::File only deals with the ... header) + * file (GDCM_NAME_SPACE::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 @@ -216,7 +216,7 @@ FileHelper::FileHelper(File *header) /** * \brief canonical destructor - * \note If the header (gdcm::File) was created by the FileHelper constructor, + * \note If the header (GDCM_NAME_SPACE::File) was created by the FileHelper constructor, * it is destroyed by the FileHelper */ FileHelper::~FileHelper() @@ -241,7 +241,7 @@ FileHelper::~FileHelper() // Public /** - * \brief Sets the LoadMode of the internal gdcm::File as a boolean string. + * \brief Sets the LoadMode of the internal GDCM_NAME_SPACE::File as a boolean string. * NO_SEQ, NO_SHADOW, NO_SHADOWSEQ ... (nothing more, right now) * WARNING : before using NO_SHADOW, be sure *all* your files * contain accurate values in the 0x0000 element (if any) @@ -253,7 +253,7 @@ void FileHelper::SetLoadMode(int loadMode) GetFile()->SetLoadMode( loadMode ); } /** - * \brief Sets the LoadMode of the internal gdcm::File + * \brief Sets the LoadMode of the internal GDCM_NAME_SPACE::File * @param fileName name of the file to be open */ void FileHelper::SetFileName(std::string const &fileName) @@ -1328,7 +1328,7 @@ We have to deal with 4 *very* different cases : -Probabely some more to be added. --> Set it with FileHelper::SetContentType(int); -gdcm::FileHelper::CheckMandatoryElements() deals automatically with these cases. +GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements() deals automatically with these cases. 1)2)3)4) 0008 0012 Instance Creation Date @@ -1383,7 +1383,7 @@ If 'SOP Class UID' exists in the native image ('true DICOM' image) Bellow follows the full description (hope so !) of the consistency checks performed -by gdcm::FileHelper::CheckMandatoryElements() +by GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements() -->'Media Storage SOP Class UID' (0x0002,0x0002) -- 2.45.0