]> Creatis software - gdcm.git/blobdiff - vtk/vtkgdcmSerieViewer.cxx
Fix mistypings
[gdcm.git] / vtk / vtkgdcmSerieViewer.cxx
index fbf81e162e1adfae99e6c0b577fb667efa8d3a8c..f081e02bf76433b72dd9fa739cc383a5dcd59d67 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: vtkgdcmSerieViewer.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/09/07 08:21:28 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2007/06/21 14:47:16 $
+  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
@@ -16,7 +16,7 @@
                                                                                 
 =========================================================================*/
 // This example illustrates how the vtkGdcmReader vtk class can 
-// use the result of gdcm::SerieHelper constructor and check
+// use the result of GDCM_NAME_SPACE::SerieHelper constructor and check
 // the various Setters :
 //     SerieHelper::SetOrderToReverse, 
 //     SerieHelper::SetUserLessThanFunction
@@ -43,7 +43,7 @@
 #include "gdcmDocument.h"  // for NO_SHADOWSEQ
 #include "gdcmSerieHelper.h"
 #include "gdcmDebug.h"
-#include "gdcmValEntry.h"
+#include "gdcmDataEntry.h"
 
 #include "gdcmArgMgr.h" // for Argument Manager functions
 #include <string.h>     // for strcmp
 #define vtkFloatingPointType float
 #endif
 
-void userSuppliedMirrorFunction (uint8_t *im, gdcm::File *f);
-void userSuppliedTopDownFunction(uint8_t *im, gdcm::File *f);
-bool userSuppliedLessThanFunction(gdcm::File *f1, gdcm::File *f2);
-bool userSuppliedLessThanFunction2(gdcm::File *f1, gdcm::File *f2);
+void userSuppliedMirrorFunction (uint8_t *im, GDCM_NAME_SPACE::File *f);
+void userSuppliedTopDownFunction(uint8_t *im, GDCM_NAME_SPACE::File *f);
+bool userSuppliedLessThanFunction(GDCM_NAME_SPACE::File *f1, GDCM_NAME_SPACE::File *f2);
+bool userSuppliedLessThanFunction2(GDCM_NAME_SPACE::File *f1, GDCM_NAME_SPACE::File *f2);
 
 int orderNb;
 uint16_t *elemsToOrderOn;
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
 
 
    // Initialize Arguments Manager   
-   gdcm::ArgMgr *am= new gdcm::ArgMgr(argc, argv);
+   GDCM_NAME_SPACE::ArgMgr *am= new GDCM_NAME_SPACE::ArgMgr(argc, argv);
   
    if (argc == 1 || am->ArgMgrDefined("usage") )
    {
@@ -138,15 +138,15 @@ int main(int argc, char *argv[])
 
    char *dirName = am->ArgMgrWantString("dirname",usage);
 
-   int loadMode = gdcm::LD_ALL;
+   int loadMode = GDCM_NAME_SPACE::LD_ALL;
    if ( am->ArgMgrDefined("noshadowseq") )
-      loadMode |= gdcm::LD_NOSHADOWSEQ;
+      loadMode |= GDCM_NAME_SPACE::LD_NOSHADOWSEQ;
    else 
    {
       if ( am->ArgMgrDefined("noshadow") )
-         loadMode |= gdcm::LD_NOSHADOW;
+         loadMode |= GDCM_NAME_SPACE::LD_NOSHADOW;
       if ( am->ArgMgrDefined("noseq") )
-         loadMode |= gdcm::LD_NOSEQ;
+         loadMode |= GDCM_NAME_SPACE::LD_NOSEQ;
    }
 
    int reverse = am->ArgMgrDefined("reverse");
@@ -171,12 +171,12 @@ int main(int argc, char *argv[])
    int check   = am->ArgMgrDefined("check");
   
    // This is so ugly, a cstring is NOT a char * (god damit!)
-   bool bname = ( strcmp(am->ArgMgrGetString("order", (char*)"not found"),"name")==0 );
+   bool bname = ( strcmp(am->ArgMgrGetString("order", "not found"),"name")==0 );
    if (bname)
       elemsToOrderOn = am->ArgMgrGetXInt16Enum("order", &orderNb);
 
    if (am->ArgMgrDefined("debug"))
-      gdcm::Debug::DebugOn();
+      GDCM_NAME_SPACE::Debug::DebugOn();
 
    /* if unused Param we give up */
    if ( am->ArgMgrPrintUnusedLabels() )
@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
 
    // ----------------------- End Arguments Manager ----------------------
   
-   gdcm::SerieHelper *sh = new gdcm::SerieHelper();
+   GDCM_NAME_SPACE::SerieHelper *sh = GDCM_NAME_SPACE::SerieHelper::New();
    sh->SetLoadMode(loadMode);
    if (reverse)
       sh->SetSortOrderToReverse();
@@ -199,11 +199,11 @@ int main(int argc, char *argv[])
    // Just to see
 
    int nbFiles;
-   // For all the Coherent Files lists of the gdcm::Serie
-   gdcm::FileList *l = sh->GetFirstCoherentFileList();
+   // For all the 'Single Serie UID' FileSets of the GDCM_NAME_SPACE::Serie
+   GDCM_NAME_SPACE::FileList *l = sh->GetFirstSingleSerieUIDFileSet();
    if (l == 0 )
    {
-      std::cout << "Oops! No CoherentFileList found ?!?" << std::endl;
+      std::cout << "Oops! No 'Single Serie UID' FileSet found ?!?" << std::endl;
       return 0;
    }
 
@@ -223,9 +223,10 @@ int main(int argc, char *argv[])
       }
       else
       {
-         std::cout << "Oops! Empty CoherentFileList found ?!?" << std::endl;
+         std::cout << "Oops! Empty 'Single Serie UID' FileSet found ?!?"
+                   << std::endl;
       }
