]> Creatis software - clitk.git/commitdiff
Fix the slice modification bug with overlay & fusion
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 3 Dec 2015 14:35:40 +0000 (15:35 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 3 Dec 2015 14:35:40 +0000 (15:35 +0100)
vv/vvSlicer.cxx

index 1aaa8053a99a377bdf76b7e9e79e5c346b75aace..dfcae9cf4adacba33caa3f049a4abc2c97955c36 100644 (file)
@@ -422,7 +422,6 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay)
 #else
     mOverlayReslice->SetInputData(0, mOverlay->GetFirstVTKImageData());
 #endif
-    mImageReslice->UpdateInformation();
     mOverlayReslice->Update();
 
     if (!mOverlayMapper)
@@ -503,7 +502,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
 #if VTK_MAJOR_VERSION <= 5
     mFusionMapper->SetInput(mFusionReslice->GetOutput());
 #else
-    mFusionMapper->SetInputData(mFusionReslice->GetOutput());
+    mFusionMapper->SetInputConnection(mFusionReslice->GetOutputPort(0));
 #endif
     
     if (!mFusionActor) {
@@ -1095,9 +1094,8 @@ void vvSlicer::UpdateDisplayExtent()
   
   // Image actor
   this->ImageActor->SetVisibility(mImageVisibility);
-#if VTK_MAJOR_VERSION <= 5
   this->ImageActor->SetDisplayExtent(w_ext);
-#else
+#if VTK_MAJOR_VERSION >= 6
   vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
   try {
         mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
@@ -1108,14 +1106,12 @@ void vvSlicer::UpdateDisplayExtent()
   }
   if (mFirstSetSliceOrientation) {
     copyExtent(ext, mRegisterExtent);
-    this->ImageActor->SetDisplayExtent(w_ext); //initialisation
   } else {
     int w_croppingRegion[6];
     copyExtent(mRegisterExtent, w_croppingRegion);
-    this->ImageActor->SetDisplayExtent(w_ext);
     w_croppingRegion[ this->SliceOrientation*2   ] = this->Slice;
     w_croppingRegion[ this->SliceOrientation*2+1 ] = this->Slice;
-    mapperOpenGL->SetCroppingRegion(w_croppingRegion);
+    mapperOpenGL->SetCroppingRegion(w_croppingRegion);    
   }
 #endif 
   
@@ -1132,7 +1128,7 @@ void vvSlicer::UpdateDisplayExtent()
 #if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
 #else
-    bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
+    bool out = ClipDisplayedExtent(overExtent, this->GetExtent());
 #endif
     mOverlayActor->SetVisibility(!out);
     mOverlayActor->SetDisplayExtent( overExtent );
@@ -1152,7 +1148,7 @@ void vvSlicer::UpdateDisplayExtent()
 #if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
 #else
-    bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
+    bool out = ClipDisplayedExtent(fusExtent, this->GetExtent());
 #endif
     mFusionActor->SetVisibility(!out);
     mFusionActor->SetDisplayExtent( fusExtent );