From d1ee3bcc7c506b6c3ffc1b1d67c49506bfa89873 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Thu, 17 Sep 2009 11:17:18 +0000 Subject: [PATCH] add SetInterpolate() --- packages/wxvtk/bbs/boxes/bbSimpleSlicer.bbs | 1 + packages/wxvtk/src/bbwxvtkViewer2D.cxx | 18 +++++++++++++----- packages/wxvtk/src/bbwxvtkViewer2D.h | 8 +++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/wxvtk/bbs/boxes/bbSimpleSlicer.bbs b/packages/wxvtk/bbs/boxes/bbSimpleSlicer.bbs index ea64a61..08b7238 100644 --- a/packages/wxvtk/bbs/boxes/bbSimpleSlicer.bbs +++ b/packages/wxvtk/bbs/boxes/bbSimpleSlicer.bbs @@ -36,6 +36,7 @@ define SimpleSlicer wxvtk input BoxExecute refresh.In2 "Execute the box" input Orientation viewer2D.Orientation "Slicing orientation : 0:yz / 1:xz / 2:xy" input Slice slider.In "Initial slice" + input Interpolate viewer2D.Interpolate "Pixels Interpolation (true/false)" input SliderSize slider.Max "Slider Size" input SliderTitle slider.Title "Slider Title" input SliderOrientation slider.Orientation "Slider Orientation (H/V)" diff --git a/packages/wxvtk/src/bbwxvtkViewer2D.cxx b/packages/wxvtk/src/bbwxvtkViewer2D.cxx index 7c5b5f4..caa2d40 100644 --- a/packages/wxvtk/src/bbwxvtkViewer2D.cxx +++ b/packages/wxvtk/src/bbwxvtkViewer2D.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxvtkViewer2D.cxx,v $ Language: C++ - Date: $Date: 2009/05/28 08:55:45 $ - Version: $Revision: 1.37 $ + Date: $Date: 2009/09/17 11:17:18 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -33,7 +33,7 @@ #include "vtkRenderer.h" #include #include - +#include namespace bbwxvtk { //-------------------------------------------------------------------------- @@ -44,7 +44,7 @@ namespace bbwxvtk ~Viewer2DWidget(); void UpdateView(); vtkRenderer *GetRenderer(); - + vtkImageActor *GetImageActor(); private: bool mFirstTime; Viewer2D *mBox; @@ -226,10 +226,17 @@ namespace bbwxvtk << std::endl; */ } - + // std::cout << "OW = "<< mBox->bbGetWindow() << std::endl; // std::cout << "CW = "<< mBox->bbGetContainingWindow() << std::endl; // std::cout << "Sh = "<< mBox->bbIsShown() << std::endl; + + bool interp = mBox->bbGetInputInterpolate(); + if ( interp ) + imageViewer->GetImageActor()->InterpolateOn(); + else + imageViewer->GetImageActor()->InterpolateOff(); + int orientation = mBox->bbGetInputOrientation(); if (orientation<0 || orientation>2) { @@ -305,6 +312,7 @@ namespace bbwxvtk void Viewer2D::bbUserSetDefaultValues() { bbSetInputIn(NULL); + bbSetInputInterpolate(true); // JP bbSetInputSlice(0); bbSetOutputWidget(0); bbSetOutputRenderer(0); diff --git a/packages/wxvtk/src/bbwxvtkViewer2D.h b/packages/wxvtk/src/bbwxvtkViewer2D.h index bc8cac5..36bc9cb 100644 --- a/packages/wxvtk/src/bbwxvtkViewer2D.h +++ b/packages/wxvtk/src/bbwxvtkViewer2D.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxvtkViewer2D.h,v $ Language: C++ - Date: $Date: 2009/05/15 14:58:08 $ - Version: $Revision: 1.17 $ + Date: $Date: 2009/09/17 11:17:19 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -53,7 +53,8 @@ namespace bbwxvtk BBTK_BLACK_BOX_INTERFACE(Viewer2D,bbtk::WxBlackBox); BBTK_DECLARE_INPUT(Slice, int); - BBTK_DECLARE_INPUT(Orientation, int); + BBTK_DECLARE_INPUT(Interpolate, bool); // JP + BBTK_DECLARE_INPUT(Orientation, int); BBTK_DECLARE_INPUT(In, vtkImageData *); BBTK_DECLARE_OUTPUT(Out, int); @@ -77,6 +78,7 @@ namespace bbwxvtk BBTK_CATEGORY("viewer"); BBTK_INPUT(Viewer2D, Slice, "Initial Slice number", int, ""); BBTK_INPUT(Viewer2D, Orientation, "Slicing orientation : 0:yz / 1:xz / 2:xy", int, ""); + BBTK_INPUT(Viewer2D, Interpolate, "Pixels interpolation: true/false ", bool, ""); // JP BBTK_INPUT(Viewer2D, In, "Input Image", vtkImageData *, ""); BBTK_OUTPUT(Viewer2D,Out, "Current Slice number", int, ""); BBTK_OUTPUT(Viewer2D,Renderer, "vtk Renderer", vtkRenderer*, ""); -- 2.47.1