From eec7a8779419734a614b42b118a290e6881e05ef Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 1 Sep 2010 14:41:48 +0000 Subject: [PATCH] Synchronize (fix comments, misstyping, re ident, etc) --- Example/CMakeLists.txt | 10 ++++--- Example/MergeDICOMRaw.cxx | 8 ++--- Example/PcpdenseToDicom.cxx | 8 ++--- Example/PrintFile.cxx | 13 ++++---- Example/exPresentationState.cxx | 53 +++++++++++++-------------------- Example/exReadWriteFile.cxx | 10 +++---- Example/exSerieHelper.cxx | 11 ++++--- 7 files changed, 46 insertions(+), 67 deletions(-) diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index d98b401d..3b7c5ca8 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -5,12 +5,14 @@ INCLUDE_DIRECTORIES( ${GDCM_BINARY_DIR}/src) SET(EXAMPLE_SOURCES #names starting with 'ex' are examples - #------------------------------------- + #------------------------------------- + #SingleFrames2Multiframe #Txt2Mat #exDicomRTStructSetFile #exExtractCSA - exPresentationState - + #exExtractCSATag + #exPresentationState + #exExplorePresentationState exReadPapyrus exReadWriteFile exColorToRGB @@ -48,7 +50,7 @@ SET(EXAMPLE_SOURCES #ReWriteExtended RawToDicom TestValidate - + Rename SplitIntoDirectories SplitIntoXCoherentDirectories SplitIntoXCoherentDirectoriesIgnoreSerieUID diff --git a/Example/MergeDICOMRaw.cxx b/Example/MergeDICOMRaw.cxx index c70cf3dc..b44e490e 100644 --- a/Example/MergeDICOMRaw.cxx +++ b/Example/MergeDICOMRaw.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: MergeDICOMRaw.cxx,v $ Language: C++ - Date: $Date: 2007/12/03 17:16:25 $ - Version: $Revision: 1.2 $ + Date: $Date: 2010/09/01 14:41:48 $ + 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 @@ -125,9 +125,6 @@ int main(int argc, char *argv[]) f->InsertEntryString(str.str(),0x0028,0x0002,"US"); // Samples per Pixel - - - GDCM_NAME_SPACE::FileHelper *fh = GDCM_NAME_SPACE::FileHelper::New(f); // Convert Media Storage SOP Class if needed std::string mssop = f->GetEntryString(0x0002,0x0002); @@ -158,7 +155,6 @@ int main(int argc, char *argv[]) << "No file written\n"; } - fh->Delete(); f->Delete(); return 0; diff --git a/Example/PcpdenseToDicom.cxx b/Example/PcpdenseToDicom.cxx index b06a457d..161d9452 100644 --- a/Example/PcpdenseToDicom.cxx +++ b/Example/PcpdenseToDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PcpdenseToDicom.cxx,v $ Language: C++ - Date: $Date: 2010/08/26 12:46:12 $ - Version: $Revision: 1.5 $ + Date: $Date: 2010/09/01 14:41:48 $ + 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 @@ -48,10 +48,10 @@ bool verbose; int main(int argc, char *argv[]) { START_USAGE(usage) - " \n pcpdenseToDicom :\n ", + " \n pcpdenseToDicom :\n ", " Converts the '.txt' files into 16 bits Dicom Files, ", " usage: ", - " pcpdenseToDicom rootfilename=... ", + " pcpdenseToDicom rootfilename=... ", " (e.g.. : meas_MID380_DENSE_stacked_slices_aif_FID81637)", " numberOfSlices = (default : 3) ", " X2 : multiply x 2 image size ", diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 23f64835..2ed087c9 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2009/05/28 15:44:34 $ - Version: $Revision: 1.93 $ + Date: $Date: 2010/09/01 14:41:48 $ + Version: $Revision: 1.94 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -244,13 +244,14 @@ int main(int argc, char *argv[]) GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New(); f->SetLoadMode(loadMode); f->SetFileName( fileName ); - f->SetMaxSizeLoadEntry(0xffff); + f->SetMaxSizeLoadEntry(0xffff); for (int ri=0; riAddForceLoadElement((uint32_t)elemsToForceLoad[2*ri], (uint32_t)elemsToForceLoad[2*ri+1] ); } + // TODO : find why such a polution // To avoid polluting the output with messages // 'Last system error was : No such file or directory' @@ -355,10 +356,6 @@ if (!noex) //------------------------------ - - - - // Let's get and print some usefull fields about 'Orientation' // ------------------------------------------------------------ @@ -748,7 +745,7 @@ if (!noex) { if (load) // just to see warning messages at load time ! { - uint8_t *pixels = fh->GetImageData(); (void)pixels; + uint8_t *pixels = fh->GetImageData(); (void)pixels; uint32_t lgth = fh->GetImageDataSize(); (void)lgth; } diff --git a/Example/exPresentationState.cxx b/Example/exPresentationState.cxx index 69a3f1b4..64e33e21 100644 --- a/Example/exPresentationState.cxx +++ b/Example/exPresentationState.cxx @@ -4,8 +4,8 @@ Program: gdcm Module: $RCSfile: exPresentationState.cxx,v $ Language: C++ - Date: $Date: 2009/09/16 12:28:44 $ - Version: $Revision: 1.4 $ + Date: $Date: 2010/09/01 14:41:48 $ + 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 @@ -25,7 +25,7 @@ #include "gdcmSeqEntry.h" #include "gdcmSQItem.h" #include "gdcmDocEntrySet.h" -#include "gdcmSerieHelper.h" +//#include "gdcmSerieHelper.h" #include "gdcmDirList.h" #include "gdcmUtil.h" @@ -33,6 +33,7 @@ GDCM_NAME_SPACE::SeqEntry *CheckIfSequenceExists(GDCM_NAME_SPACE::File *fPS, uint16_t gr, uint16_t el); GDCM_NAME_SPACE::SeqEntry *CheckIfSequenceExists(GDCM_NAME_SPACE::SQItem *si, uint16_t gr, uint16_t el); + bool dealWithCurrentFile(const char *PSName); bool dealWithTopLevelItem(GDCM_NAME_SPACE::SQItem* currentItem); bool dealWithEndLevelItem(GDCM_NAME_SPACE::SQItem* currentItem); void displaySeekResult(GDCM_NAME_SPACE::SeqEntry* currentItem, uint16_t g, uint16_t e); @@ -89,34 +90,22 @@ int main(int argc, char *argv[]) delete am; // ------ we don't need Arguments Manager any longer ------ // ============================================================ -// Read the input image. +// Read the input file. // ============================================================ GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New( ); -/* - //f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW); - f->SetFileName( fileName ); - f->SetMaxSizeLoadEntry(0xffff); - bool res = f->Load(); +// ================================================================================= - if( GDCM_NAME_SPACE::Debug::GetDebugFlag()) - { - std::cout << "---------------------------------------------" << std::endl; - f->Print(); - std::cout << "---------------------------------------------" << std::endl; - } - if (!res) { - std::cerr << "Sorry, " << fileName << " not a gdcm-readable " - << "DICOM / ACR File" - << std::endl; - f->Delete(); - return 1; - } - std::cout << " ... is readable " << std::endl; -*/ + bool resFile = dealWithCurrentFile(PSName); + std::cout << "\n\n" <SetFileName( PSName ); @@ -127,8 +116,8 @@ int main(int argc, char *argv[]) std::cout << "Sorry, " << PSName << " not a gdcm-readable " << "DICOM / ACR File" << std::endl; - f->Delete(); - return 1; + fPS->Delete(); + return false; } GDCM_NAME_SPACE::SeqEntry *se; @@ -138,7 +127,7 @@ int main(int argc, char *argv[]) if (!se) { std::cout << "[" << PSName << "] : Hopeless (" << std::hex << 0x0070 << "|" << 0x0001 << std::dec << " doesn't exist...)" <Delete(); + fPS->Delete(); - std::cout << "\n\n" <GetImageDataRawSize(); - // TODO : Newbee user would appreciate any comment ! + /// \TODO : Newbee user would appreciate any comment ! std::cout << "GetImageDataSize()" << fh1->GetImageDataSize() << std::endl; diff --git a/Example/exSerieHelper.cxx b/Example/exSerieHelper.cxx index a585765a..9c521d00 100644 --- a/Example/exSerieHelper.cxx +++ b/Example/exSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2009/05/28 15:44:34 $ - Version: $Revision: 1.18 $ + Date: $Date: 2010/09/01 14:41:48 $ + 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 @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { START_USAGE(usage) "\n exSerieHelper :\n ", - "Example on how to use the methodes of gdcm::SerieHelper ", + "Example on how to use the methods of gdcm::SerieHelper ", "usage: exSerieHelper {dirin=inputDirectoryName} ", " [ { [noshadowseq] | [noshadow][noseq] } ] [debug] ", " ", @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) if (am->ArgMgrDefined("debug")) GDCM_NAME_SPACE::Debug::DebugOn(); - + if (am->ArgMgrDefined("warning")) GDCM_NAME_SPACE::Debug::WarningOn(); @@ -81,7 +81,6 @@ int main(int argc, char *argv[]) return 0; } - std::cout << "Dir Name :[" << dirName << "]" << std::endl; // // Sometimes using only SerieHelper is not enought ! @@ -129,7 +128,7 @@ int main(int argc, char *argv[]) while (l) { nbFiles = l->size() ; - if ( nbFiles > 5 ) // Why not ? Just an example, for testing + if ( nbFiles > 2 ) // Why not ? Just an example, for testing { std::cout << "List to sort : " << nbFiles << " long" << std::endl; //--------------------------------------------------------- -- 2.45.0