]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.cxx
Real-time cropping works
[clitk.git] / vv / vvSlicer.cxx
index 317dc0670f411f54cea1c6f9cb57139aa1c045a8..4acddcece0838e165aa130aafb748a77bffcfcef 100644 (file)
@@ -1100,6 +1100,7 @@ void vvSlicer::UpdateDisplayExtent()
   this->ImageActor->SetDisplayExtent(w_ext);
 #else
   vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
+
   try {
         mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
   } catch (const std::bad_cast& e) {
@@ -1112,7 +1113,11 @@ void vvSlicer::UpdateDisplayExtent()
     this->ImageActor->SetDisplayExtent(w_ext); //initialisation
   } 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;