]> Creatis software - clitk.git/commitdiff
Fix transform update in sequence of overlay/fusion
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 4 Sep 2012 11:11:44 +0000 (13:11 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Tue, 4 Sep 2012 11:11:44 +0000 (13:11 +0200)
vv/vvSlicer.cxx

index abf6306f360164c63b7bbe5e492931c1a0e6c971..cc5662bb23c176288fbde36af6d41064995f4bc8 100644 (file)
@@ -725,15 +725,25 @@ void vvSlicer::SetTSlice(int t)
       mVOIFilter->SetInput(mVF->GetVTKImages()[mCurrentTSlice]);
   }
   if (mOverlay && mOverlayActor->GetVisibility()) {
-    if (mOverlay->GetVTKImages().size() > (unsigned int)mCurrentTSlice) {
-      mCurrentOverlayTSlice = mCurrentTSlice;
+    if (mOverlay->GetVTKImages().size() > (unsigned int)t) {
+      mCurrentOverlayTSlice = t;
       mOverlayReslice->SetInput( mOverlay->GetVTKImages()[mCurrentOverlayTSlice] );
+
+      // Update overlay transform
+      mConcatenatedOverlayTransform->Identity();
+      mConcatenatedOverlayTransform->Concatenate(mOverlay->GetTransform()[mCurrentOverlayTSlice]);
+      mConcatenatedOverlayTransform->Concatenate(mSlicingTransform);
     }
   }
   if (mFusion && mFusionActor->GetVisibility()) {
-    if (mFusion->GetVTKImages().size() > (unsigned int)mCurrentTSlice) {
-      mCurrentFusionTSlice = mCurrentTSlice;
+    if (mFusion->GetVTKImages().size() > (unsigned int)t) {
+      mCurrentFusionTSlice = t;
       mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentFusionTSlice]);
+
+      // Update fusion transform
+      mConcatenatedFusionTransform->Identity();
+      mConcatenatedFusionTransform->Concatenate(mFusion->GetTransform()[mCurrentFusionTSlice]);
+      mConcatenatedFusionTransform->Concatenate(mSlicingTransform);
     }
   }
   if (mSurfaceCutActors.size() > 0)