]> Creatis software - clitk.git/commitdiff
Crop Debug Try
authortbaudier <thomas.baudier@etu.unistra.fr>
Thu, 19 Nov 2015 14:32:27 +0000 (15:32 +0100)
committertbaudier <thomas.baudier@etu.unistra.fr>
Thu, 19 Nov 2015 14:32:27 +0000 (15:32 +0100)
vv/vvSlicer.cxx
vv/vvToolCropImage.cxx

index 317dc0670f411f54cea1c6f9cb57139aa1c045a8..9258fdbfd5f534fee9fdddff872d34bbd22da6d9 100644 (file)
@@ -1099,6 +1099,7 @@ void vvSlicer::UpdateDisplayExtent()
 #if VTK_MAJOR_VERSION <= 5
   this->ImageActor->SetDisplayExtent(w_ext);
 #else
+  cout << mReducedExtent[0] << " " << mReducedExtent[1] << " " << mReducedExtent[2] << " " << mReducedExtent[3] << " " << mReducedExtent[4] << " " << mReducedExtent[5] << endl;
   vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
   try {
         mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
index 539e30ef9ea892727b49348220e9e9e8c2333eae..9482947235e3e230ed80ed985afc5627bb9726b1 100644 (file)
@@ -191,8 +191,10 @@ void vvToolCropImage::InputIsSelected(vvSlicerManager * slicer)
   }
 
 //   Set initial sliders values
-  std::vector<int> imsize = mCurrentSlicerManager->GetImage()->GetSize();
+  int w_ext[6], imsize[3];
+  mCurrentSlicerManager->GetSlicer(0)->GetRegisterExtent(w_ext);
   for(int dim=0; dim<slicer->GetDimension() && dim<3; ++dim){
+    imsize[dim] = w_ext[2*dim+1] - w_ext[2*dim] +1;
     mSliders[dim*2]->setMaximum(imsize[dim]-1);
     mSliders[dim*2+1]->setMaximum(imsize[dim]-1);
     mSliders[dim*2+1]->setValue(imsize[dim]-1);