-      l = sh->GetNextCoherentFileList();
+      l = sh->GetNextSingleSerieUIDFileSet();
    }
 
    if (check)
@@ -233,7 +234,7 @@ int main(int argc, char *argv[])
       if ( !sh->IsCoherent(l) ) // just be sure (?)
       {
          std::cout << "Files are not coherent. Stop everything " << std::endl;
-         delete sh;
+         sh->Delete();
          return 0;
       }
    }
@@ -347,7 +348,7 @@ int main(int argc, char *argv[])
       }                                 \
    }
 
-void userSuppliedMirrorFunction(uint8_t *im, gdcm::File *f)
+void userSuppliedMirrorFunction(uint8_t *im, GDCM_NAME_SPACE::File *f)
 {
    if (f->GetZSize() != 1)
    {
@@ -402,7 +403,7 @@ void userSuppliedMirrorFunction(uint8_t *im, gdcm::File *f)
       }                                 \
    }
 
-void userSuppliedTopDownFunction(uint8_t *im, gdcm::File *f)
+void userSuppliedTopDownFunction(uint8_t *im, GDCM_NAME_SPACE::File *f)
 {
    if (f->GetZSize() != 1)
    {
@@ -448,22 +449,22 @@ void userSuppliedTopDownFunction(uint8_t *im, gdcm::File *f)
 // --------------------------------------------------------
 
 
-bool userSuppliedLessThanFunction(gdcm::File *f1, gdcm::File *f2)
+bool userSuppliedLessThanFunction(GDCM_NAME_SPACE::File *f1, GDCM_NAME_SPACE::File *f2)
 {
    // for *this* user supplied function, I supposed only ValEntries are checked.
 // 
    std::string s1, s2;
-   gdcm::ValEntry *e1,*e2;
+   GDCM_NAME_SPACE::DataEntry *e1,*e2;
    for (int ri=0; ri<orderNb; ri++)
    {
       std::cout << std::hex << elemsToOrderOn[2*ri] << "|" 
                             << elemsToOrderOn[2*ri+1]
                             << std::endl;
  
-      e1= f1->gdcm::Document::GetValEntry( elemsToOrderOn[2*ri],
-                                 elemsToOrderOn[2*ri+1]);
+      e1= f1->GetDataEntry( elemsToOrderOn[2*ri],
+                 elemsToOrderOn[2*ri+1]);
 
-      e2= f2->gdcm::Document::GetValEntry( elemsToOrderOn[2*ri],
+      e2= f2->GetDataEntry( elemsToOrderOn[2*ri],
                                  elemsToOrderOn[2*ri+1]);
       if(!e2 || !e2)
       {
@@ -472,8 +473,8 @@ bool userSuppliedLessThanFunction(gdcm::File *f1, gdcm::File *f2)
                               << " not found" << std::endl;
          continue;
       }
-      s1 = e1->gdcm::ValEntry::GetValue();      
-      s2 = e2->gdcm::ValEntry::GetValue();
+      s1 = e1->GetString();      
+      s2 = e2->GetString();
       std::cout << "[" << s1 << "] vs [" << s2 << "]" << std::endl;
       if ( s1 < s2 ) 
          return true;
@@ -493,7 +494,7 @@ bool userSuppliedLessThanFunction(gdcm::File *f1, gdcm::File *f2)
 // Warning : it's up to 'vtkgdcmSerieViewer' user to find a suitable data set !
 // --------------------------------------------------------
 
-bool userSuppliedLessThanFunction2(gdcm::File *f1, gdcm::File *f2)
+bool userSuppliedLessThanFunction2(GDCM_NAME_SPACE::File *f1, GDCM_NAME_SPACE::File *f2)
 {
    std::cout << "[" << f1->GetFileName() << "] vs [" 
                     << f2->GetFileName() << "]" << std::endl;