+ else if(mOverlay)
+ mOverlayActor->SetVisibility(false);
+
+ // Fusion image actor
+ if (mFusion && mFusionVisibility) {
+ AdjustResliceToSliceOrientation(mFusionReslice);
+ int fusExtent[6];
+#if VTK_MAJOR_VERSION <= 5
+ this->ConvertImageToImageDisplayExtent(input, w_ext, mFusionReslice->GetOutput(), fusExtent);
+ bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
+#else
+ this->ConvertImageToImageDisplayExtent(mImageReslice->GetOutputInformation(0), w_ext, mFusionReslice->GetOutput(), fusExtent);
+ bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
+#endif
+ mFusionActor->SetVisibility(!out);
+ mFusionActor->SetDisplayExtent( fusExtent );
+#if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
+ // Fix for bug #1882
+ dynamic_cast<vtkImageSliceMapper *>(mFusionActor->GetMapper())->SetOrientation(this->GetOrientation());
+#endif
+ }
+ else if(mFusion)
+ mFusionActor->SetVisibility(false);
+ // Vector field actor
+ double* camera = Renderer->GetActiveCamera()->GetPosition();
+ double* image_bounds = ImageActor->GetBounds();
+ double position[3] = {0, 0, 0};
+ position[this->SliceOrientation] = image_bounds[this->SliceOrientation*2];
+
+ //print_vector<double, 6>("camera", camera);
+ //print_vector<double, 6>("image_bounds", image_bounds);
+ //print_vector<double, 3>("position", position);
+
+ // find where to place the VF actor. to deal with
+ // z-buffer issues, the VF is placed right in front of the image,
+ // subject to a small offset. the position actually depends on the
+ // the location of the camera relative to the image.
+ double offset = 1;
+ if (camera[this->SliceOrientation] < image_bounds[this->SliceOrientation*2])
+ offset = -1;
+
+ if (mVF && mVFVisibility) {
+ AdjustResliceToSliceOrientation(mVFReslice);
+ int vfExtent[6];
+#if VTK_MAJOR_VERSION <= 5
+ mVF->GetVTKImages()[0]->UpdateInformation();
+ this->ConvertImageToImageDisplayExtent(input, w_ext, mVFReslice->GetOutput(), vfExtent);
+ bool out = ClipDisplayedExtent(vfExtent, mVOIFilter->GetInput()->GetWholeExtent());
+#else
+ mVOIFilter->Update();
+ this->ConvertImageToImageDisplayExtent(mImageReslice->GetOutputInformation(0), w_ext, mVFReslice->GetOutput(), vfExtent);
+ bool out = ClipDisplayedExtent(vfExtent, mVOIFilter->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
+#endif
+ mVFActor->SetVisibility(!out);
+ mVOIFilter->SetVOI(vfExtent);
+ int orientation[3] = {1,1,1};
+ orientation[this->SliceOrientation] = 0;
+ mGlyphFilter->SetOrientation(orientation[0], orientation[1], orientation[2]);
+ position[this->SliceOrientation] += offset;
+ mVFActor->SetPosition(position);
+ mVFActor->GetProperty()->SetOpacity(0.995); //in order to get VTK to turn on the alpha-blending in OpenGL
+ mVFMapper->Update();