]> Creatis software - bbtk.git/blobdiff - packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
#3326 BBTK Feature New Normal - gdcm vtk GetXCoherentInfoGdcmReader box option...
[bbtk.git] / packages / gdcmvtk / src / bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
index 6c810593aa5758ca97dc852ed27256119e66655b..2bbf54205c3d2cb9b3e58a091ea1a840de45d107 100644 (file)
@@ -87,7 +87,6 @@ vtkImageData* GetXCoherentInfoGdcmReader::CreateDefaultImage()
 #if defined USE_GDCM
 void GetXCoherentInfoGdcmReader::Process()
 {
-printf("EED GetXCoherentInfoGdcmReader::Process Start\n");
  // Read the *first* image file (a SET of file names is given as input) 
    f = GDCM_NAME_SPACE::File::New();
 
@@ -97,7 +96,6 @@ printf("EED GetXCoherentInfoGdcmReader::Process Start\n");
        } else {
                f->SetFileName( "" );
        } // if
-printf("EED GetXCoherentInfoGdcmReader::Process 1\n");
 
    bool res = f->Load();  
    if ( !res )
@@ -107,6 +105,7 @@ printf("EED GetXCoherentInfoGdcmReader::Process 1\n");
        bbSetOutputOut( CreateDefaultImage() );
        return;
    } // if res
+
  // Get info from the first image file
    int i;
    std::vector<double> v_iop;
@@ -118,7 +117,6 @@ printf("EED GetXCoherentInfoGdcmReader::Process 1\n");
       v_iop.push_back(iop[i]);
        } // for i
    bbSetOutputIOP(v_iop );
-printf("EED GetXCoherentInfoGdcmReader::Process 2\n");
  
    std::vector<double> v_ipp;
    float ipp[3];
@@ -134,8 +132,6 @@ printf("EED GetXCoherentInfoGdcmReader::Process 2\n");
    sh = GDCM_NAME_SPACE::SerieHelper::New();
    std::vector<std::string> gii = bbGetInputIn();
 
-printf("EED GetXCoherentInfoGdcmReader::Process 3\n");
-   
    for(std::vector<std::string>::iterator it = gii.begin();
                                           it != gii.end();
                                         ++it)
@@ -146,17 +142,13 @@ printf("EED GetXCoherentInfoGdcmReader::Process 3\n");
    GDCM_NAME_SPACE::FileList::const_iterator it;
    GDCM_NAME_SPACE::FileList *l;
 
-printf("EED GetXCoherentInfoGdcmReader::Process 4\n");
    // Should only contain one!
    l = sh->GetFirstSingleSerieUIDFileSet();
-printf("EED GetXCoherentInfoGdcmReader::Process 5\n");
 
        if (l==NULL)
        {       
-               printf("EED GetXCoherentInfoGdcmReader::Process Warnning not coherent list/file \n");
                return;
        }
-printf("EED GetXCoherentInfoGdcmReader::Process 6\n");
 
    double zspacing = 0.;
    sh->OrderFileList(l); // this one should compute the *actual* Z Spacing!
@@ -198,19 +190,22 @@ printf("EED GetXCoherentInfoGdcmReader::Process 6\n");
    } // for iitt
    bbSetOutputDicomInfo( vectormapinfodicom );
 
-   if (reader!=NULL)
-   { 
-      reader->Delete();
-      reader = NULL;
-   }
-   reader = vtkGdcmReader::New();
-       //EED 21 mars 2012  FLIP probleme  ..PLOP..
-       reader->SetFlipY(false);
-   //reader->SetFileName( bbGetInputIn().c_str() );
-   reader->SetCoherentFileList(l);
-   reader->Update();
-   reader->GetOutput();
-   bbSetOutputOut( reader->GetOutput() );
+       if (bbGetInputReadRaw()==true)
+       {
+          if (reader!=NULL)
+          { 
+                 reader->Delete();
+                 reader = NULL;
+          }
+          reader = vtkGdcmReader::New();
+               //EED 21 mars 2012  FLIP probleme  ..PLOP..
+               reader->SetFlipY(false);
+          //reader->SetFileName( bbGetInputIn().c_str() );
+          reader->SetCoherentFileList(l);
+          reader->Update();
+          reader->GetOutput();
+          bbSetOutputOut( reader->GetOutput() );
+       } // if bGetInputReadRaw
 }
 #endif
 // endif USE_GDCM
@@ -301,6 +296,7 @@ void GetXCoherentInfoGdcmReader::bbUserSetDefaultValues()
    std::vector<std::string> init;
    init.push_back("");
    bbSetInputIn(init);  
+   bbSetInputReadRaw(true);  
    //reader=NULL;   /// \TODO fixme JPR
 }