]> Creatis software - gdcm.git/commitdiff
Synchronize (fix comments, misstyping, re ident, etc)
authorjpr <jpr>
Wed, 1 Sep 2010 14:41:48 +0000 (14:41 +0000)
committerjpr <jpr>
Wed, 1 Sep 2010 14:41:48 +0000 (14:41 +0000)
Example/CMakeLists.txt
Example/MergeDICOMRaw.cxx
Example/PcpdenseToDicom.cxx
Example/PrintFile.cxx
Example/exPresentationState.cxx
Example/exReadWriteFile.cxx
Example/exSerieHelper.cxx

index d98b401df0a18c6c009b7126aa5bb7d46d5f0321..3b7c5ca8a36a0df5e64716c99c12828e430c6410 100644 (file)
@@ -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 
index c70cf3dc22415c4ae31c0b3efa5d789d09bebd91..b44e490e0f752bec3f0bccbb92b6ecaa4a1cd111 100644 (file)
@@ -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;
index b06a457d3df75dc11eb3582f966557b16e4d44c6..161d94526022e9cb25adab92cf08b642a2190948 100644 (file)
@@ -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                             ",
index 23f648359c4b9ceff43a4c82de5324deaf281cb3..2ed087c95aae4f3d5b8a75a5f59453f388b53881 100644 (file)
@@ -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; ri<forceLoadNb; ri++)
       {
          f->AddForceLoadElement((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;
             }         
 
index 69a3f1b470512a268e3de4b58b41afa6bf3e9e75..64e33e21a770cb042f446bd3085b309a4f631fbf 100644 (file)
@@ -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"  <<std::endl;
+   std::cout << "=====================================================[" <<  PSName << "]==" << resFile << std::endl;
+   return resFile;
+}
 
-// =================================================================================
+//----------------------------------------------------------------------------------------------------
+bool dealWithCurrentFile(const char *PSName)
+{
 
    GDCM_NAME_SPACE::File *fPS = GDCM_NAME_SPACE::File::New( );
    fPS->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...)" <<std::endl;
-         exit (0);      
+         return false;
    }
    std::cout << "\n\n =========================================================================================" <<std::endl;       
    std::cout << "[" << PSName << "] is a gdcm-readable PresentationState file, "
@@ -175,13 +164,11 @@ int main(int argc, char *argv[])
      std::cout << "Sorry, [" << PSName << "] is not a gdcm-readable PresentationState file" <<std::endl; 
   }
 */
-   
-   
-   f->Delete();
+
    fPS->Delete();
    
-   std::cout << "\n\n"  <<std::endl;  
-return 0;
+   std::cout << "\n\n"  <<std::endl;
+   return true;
 }
 
 //----------------------------------------------------------------------------------------------------
index 3d53160b1a63617565ff17c7c6b751b9f1723c39..f0ff1209e56753685559bb99ab0c63f3ce588acb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: exReadWriteFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/05/23 14:18:05 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2010/09/01 14:41:48 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -26,8 +26,6 @@
  
 int main(int argc, char *argv[])
 {
-
-
 std::cout << " --- WARNING --- WARNING --- WARNING --- WARNING ---" <<std::endl;
 std::cout << " "                                                    <<std::endl; 
 std::cout << " This source program is NOT intendend to be run as is"<<std::endl;
@@ -36,7 +34,7 @@ std::cout << " It just shows a set of possible uses."               <<std::endl;
 std::cout << "User MUST read it, "                                  <<std::endl;
 std::cout << "          comment out the useless parts "             <<std::endl;
 std::cout << "          invoke it with an ad hoc image(*) "         <<std::endl;
-std::cout << "           check the resulting image   "              <<std::endl; 
+std::cout << "          check the resulting image   "               <<std::endl;
 std::cout << "  "                                                   <<std::endl;
 std::cout << " (*) For samples, user can refer to gdcmData"         <<std::endl;
 std::cout << "         and read README.txt file "                   <<std::endl;
@@ -232,7 +230,7 @@ std::cout << " --- WARNING --- WARNING --- WARNING --- WARNING ---" <<std::endl;
    // Get the image data size
    size_t dataRawSize    = fh1->GetImageDataRawSize();
 
-   // TODO : Newbee user would appreciate any comment !
+   /// \TODO : Newbee user would appreciate any comment !
  
    std::cout << "GetImageDataSize()"    
           << fh1->GetImageDataSize()    << std::endl;
index a585765ab5a524cf555052b107503307e255427e..9c521d00da91bbbb8cf62470b5f06bc0e422a509 100644 (file)
@@ -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;  
          //---------------------------------------------------------