X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicer.cxx;h=3773aa0477cec92a846084869972b6a03d3c8d26;hb=d6a6a206c0a533a60519e9b3e82fba48d1240c3e;hp=6c7dc7b7c00e6876868328aa4351a523eccfc66a;hpb=a415e9ff5d968ac3ddcf820955f8a1f75bbde185;p=clitk.git diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 6c7dc7b..3773aa0 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -1098,6 +1098,7 @@ void vvSlicer::UpdateDisplayExtent() this->ImageActor->SetDisplayExtent(w_ext); #if VTK_MAJOR_VERSION >= 6 vtkSmartPointer mapperOpenGL= vtkSmartPointer::New(); + try { mapperOpenGL = dynamic_cast(GetImageActor()->GetMapper()); } catch (const std::bad_cast& e) { @@ -1109,7 +1110,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); @@ -1129,7 +1135,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 ); @@ -1149,7 +1155,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 ); @@ -1189,7 +1195,7 @@ void vvSlicer::UpdateDisplayExtent() #if VTK_MAJOR_VERSION <= 5 bool out = ClipDisplayedExtent(vfExtent, mVOIFilter->GetInput()->GetWholeExtent()); #else - bool out = ClipDisplayedExtent(vfExtent, this->GetExtent()); + bool out = ClipDisplayedExtent(vfExtent, mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); #endif mVFActor->SetVisibility(!out); mVOIFilter->SetVOI(vfExtent);