From: tbaudier Date: Thu, 3 Dec 2015 14:35:40 +0000 (+0100) Subject: Fix the slice modification bug with overlay & fusion X-Git-Tag: v1.4.0~90^2^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8ceca5af09e76383301f8fa20816dc5ceaa4e765;p=clitk.git Fix the slice modification bug with overlay & fusion --- diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 1aaa805..dfcae9c 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -422,7 +422,6 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay) #else mOverlayReslice->SetInputData(0, mOverlay->GetFirstVTKImageData()); #endif - mImageReslice->UpdateInformation(); mOverlayReslice->Update(); if (!mOverlayMapper) @@ -503,7 +502,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode) #if VTK_MAJOR_VERSION <= 5 mFusionMapper->SetInput(mFusionReslice->GetOutput()); #else - mFusionMapper->SetInputData(mFusionReslice->GetOutput()); + mFusionMapper->SetInputConnection(mFusionReslice->GetOutputPort(0)); #endif if (!mFusionActor) { @@ -1095,9 +1094,8 @@ void vvSlicer::UpdateDisplayExtent() // Image actor this->ImageActor->SetVisibility(mImageVisibility); -#if VTK_MAJOR_VERSION <= 5 this->ImageActor->SetDisplayExtent(w_ext); -#else +#if VTK_MAJOR_VERSION >= 6 vtkSmartPointer mapperOpenGL= vtkSmartPointer::New(); try { mapperOpenGL = dynamic_cast(GetImageActor()->GetMapper()); @@ -1108,14 +1106,12 @@ void vvSlicer::UpdateDisplayExtent() } if (mFirstSetSliceOrientation) { copyExtent(ext, mRegisterExtent); - this->ImageActor->SetDisplayExtent(w_ext); //initialisation } else { int w_croppingRegion[6]; 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); + mapperOpenGL->SetCroppingRegion(w_croppingRegion); } #endif @@ -1132,7 +1128,7 @@ void vvSlicer::UpdateDisplayExtent() #if VTK_MAJOR_VERSION <= 5 bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent()); #else - bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); + bool out = ClipDisplayedExtent(overExtent, this->GetExtent()); #endif mOverlayActor->SetVisibility(!out); mOverlayActor->SetDisplayExtent( overExtent ); @@ -1152,7 +1148,7 @@ void vvSlicer::UpdateDisplayExtent() #if VTK_MAJOR_VERSION <= 5 bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent()); #else - bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); + bool out = ClipDisplayedExtent(fusExtent, this->GetExtent()); #endif mFusionActor->SetVisibility(!out); mFusionActor->SetDisplayExtent( fusExtent );