]> Creatis software - creaRigidRegistration.git/blobdiff - PackRecalage/src/bbPackRecalageReSlicerBox.cxx
#3221 creaRigidRegistration Feature New Normal - vtk8itk4wx3-mingw64
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageReSlicerBox.cxx
index 984f4549b516ecd42adb04886e9f2f7deecaf3da..e5b29da37ab17b1db8fbf0a3f0b5f9ef0fa4e790 100644 (file)
@@ -81,15 +81,20 @@ void ReSlicerBox::Process()
        if(!bbGetInputOrigin().empty()  && bbGetInputTransform() != NULL)
        {
                //image = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                image->SetInput( bbGetInputIn() );
+#else
+               image->SetInputData( bbGetInputIn() );
+#endif
                image->SetOutputSpacing( 1,1,1 );
 
                if(bbGetInputCentered())
                {
                        image->CenterImageOn();
                }
-
-                double tmpbackInfo[19];
+               image->Update();
+        double tmpbackInfo[19];
                GetBackInfo(tmpbackInfo,bbGetInputTransform()->GetMatrix(),bbGetInputOrigin() );
 
                if ( CompareBackInfo(backInfoA,tmpbackInfo)==false ) 
@@ -97,7 +102,12 @@ void ReSlicerBox::Process()
                        GetBackInfo(backInfoA,bbGetInputTransform()->GetMatrix(),bbGetInputOrigin() );
 
                        //slicer =vtkImageReslice::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        slicer->SetInput( image->GetOutput() );
+#else
+                       slicer->SetInputData( image->GetOutput() );
+#endif
                        slicer->SetInformationInput( image->GetOutput() );
                        slicer->SetResliceTransform(bbGetInputTransform());
                        slicer->SetOutputOrigin( -(bbGetInputOrigin()[0]) , -(bbGetInputOrigin()[1]) , -(bbGetInputOrigin()[2]) );
@@ -109,12 +119,17 @@ void ReSlicerBox::Process()
                        slicer->Update();
 
                        //imageResult = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                        imageResult->SetInput( slicer->GetOutput() );
+#else
+                       imageResult->SetInputData( slicer->GetOutput() );
+#endif
                        double spc[3];
                        bbGetInputIn()->GetSpacing(spc);
                        imageResult->SetOutputSpacing( spc ); 
                        imageResult->SetOutputOrigin( 0,0,0 ); 
-       
+                       imageResult->Update();
                        bbSetOutputOut( imageResult->GetOutput() );
 
                        if (bbGetInputTransform()!=NULL)
@@ -163,16 +178,16 @@ void ReSlicerBox::bbUserInitializeProcessing()
 //    Here does nothing  
 //    but this is where you should allocate the internal/output pointers  
 //    if any  
-       image = vtkImageChangeInformation::New();
-    slicer =vtkImageReslice::New();
+       image           = vtkImageChangeInformation::New();
+    slicer             = vtkImageReslice::New();
        imageResult = vtkImageChangeInformation::New();
 }
        
 void ReSlicerBox::bbUserFinalizeProcessing()
 { 
-       image->Delete();
-       slicer->Delete();
-    imageResult->Delete();
+       image           -> Delete();
+       slicer          -> Delete();
+    imageResult        -> Delete();
 }
 
 }