X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicer.cxx;h=2089d41caa3d564e5e076b0e3f94df4710d56fb5;hb=HEAD;hp=bcfbbfc0145fa6cc2d8faa3d370726380255761b;hpb=92044073d6c8ff23ca0ebb8664e46c0a8cf86ea0;p=clitk.git diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index bcfbbfc..2089d41 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -24,6 +24,7 @@ #include "vvSlicerManagerCommand.h" #include "vvGlyphSource.h" #include "vvGlyph2D.h" +#include "vvUtils.h" #include #include @@ -134,7 +135,7 @@ vvSlicer::vvSlicer() pdmA = vtkSmartPointer::New(); pdmA->SetMapper(pdm); - pdmA->GetProperty()->SetColor(255,10,212); + pdmA->GetProperty()->SetColor(1,0,0); pdmA->SetVisibility(0); pdmA->SetPickable(0); @@ -268,7 +269,7 @@ void vvSlicer::ToggleContourSuperposition() //------------------------------------------------------------------------------ -void vvSlicer::SetCursorColor(int r,int g, int b) +void vvSlicer::SetCursorColor(double r, double g, double b) { pdmA->GetProperty()->SetColor(r,g,b); } @@ -352,6 +353,8 @@ void vvSlicer::SetImage(vvImage::Pointer image) if (!mImageReslice) { mImageReslice = vtkSmartPointer::New(); mImageReslice->SetInterpolationModeToLinear(); + SetInterpolationImageReslice(getInterpolationFavoriteStatus()); + GetImageActor()->SetInterpolate(getInterpolationFavoriteStatus()); mImageReslice->AutoCropOutputOn(); mImageReslice->SetBackgroundColor(-1000,-1000,-1000,1); } @@ -425,7 +428,7 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay) mConcatenatedOverlayTransform->Identity(); mConcatenatedOverlayTransform->Concatenate(mOverlay->GetTransform()[0]); mConcatenatedOverlayTransform->Concatenate(mSlicingTransform); - mOverlayReslice->SetResliceTransform(mConcatenatedOverlayTransform); + mOverlayReslice->SetResliceAxes(mConcatenatedOverlayTransform->GetMatrix()); #if VTK_MAJOR_VERSION <= 5 mOverlayReslice->SetInput(0, mOverlay->GetFirstVTKImageData()); mImageReslice->UpdateInformation(); @@ -455,6 +458,7 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay) #if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10) mOverlayActor->GetMapper()->BorderOn(); #endif + mOverlayActor->SetInterpolate(getInterpolationFavoriteStatus()); } //stupid but necessary : the Overlay need to be rendered before fusion @@ -492,7 +496,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode) mConcatenatedFusionTransform->Identity(); mConcatenatedFusionTransform->Concatenate(mFusion->GetTransform()[0]); mConcatenatedFusionTransform->Concatenate(mSlicingTransform); - mFusionReslice->SetResliceTransform(mConcatenatedFusionTransform); + mFusionReslice->SetResliceAxes(mConcatenatedFusionTransform->GetMatrix()); #if VTK_MAJOR_VERSION <= 5 mFusionReslice->SetInput(0, mFusion->GetFirstVTKImageData()); mFusionReslice->UpdateInformation(); @@ -530,6 +534,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode) mFusionActor->GetMapper()->BorderOn(); #endif + mFusionActor->SetInterpolate(getInterpolationFavoriteStatus()); this->GetRenderer()->AddActor(mFusionActor); } @@ -597,7 +602,7 @@ void vvSlicer::SetVF(vvImage::Pointer vf) mConcatenatedVFTransform->Identity(); mConcatenatedVFTransform->Concatenate(mVF->GetTransform()[0]); mConcatenatedVFTransform->Concatenate(mSlicingTransform); - mVFReslice->SetResliceTransform(mConcatenatedVFTransform); + mVFReslice->SetResliceAxes(mConcatenatedVFTransform->GetMatrix()); #if VTK_MAJOR_VERSION <= 5 mVFReslice->SetInput(0, mVF->GetFirstVTKImageData()); #else @@ -653,7 +658,9 @@ void vvSlicer::SetVF(vvImage::Pointer vf) #else mVFMapper->SetInputConnection(mGlyphFilter->GetOutputPort()); #endif +#ifndef VTK_OPENGL2 mVFMapper->ImmediateModeRenderingOn(); +#endif mVFMapper->SetLookupTable(mVFColorLUT); if (!mVFActor) @@ -981,7 +988,7 @@ void vvSlicer::SetSliceOrientation(int orientation) copyExtent(ext, extent); #endif - if (extent[5]-extent[4] <= 2) + if (extent[5]-extent[4] < 1) orientation = vtkImageViewer2::SLICE_ORIENTATION_XY; if (orientation < vtkImageViewer2::SLICE_ORIENTATION_YZ ||