]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.cxx
Merge branch 'VTK6_Qt5' into VTK6_Qt5_Crop
[clitk.git] / vv / vvSlicer.cxx
index c7e5e027dd269d2b2b68b5e162d111c162f06776..0237ccf23561b07c4467f61c16c03719b245cb82 100644 (file)
@@ -1097,6 +1097,7 @@ void vvSlicer::UpdateDisplayExtent()
   this->ImageActor->SetDisplayExtent(w_ext);
 #if VTK_MAJOR_VERSION >= 6
   vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
+
   try {
         mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
   } catch (const std::bad_cast& e) {
@@ -1108,7 +1109,12 @@ void vvSlicer::UpdateDisplayExtent()
     copyExtent(ext, mRegisterExtent);
   } else {
     int w_croppingRegion[6];
-    copyExtent(mRegisterExtent, w_croppingRegion);
+    if (mUseReducedExtent) {
+        copyExtent(mReducedExtent, w_croppingRegion);
+    } else {
+        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);    
@@ -1128,7 +1134,7 @@ void vvSlicer::UpdateDisplayExtent()
 #if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
 #else
-    bool out = ClipDisplayedExtent(overExtent, this->GetExtent());
+    bool out = ClipDisplayedExtent(overExtent, mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
 #endif
     mOverlayActor->SetVisibility(!out);
     mOverlayActor->SetDisplayExtent( overExtent );
@@ -1148,7 +1154,7 @@ void vvSlicer::UpdateDisplayExtent()
 #if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
 #else
-    bool out = ClipDisplayedExtent(fusExtent, this->GetExtent());
+    bool out = ClipDisplayedExtent(fusExtent, mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
 #endif
     mFusionActor->SetVisibility(!out);
     mFusionActor->SetDisplayExtent( fusExtent );