]> Creatis software - gdcm.git/commitdiff
Fix GetImageDataVector() vs GetImageData()
authorjpr <jpr>
Fri, 8 Apr 2011 00:11:36 +0000 (00:11 +0000)
committerjpr <jpr>
Fri, 8 Apr 2011 00:11:36 +0000 (00:11 +0000)
vtk/test4DSplitter.cxx
vtk/vtkGdcm4DSplitter.cxx
vtk/vtkGdcm4DSplitter.h

index bab06418d99001735df3241c82d490a37f535910..9c6f8ccfe5a9d8a7d8a1e1c6409b188a515f0957 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: test4DSplitter.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/03/31 21:45:12 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2011/04/08 00:11:36 $
+  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
@@ -57,8 +57,10 @@ int main(int argc, char *argv[])
   
    std::cout << "... inside " << argv[0] << std::endl;
 
-     
+// 3D     
+//std::string strDirName("/home/jpr/Desktop/Patients_Emilie/Patient.3T/AUB Jos/AUBERTIN JOSEPH/PROSTATE - 305629373/dSSh_DWISENSE_602");
 
+// 4D
 std::string strDirName("/home/jpr/Desktop/Patients_Emilie/Patient.3T/AUB Jos/AUBERTIN JOSEPH/PROSTATE - 305629373/DYN7INJDYN6_901");
    
 
@@ -81,7 +83,7 @@ std::vector<vtkImageData*> *output;
    spl->setDirName(strDirName);
    spl->setRecursive(false);
    spl->setSplitOnPosition();
-
+   //spl->setSplitOnOrientation();
    // Time triger : 0018|1060
    grSort=0x0018;
    elSort=0x1060;
@@ -109,11 +111,14 @@ std::cout << "--------------------------------" << std::endl;
 std::cout << "Vector size " << output->size()   << std::endl;
 std::cout << "--------------------------------" << std::endl;
 
+//(*output)[0]->PrintSelf(std::cout, vtkIndent(2));
+
 std::vector<vtkImageData*>::iterator it;
 // Print the first one (why not?)
-it=output->begin();
-(*it)->PrintSelf(std::cout, vtkIndent(2));
-
+ for(it=output->begin(); it!=output->end(); ++it) {
+   std::cout << "========================================" << std::endl;
+   (*it)->PrintSelf(std::cout, vtkIndent(2));
+ }
 
 // Pour un directory '4D'
 // en sortie, chaque  vtkImageData contiendra un volume au cours du temps.
index a46441f7212af8b75c1ebfa99221b859797fddba..352b14705392ae82c338ba66a55d1cdbcc332926 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: vtkGdcm4DSplitter.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/04/05 13:56:31 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2011/04/08 00:11:36 $
+  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
@@ -102,8 +102,8 @@ User will have to specify some points
 . Get the result
 ----------------
 
- -a single vtkImageData:
-        vtkImageData *GetImageData();
+// -a single vtkImageData:
+//        vtkImageData *GetImageData();
 - a vector of vtkImageData
         std::vector<vtkImageData*> *GetImageDataVector();
 
@@ -131,8 +131,9 @@ User will have to specify some points
  }
 
  std::vector<vtkImageData*> * vtkGdcm4DSplitter::GetImageDataVector() 
- {
- if (verbose) std::cout << "TypeDir " << TypeDir << std::endl;
+ { 
+/*
+ if (verbose) std::cout << "GetImageDataVector : TypeResult " << TypeResult << std::endl;
     if (TypeResult == 2)
        return ImageDataVector;
     else
@@ -144,19 +145,25 @@ User will have to specify some points
       }
       else
          return (std::vector<vtkImageData*>*) NULL;
+*/
+     return ImageDataVector;
  }
  
  vtkImageData *vtkGdcm4DSplitter::GetImageData() 
  {
+ /*
+  if (verbose) std::cout << "GetImageData : TypeResult " << TypeResult << std::endl;
     if (TypeResult == 1)
        return ImageData;
     else
-      if (TypeResult == 1)
+      if (TypeResult == 2)
       {
          return (*ImageDataVector)[0];      
       }
       else
          return (vtkImageData*) NULL;
+*/
+   return (*ImageDataVector)[0]; 
  }      
        
  bool vtkGdcm4DSplitter::setDirName(std::string &dirName) 
@@ -419,10 +426,19 @@ User will have to specify some points
        reader->Update();
        
        /// \TODO : remove the following
-       //if (verbose) reader->GetOutput()->PrintSelf(std::cout, vtkIndent(2));
+       if (verbose) {
+          std::cout << "reader->GetOutput() :" << std::endl;
+          reader->GetOutput()->PrintSelf(std::cout, vtkIndent(2));
+       }
        
        ImageDataVector->push_back(reader->GetOutput() );
-
+       
+       std::vector<vtkImageData*>::iterator it; 
+       if (verbose)      
+       for(it=ImageDataVector->begin(); it!=ImageDataVector->end(); ++it) {
+         std::cout << "-in vtkGdcm4DSplitter--------------------------" << std::endl;
+         (*it)->PrintSelf(std::cout, vtkIndent(2));
+       }
        std::cout << std::endl;
    }
 
index 6724a41f41b9026e791dccf0ab6a117c3221f370..105f2894f6a6714f83307041631731c8b7177129 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: vtkGdcm4DSplitter.h,v $
   Language:  C++
-  Date:      $Date: 2011/04/04 17:01:03 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2011/04/08 00:11:36 $
+  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
@@ -24,7 +24,7 @@
 #include "gdcmDirList.h"
 #include "gdcmFile.h"
 
-typedef  bool (*FoncComp)                       (GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2);
+typedef  bool (*FoncComp)(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2);
 
 #define CALL_MEMBER_FONC(object, ptrToFoncMember)  ((object).*(ptrToFoncMember))