]> Creatis software - clitk.git/commitdiff
Fixed slice error: check that it is in extent before updating extents
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 30 Oct 2012 10:50:05 +0000 (11:50 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 30 Oct 2012 10:50:05 +0000 (11:50 +0100)
vv/vvSlicer.cxx

index a915a6b84b1b616e16430e23dad84853e2d7eee3..d3a8dec85839cc1902a004fd3a75a851b6c29887 100644 (file)
@@ -904,15 +904,15 @@ void vvSlicer::UpdateDisplayExtent()
     return;
   }
   input->UpdateInformation();
+  this->SetSlice( this->GetSlice() ); //SR: make sure the update let the slice in extents
 
   // Local copy of extent
   int w_ext[6];
   int* ext = GetExtent();
   copyExtent(ext, w_ext);
   // Set slice value
-  int s = this->Slice > ext[this->SliceOrientation*2+1] ? ext[this->SliceOrientation*2 + 1] : this->Slice;
-  w_ext[ this->SliceOrientation*2   ] = s;
-  w_ext[ this->SliceOrientation*2+1 ] = s;
+  w_ext[ this->SliceOrientation*2   ] = this->Slice;
+  w_ext[ this->SliceOrientation*2+1 ] = this->Slice;
   
   // Image actor
   this->ImageActor->SetDisplayExtent(w_ext);