From b7b0742cc0f489572dbb8d68353e1c7a525b59e5 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 19 Nov 2015 15:32:27 +0100 Subject: [PATCH] Crop Debug Try --- vv/vvSlicer.cxx | 1 + vv/vvToolCropImage.cxx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 317dc06..9258fdb 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -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 mapperOpenGL= vtkSmartPointer::New(); try { mapperOpenGL = dynamic_cast(GetImageActor()->GetMapper()); diff --git a/vv/vvToolCropImage.cxx b/vv/vvToolCropImage.cxx index 539e30e..9482947 100644 --- a/vv/vvToolCropImage.cxx +++ b/vv/vvToolCropImage.cxx @@ -191,8 +191,10 @@ void vvToolCropImage::InputIsSelected(vvSlicerManager * slicer) } // Set initial sliders values - std::vector imsize = mCurrentSlicerManager->GetImage()->GetSize(); + int w_ext[6], imsize[3]; + mCurrentSlicerManager->GetSlicer(0)->GetRegisterExtent(w_ext); for(int dim=0; dimGetDimension() && 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); -- 2.47.1