]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbcreaMaracasVisuSliceImage.cxx
#3465 SetwxVtkBaseViewSetOpacityAxis box
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuSliceImage.cxx
index 10306c6f34b3fc7a16292bc9746365c101369cc2..653b0c85ddf15d75110fa2c9878cf5599f893222 100644 (file)
@@ -39,7 +39,14 @@ void SliceImage::Process()
        //std::cout<<"MSJ: test SliceImage::Process()"<<this<<std::endl;
        if ( bbGetInputIn()!=NULL )
        {
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
          imageReslice->SetInput( bbGetInputIn() );
+#else
+         imageReslice->SetInputData( bbGetInputIn() );
+#endif
+
          imageReslice->SetInformationInput(bbGetInputIn() );
 
          double slice=bbGetInputSlice();
@@ -68,20 +75,37 @@ void SliceImage::Process()
               imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
          } else if (bbGetInputTypeOrientation()==2)
          {
-               // Orientation 2 = YZ
-               // v1 = [ 0 , 0 ,-1 ]
-               // v2 = [ 1 , 0 , 0 ]
-               // v3 = [ 0 ,-1 , 0 ]
+               // Orientation 2 = Y-Z
+               // v1 = [ 0 , 1 ,0 ]
+               // v2 = [ 0 , 0 ,-1 ]
+               // v3 = [ -1 ,0 , 0 ]
                // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
-              imageReslice->SetResliceAxesDirectionCosines(0,1,0, 0,0,-1 ,-1,0,0);  
+              imageReslice->SetResliceAxesDirectionCosines( 0,1,0,    0,0,-1,   -1,0,0 );  
+              imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
+         } else if (bbGetInputTypeOrientation()==-2)
+         {
+               // Orientation -2 = ZY
+               // v1 = [ 0 , 0 , 1 ]
+               // v2 = [ 0 , 1 , 0 ]
+               // v3 = [ -1, 0 , 0 ]
+               // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
+              imageReslice->SetResliceAxesDirectionCosines( 0,0,1,    0,1,0,   -1,0,0 );  
               imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
          } else if (bbGetInputTypeOrientation()==1) {     
-               // Orientation 1 = XZ
+               // Orientation 1 = X-Z  
+               // v1 = [ 1 , 0 , 0 ]
+               // v2 = [ 0 , 0 , -1 ]
+               // v3 = [ 0 ,1 , 0 ]
+               // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
+              imageReslice->SetResliceAxesDirectionCosines( 1,0,0,   0,0,-1,   0,1,0 ); 
+              imageReslice->SetResliceAxesOrigin(0, slice*bbGetInputIn()->GetSpacing()[1],0 );
+         } else if (bbGetInputTypeOrientation()==-1) {     
+               // Orientation -1 = XZ 
                // v1 = [ 1 , 0 , 0 ]
                // v2 = [ 0 , 0 , 1 ]
                // v3 = [ 0 ,-1 , 0 ]
                // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
-              imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,-1 ,0,1,0); 
+              imageReslice->SetResliceAxesDirectionCosines( 1,0,0,   0,0,1,   0,-1,0 ); 
               imageReslice->SetResliceAxesOrigin(0, slice*bbGetInputIn()->GetSpacing()[1],0 );
          } else    
          {
@@ -95,9 +119,25 @@ void SliceImage::Process()
          } 
          imageReslice->SetOutputDimensionality(2);
          imageReslice->SetInterpolationModeToLinear();
+
+
+
+
+
+
+
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
          imagedata = imageReslice->GetOutput();
          imagedata->Update();
          imagedata->UpdateInformation();       
+#else
+         imageReslice->Update();
+         imagedata = imageReslice->GetOutput();
+#endif
+
        }
   bbSetOutputOut( imagedata );
 }