]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.cxx
Merge branch 'master' into VTK6_Qt5
[clitk.git] / vv / vvSlicer.cxx
index b6e343cb8abaf8a16b60338bbb2819d197b2b563..3773aa0477cec92a846084869972b6a03d3c8d26 100644 (file)
@@ -678,8 +678,8 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
 #else
     mLandClipper->SetInputData(mLandmarks->GetOutput());
 
-    mLandGlyph->SetSourceData(mCross->GetOutput());
-    mLandGlyph->SetInputData(mLandClipper->GetOutput());
+    mLandGlyph->SetSourceConnection(mCross->GetOutputPort());
+    mLandGlyph->SetInputConnection(mLandClipper->GetOutputPort());
 #endif
     //mLandGlyph->SetIndexModeToScalar();
     //mLandGlyph->SetRange(0,1);
@@ -694,6 +694,7 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
     //mLandMapper->ScalarVisibilityOff();
 
     mLandActor->SetMapper(mLandMapper);
+    mLandActor->GetProperty()->SetOpacity(0.995);
     mLandActor->GetProperty()->SetColor(255,10,212);
     mLandActor->SetPickable(0);
     mLandActor->SetVisibility(true);
@@ -1097,6 +1098,7 @@ void vvSlicer::UpdateDisplayExtent()
   this->ImageActor->SetDisplayExtent(w_ext);
 #if VTK_MAJOR_VERSION >= 6
   vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
+
   try {
         mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
   } catch (const std::bad_cast& e) {
@@ -1108,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);    
@@ -1128,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 );
@@ -1148,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 );
@@ -1188,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);