]> Creatis software - bbtk.git/commitdiff
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Wed, 6 Sep 2017 09:35:59 +0000 (11:35 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Wed, 6 Sep 2017 09:35:59 +0000 (11:35 +0200)
packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.cxx
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx

index 87012ecd6b44ead87b82ddfb823e19f52a60ad29..a08b352471e295ccce65139e2efd25bf99e87913 100644 (file)
@@ -77,7 +77,9 @@ void GetInfoGdcmReader::Process()
    f->GetImagePositionPatient(ipp);
    
    for(i=0; i< 3; i++)
+       {
       v_ipp.push_back(ipp[i]);
+       } // for i
    bbSetOutputIPP(v_ipp );
 
    std::vector<double> v_pixelspacing;
@@ -87,7 +89,7 @@ void GetInfoGdcmReader::Process()
    if (f->GetZSize() != 1) 
    {
       v_pixelspacing.push_back(f->GetZSpacing());
-   }
+   } // if size
    bbSetOutputPixelSpacing(v_pixelspacing);
    
    //double interslice;
@@ -95,10 +97,11 @@ void GetInfoGdcmReader::Process()
    
    reader = vtkGdcmReader::New();
    reader->SetFileName( bbGetInputIn().c_str() );
+   reader->SetFlipY(true);
    reader->Update();
    reader->GetOutput();
 
-   vtkIndent indent ;
+//   vtkIndent indent ;
 //   reader->GetOutput()->PrintSelf(std::cout, indent);
    bbSetOutputOut( reader->GetOutput() );
 }
@@ -131,8 +134,10 @@ void GetInfoGdcmReader::Process()
    deIop.GetValue().Print(ss);
    gdcm::Element<gdcm::VR::DS,gdcm::VM::VM6> iop;
    iop.Read( ss );
-   for(i=0; i< 6; i++)
+   for(i=0; i< 6; i++) 
+       {
       v_iop.push_back((float)(iop[i]));
+       } // for i
    bbSetOutputIOP(v_iop );
  
    // Image Position (Patient)
@@ -141,8 +146,10 @@ void GetInfoGdcmReader::Process()
    deIpp.GetValue().Print(ss);
    gdcm::Element<gdcm::VR::DS,gdcm::VM::VM3> ipp;
    ipp.Read( ss );
-         for(i=0; i< 3; i++)
+   for(i=0; i< 3; i++)
+       {
                v_ipp.push_back((float)(ipp[i]));
+       } // for
    bbSetOutputIPP(v_ipp );
 
    std::vector<double> v_pixelspacing = gdcm::ImageHelper::GetSpacingValue(f);
index 751c683c37053cc58e3764e8db6d403ce42b4be8..c1d16ba58fb15afc84ccce9badb0f3705362fa51 100644 (file)
@@ -96,7 +96,7 @@ void GetXCoherentInfoGdcmReader::Process()
                f->SetFileName( bbGetInputIn()[0] );
        } else {
                f->SetFileName( "" );
-       }
+       } // if
    
    bool res = f->Load();  
    if ( !res )
@@ -105,7 +105,7 @@ void GetXCoherentInfoGdcmReader::Process()
        f->Delete();
        bbSetOutputOut( CreateDefaultImage() );
        return;
-   }
+   } // if res
  // Get info from the first image file
    int i;
    std::vector<double> v_iop;
@@ -113,7 +113,9 @@ void GetXCoherentInfoGdcmReader::Process()
    f->GetImageOrientationPatient(iop);
    
    for(i=0; i< 6; i++)
+       {
       v_iop.push_back(iop[i]);
+       } // for i
    bbSetOutputIOP(v_iop );
  
    std::vector<double> v_ipp;
@@ -121,7 +123,9 @@ void GetXCoherentInfoGdcmReader::Process()
    f->GetImagePositionPatient(ipp);
    
    for(i=0; i< 3; i++)
+       {
       v_ipp.push_back(ipp[i]);
+       } // for i
    bbSetOutputIPP(v_ipp );
 
 // Add *all the files* to the SerieHelper
@@ -133,7 +137,7 @@ void GetXCoherentInfoGdcmReader::Process()
                                         ++it)
    {
       sh->AddFileName(*it);
-   }
+   } //for vector
 
 
    GDCM_NAME_SPACE::FileList::const_iterator it;
@@ -143,10 +147,10 @@ void GetXCoherentInfoGdcmReader::Process()
    l = sh->GetFirstSingleSerieUIDFileSet();
 
    int nbFiles;
-   double zspacing = 0.;
-   nbFiles = l->size() ;
+   double zspacing     = 0.;
+   nbFiles                     = l->size() ;
    sh->OrderFileList(l); // this one should compute the *actual* Z Spacing!
-   zspacing = sh->GetZSpacing();
+   zspacing            = sh->GetZSpacing();
    std::vector<double> v_pixelspacing;
    v_pixelspacing.push_back( f->GetXSpacing() );
    v_pixelspacing.push_back( f->GetYSpacing() );
@@ -155,21 +159,20 @@ void GetXCoherentInfoGdcmReader::Process()
 //      v_pixelspacing.push_back(f->GetZSpacing());
 //   }
    bbSetOutputPixelSpacing(v_pixelspacing);
-
    if (reader!=NULL)
    { 
       reader->Delete();
-      reader=NULL;
+      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();
+
+printf("EED GetXCoherentInfoGdcmReader::Process \n");
    bbSetOutputOut( reader->GetOutput() );
 }
 #endif
@@ -202,7 +205,9 @@ void GetXCoherentInfoGdcmReader::Process()
    gdcm::Element<gdcm::VR::DS,gdcm::VM::VM6> iop;
    iop.Read( ss );
    for(i=0; i< 6; i++)
-      v_iop.push_back((float)(iop[i]));
+       {
+       v_iop.push_back((float)(iop[i]));
+       }
    bbSetOutputIOP(v_iop );
  
   std::vector<double> v_ipp;
@@ -210,7 +215,8 @@ void GetXCoherentInfoGdcmReader::Process()
    deIpp.GetValue().Print(ss);
    gdcm::Element<gdcm::VR::DS,gdcm::VM::VM3> ipp;
    ipp.Read( ss );
-       for(i=0; i< 3; i++){
+       for(i=0; i< 3; i++)
+       {
                v_ipp.push_back((float)(ipp[i]));
        } // for 3
    bbSetOutputIPP(v_ipp );
@@ -272,11 +278,17 @@ void GetXCoherentInfoGdcmReader::bbUserInitializeProcessing()
 void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing()
 {
    if(reader)
+       {
       reader->Delete();
+       } // if reader
    if(f)
+       {
       f->Delete();
+       } // if f
    if(sh)
+       {
       sh->Delete();      
+       } // if sh
 }
 #endif
 
@@ -284,7 +296,9 @@ void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing()
 void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing()
 {
    if(reader)
+       {
       reader->Delete();
+       }
 }
 #endif