From: Eduardo DAVILA Date: Sun, 21 Feb 2016 00:27:43 +0000 (+0100) Subject: #2844 creaMaracasVisu Feature New Normal - ManualPaint_model box, Refresh TransferF... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaMaracasVisu.git;a=commitdiff_plain;h=439cc05f12e61d0ba090ec0c2ba8701d382238d7 #2844 creaMaracasVisu Feature New Normal - ManualPaint_model box, Refresh TransferFunction for VolumeRendering, Interpolate On-Off --- diff --git a/bbtk/bbs/appli/exampleManualPaint_Model.bbg b/bbtk/bbs/appli/exampleManualPaint_Model.bbg new file mode 100644 index 0000000..5e3ed2c --- /dev/null +++ b/bbtk/bbs/appli/exampleManualPaint_Model.bbg @@ -0,0 +1,73 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualPaint_Model.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:5 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +-20.719202:37.503752:-900.000000 +24.855798:27.503752:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +13.317569:11.946841:-900.000000 +73.957569:1.946841:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ManualPaint_Model:Box02 +ISEXEC:FALSE +-34.570272:-27.312727:-900.000000 +11.004728:-37.312727:-900.000000 +PORT +Range:"0 5000" +PORT +ToleranceFill:"1000" +FIN_BOX +BOX +wx:LayoutSplit:Box03 +ISEXEC:TRUE +-33.242398:-62.130103:-900.000000 +12.332602:-72.130103:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CheckBox:Box11 +ISEXEC:FALSE +-71.542604:11.836581:-900.000000 +-25.967604:1.836581:-900.000000 +PORT +Title:"Paint" +FIN_BOX +CONNECTIONS:7 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box01:Point:Box02:Point +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box01:BoxChange:Box02:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box02:Active +NumberOfControlPoints:0 +CONNECTION +Box11:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box02:Image +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleManualPaint_Model.bbs b/bbtk/bbs/appli/exampleManualPaint_Model.bbs new file mode 100644 index 0000000..1b249c4 --- /dev/null +++ b/bbtk/bbs/appli/exampleManualPaint_Model.bbs @@ -0,0 +1,51 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualPaint_Model.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + +new creaMaracasVisu:ManualPaint_Model Box02 + set Box02.Range "0 5000" + set Box02.ToleranceFill "1000" + +new wx:LayoutSplit Box03 + set Box03.Orientation "H" + +new wx:CheckBox Box11 + set Box11.Title "Paint" + + +connect Box00.Out Box01.In + +connect Box01.Point Box02.Point + +connect Box01.Widget Box03.Widget2 + +connect Box01.BoxChange Box02.BoxExecute + +connect Box11.Out Box02.Active + +connect Box11.Widget Box03.Widget1 + +connect Box00.Out Box02.Image + + + +# Complex input ports +exec Box03 diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx new file mode 100644 index 0000000..87c4312 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx @@ -0,0 +1,121 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaMaracasVisuManualPaint_Model.h" +#include "bbcreaMaracasVisuPackage.h" +namespace bbcreaMaracasVisu +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ManualPaint_Model) +BBTK_BLACK_BOX_IMPLEMENTATION(ManualPaint_Model,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ManualPaint_Model::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetActive( bbGetInputActive() ); + manualpaintmodel->SetTool( bbGetInputTool() ); + manualpaintmodel->Set2D3D( bbGetInput2D3D() ); + manualpaintmodel->SetImage( bbGetInputImage() ); + manualpaintmodel->SetGrayLevel( bbGetInputGrayLevel() ); + manualpaintmodel->SetDirection( bbGetInputDirection() ); + manualpaintmodel->SetBrushSize( bbGetInputBrushSize() ); + manualpaintmodel->SetBrushForm( bbGetInputBrushForm() ); + manualpaintmodel->SetToleranceFill( bbGetInputToleranceFill() ); + manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() ); + manualpaintmodel->SetRangeMin( bbGetInputRange()[0] ); + manualpaintmodel->SetRangeMax( bbGetInputRange()[1] ); + manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] ); + } else { + printf("EED Warning: Image not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n"); + } // if +// manualpaintmodel-> GetScalarRange(double * range); +// manualpaintmodel-> SetUndoImage(); //DFCH +// manualpaintmodel-> Undo(); //DFCH +// manualpaintmodel-> Redo(); //DFCH + + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ManualPaint_Model::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + + bbSetInputActive(true); + bbSetInputTool(1); // Paint + bbSetInput2D3D(1); // 3D + bbSetInputImage(NULL); + bbSetInputGrayLevel(100); + bbSetInputDirection(2); // XY + bbSetInputBrushSize(3); + bbSetInputBrushForm(1); // sphere + bbSetInputToleranceFill(50); + bbSetInputDistanceFill(25); + + std::vector point; + point.push_back(0); + point.push_back(0); + point.push_back(0); + bbSetInputPoint(point); + + std::vector range; + range.push_back(0); + range.push_back(200); + bbSetInputRange(range); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ManualPaint_Model::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + manualpaintmodel=new ManualPaintModel(); + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ManualPaint_Model::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + delete manualpaintmodel; + +} + +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h new file mode 100644 index 0000000..ed8279a --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h @@ -0,0 +1,79 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaMaracasVisuManualPaint_Model_h_INCLUDED__ +#define __bbcreaMaracasVisuManualPaint_Model_h_INCLUDED__ +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbcreaMaracasVisu +{ + +class bbcreaMaracasVisu_EXPORT ManualPaint_Model + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ManualPaint_Model,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Active,bool); + BBTK_DECLARE_INPUT(Tool,int); + BBTK_DECLARE_INPUT(2D3D,int); + BBTK_DECLARE_INPUT(Image,vtkImageData*); + BBTK_DECLARE_INPUT(GrayLevel,double); + BBTK_DECLARE_INPUT(Direction,int); + BBTK_DECLARE_INPUT(BrushSize,int); + BBTK_DECLARE_INPUT(BrushForm,int); + BBTK_DECLARE_INPUT(ToleranceFill,double); + BBTK_DECLARE_INPUT(DistanceFill,int); + BBTK_DECLARE_INPUT(Point,std::vector); + BBTK_DECLARE_INPUT(Range,std::vector); + + +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); + + + ManualPaintModel *manualpaintmodel; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualPaint_Model,bbtk::AtomicBlackBox); + BBTK_NAME("ManualPaint_Model"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ManualPaint_Model,Active,"true (default) , false",bool,""); + BBTK_INPUT(ManualPaint_Model,Tool,"0=Brush, 1=Paint(default)",int,""); + BBTK_INPUT(ManualPaint_Model,2D3D,"0=2D, 1=3D (default)",int,""); + BBTK_INPUT(ManualPaint_Model,Image,"Image input",vtkImageData*,""); + BBTK_INPUT(ManualPaint_Model,GrayLevel,"Fill gray level (100 default)",double,""); + BBTK_INPUT(ManualPaint_Model,Direction,"Used in the 2D mode. 0=YZ , 1=XY , 2=XY(default) ",int,""); + BBTK_INPUT(ManualPaint_Model,BrushSize,"default 3",int,""); + BBTK_INPUT(ManualPaint_Model,BrushForm,"1 default A) 2D 0=rect,1=circle B) 3D 0=cube,1=sphere",int,""); + BBTK_INPUT(ManualPaint_Model,ToleranceFill,"default 50",double,""); + BBTK_INPUT(ManualPaint_Model,DistanceFill,"25 (default)",int,""); + BBTK_INPUT(ManualPaint_Model,Point,"[0,0,0] (default)",std::vector,""); + BBTK_INPUT(ManualPaint_Model,Range,"min-max range [0 200] default",std::vector,""); + + +// BBTK_OUTPUT(ManualPaint_Model,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ManualPaint_Model); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaMaracasVisu + +#endif // __bbcreaMaracasVisuManualPaint_Model_h_INCLUDED__ + diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx index d829ab0..7d6765e 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx @@ -34,12 +34,8 @@ BBTK_BLACK_BOX_IMPLEMENTATION(TransferFunctionView,bbtk::WxBlackBox); //----------------------------------------------------- void TransferFunctionView::Process() { - - - - - - if(bbGetInputIn()!=NULL){ + if(bbGetInputIn()!=NULL) + { if(_currentimg != bbGetInputIn()){ _currentimg = bbGetInputIn(); @@ -48,24 +44,20 @@ void TransferFunctionView::Process() //mwxwidget->Refresh(); } - onColorChange(); - - /*bbSetOutputGreyLevel(greylevel); +// onColorChange(); + /* + bbSetOutputGreyLevel(greylevel); bbSetOutputValue(value); bbSetOutputGreyLevelColors(greylevelcolors); bbSetOutputRed(red); bbSetOutputGreen(green); - bbSetOutputBlue(blue);*/ - - - - - } - - + bbSetOutputBlue(blue); + */ + } // if In } -void TransferFunctionView::onColorChange(){ +void TransferFunctionView::onColorChange() +{ std::vector greylevel; std::vector value; @@ -80,7 +72,8 @@ void TransferFunctionView::onColorChange(){ _tfun->RemoveAllPoints(); - for(int i = 0; i < greylevel.size();i++){ + unsigned int i; + for(i = 0; i < greylevel.size();i++){ _tfun->AddPoint(greylevel[i], value[i]); std::cout<<"TransferFunctionView::Process()transfer function "<AddRGBPoint(greylevelcolors[i], red[i],green[i], blue[i]); for(i = 0; i < greylevelcolors.size();i++) @@ -112,11 +105,14 @@ void TransferFunctionView::onColorChange(){ _ctfun->AddRGBPoint( greylevelcolors[i] , red[i],green[i], blue[i]); } - bbSignalOutputModification(); _tfun->Update(); bbSetOutputOpacityFunction(_tfun); - bbSetOutputColorFunction(_ctfun); + bbSetOutputColorFunction(_ctfun ); + bbSetOutputActive( mwxwidget->GetActive() ); + + bbSignalOutputModification(); + } void TransferFunctionView::onSliderChange() @@ -127,44 +123,47 @@ void TransferFunctionView::onSliderChange() bbSignalOutputModification(); +printf("EED TransferFunctionView::onSliderChange --------------------- \n"); // bbSetOutputWindowLevel(mwxwidget->GetWindowLevel()); // bbSetOutputColorLevel(mwxwidget->GetColorLevel()); } +/* //----------------------------------------------------- -void TransferFunctionView::CreateWidget(wxWindow* parent) +void TransferFunctionView::onActive() { - bbtkDebugMessageInc("Core",9,"TransferFunctionView::CreateWxWindow()"<Connect(mwxwidget->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction) (&HandlerTransferFunctionView::onActive),NULL,handler); parent->Connect(mwxwidget->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction) (&HandlerTransferFunctionView::onColorChange),NULL,handler); parent->Connect(mwxwidget->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) (&HandlerTransferFunctionView::onSliderChange),NULL,handler); - - bbtkDebugDecTab("Core",9); bbSetOutputWidget( mwxwidget ); + bbtkDebugDecTab("Core",9); } //----------------------------------------------------- void TransferFunctionView::bbUserSetDefaultValues() { - mwxwidget = NULL; + mwxwidget = NULL; _currentimg = NULL; - - _tfun = NULL; - _ctfun = NULL; - + _tfun = NULL; + _ctfun = NULL; bbSetOutputOpacityFunction(0); bbSetOutputColorFunction(0); - } - //----------------------------------------------------------------- void TransferFunctionView::bbUserInitializeProcessing() @@ -180,10 +179,7 @@ void TransferFunctionView::bbUserSetDefaultValues() { } - //----------------------------------------------------------------- - - HandlerTransferFunctionView::HandlerTransferFunctionView(TransferFunctionView* box) { _box = box; @@ -203,8 +199,14 @@ void TransferFunctionView::bbUserSetDefaultValues() _box->onSliderChange(); } -} +/* + void HandlerTransferFunctionView::onActive(wxCommandEvent& event) + { + _box->onActive(); + } +*/ +} // EO namespace bbcreaMaracasVisu diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.h b/bbtk/src/bbmaracasvisuTransferFunctionView.h index 08e386a..6658585 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.h +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.h @@ -50,8 +50,9 @@ class /*BBTK_EXPORT*/ TransferFunctionView BBTK_DECLARE_OUTPUT(OpacityFunction, vtkPiecewiseFunction*); BBTK_DECLARE_OUTPUT(ColorFunction, vtkColorTransferFunction*); - BBTK_DECLARE_OUTPUT(WindowLevel, double); - BBTK_DECLARE_OUTPUT(ColorLevel, double); + BBTK_DECLARE_OUTPUT(Active , bool ); + BBTK_DECLARE_OUTPUT(WindowLevel , double ); + BBTK_DECLARE_OUTPUT(ColorLevel , double ); /*BBTK_DECLARE_OUTPUT(GreyLevel, std::vector ); BBTK_DECLARE_OUTPUT(Value, std::vector ); BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector); @@ -63,9 +64,8 @@ class /*BBTK_EXPORT*/ TransferFunctionView void Process(); BBTK_CREATE_WIDGET(CreateWidget); void CreateWidget(wxWindow* parent); - +// void onActive(); void onColorChange(); - void onSliderChange(); private: @@ -77,30 +77,31 @@ class /*BBTK_EXPORT*/ TransferFunctionView vtkColorTransferFunction* _ctfun; }; + class HandlerTransferFunctionView : public wxEvtHandler { public: HandlerTransferFunctionView(TransferFunctionView* box); - ~HandlerTransferFunctionView(); - + ~HandlerTransferFunctionView(); +// void onActive(wxCommandEvent& event); void onColorChange(wxCommandEvent& event); - void onSliderChange(wxCommandEvent& event); - private: TransferFunctionView *_box; }; + BBTK_BEGIN_DESCRIBE_BLACK_BOX(TransferFunctionView,bbtk::WxBlackBox); BBTK_NAME("TransferFunctionView"); BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Transfer Function Window"); //BBTK_CATEGORY("__CategoryBlackBox__"); - BBTK_INPUT(TransferFunctionView,In,"Input image",vtkImageData*,""); + BBTK_INPUT(TransferFunctionView,In,"Input image",vtkImageData*,""); BBTK_OUTPUT(TransferFunctionView,OpacityFunction,"Transfer function for the opacity", vtkPiecewiseFunction*,""); BBTK_OUTPUT(TransferFunctionView,ColorFunction,"Transfer function for the color", vtkColorTransferFunction*,""); BBTK_OUTPUT(TransferFunctionView,WindowLevel,"WidowLevel for the current window", double,""); BBTK_OUTPUT(TransferFunctionView,ColorLevel,"ColorLevel for the current window", double,""); + BBTK_OUTPUT(TransferFunctionView,Active,"Active", bool,""); /*BBTK_OUTPUT(TransferFunctionView,GreyLevel,"Greylevel related to the transparency",std::vector,""); BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector,""); BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector,""); diff --git a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session index 59ad998..192959b 100644 --- a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session +++ b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session @@ -1,11 +1,5 @@ -window_sizes 1396 856 303 1087 755 46 -diagrams - active classdiagram_ref 128002 // wxVtkViewer class Diagram 1 - 952 1238 140 4 271 110 -end +window_sizes 674 632 393 275 368 176 show_stereotypes -selected classdiagram_ref 128002 // wxVtkViewer class Diagram 1 -open - classview_ref 128002 // wxVtkViewer -end +selected +package_ref 129 // wxVtkViewer end diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx index 665e7a2..3c0f1d5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx @@ -74,22 +74,23 @@ namespace creaMaracasVisuKernel{ std::cout<Enable(false); _sl_SliceImageY->Enable(false); _sl_SliceImageZ->Enable(false); - _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image Interpolation") ); + _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpole") ); _interpolationCheckBox->SetValue(true); _opacity = new wxSlider(this, wxID_ANY, 6, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); @@ -179,10 +180,16 @@ printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel Start\n"); if (type==2) { + sizer = new wxFlexGridSizer(2); + _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpolate") ); + _interpolationCheckBox->SetValue(true); _opacity = new wxSlider(this, wxID_ANY, 6, 0, 10, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); + + Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation ); Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity ); // sizer -> Add( new wxStaticText(this,-1,_T("Opacity Level")) , 1, wxEXPAND ); - sizer -> Add( _opacity ,1,wxGROW ); + sizer -> Add( _opacity , 1, wxGROW ); + sizer -> Add( _interpolationCheckBox , 1, wxGROW ); sizer->AddGrowableCol(0); } // type==2 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index 925dc8f..d89c05e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -362,10 +362,11 @@ void LayerImageBase::onThreshold() _imageReslicer->SetResliceAxesOrigin(0,0,z); } - _imageReslicer->SetOutputDimensionality(2); // _imageReslicer->SetInterpolationModeToLinear(); _imageReslicer->SetInterpolationModeToNearestNeighbor(); + _imageReslicer->Modified(); + vtkImageData *img = _imageReslicer->GetOutput(); // img->Update(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h index f9989b0..6de2f5d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h @@ -63,7 +63,7 @@ public: virtual bool OnRightButtonUp(); private: - bool _state; + bool _state; bool _stateKey; LayerImageBase* _layerImageBase; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp index 964e0e6..ce9bf01 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp @@ -27,7 +27,7 @@ BrushFilter::BrushFilter() { _brushsize = 1; - _brushform = 0; // 0 rectangle-box , 1 circle-sphere + _brushform = 0; // 0 rectangle-cube , 1 circle-sphere _brushtool = 0; // 0 pencil , 1 fill } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp index ac69465..f0de5e2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp @@ -69,89 +69,113 @@ printf("EED ManualPaintModel::PaintImage\n"); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetTool(int tool) { +void ManualPaintModel::SetTool(int tool) +{ _tool = tool; } //--------------------------------------------------------------------------- -void ManualPaintModel::Set2D3D(int dim2D3D) { +void ManualPaintModel::Set2D3D(int dim2D3D) +{ _brushfilter->Set2D3D(dim2D3D); _fillfilter->Set2D3D(dim2D3D); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetImage(vtkImageData *image) { - _brushfilter->SetImage(image); - _fillfilter->SetImage(image); - _imageUndoRedo->SetImage(image); +void ManualPaintModel::SetImage(vtkImageData *image) +{ + if (image!=NULL) + { + _brushfilter->SetImage(image); + _fillfilter->SetImage(image); + _imageUndoRedo->SetImage(image); + } else { + printf("EED Warning image=NULL in ManualPaintModel::SetImage(image)\n "); + } } //--------------------------------------------------------------------------- -void ManualPaintModel::SetGrayLevel(double graylevel) { +void ManualPaintModel::SetGrayLevel(double graylevel) +{ _brushfilter->SetGrayLevel(graylevel); _fillfilter->SetGrayLevel(graylevel); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetRangeMin(int min) { +void ManualPaintModel::SetRangeMin(int min) +{ _brushfilter->SetRangeMin(min); _fillfilter->SetRangeMin(min); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetRangeMax(int max) { +void ManualPaintModel::SetRangeMax(int max) +{ _brushfilter->SetRangeMax(max); _fillfilter->SetRangeMax(max); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetDirection(int direction) { +void ManualPaintModel::SetDirection(int direction) +{ _brushfilter->SetDirection(direction); _fillfilter->SetDirection(direction); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetBrushSize(int brushsize) { +void ManualPaintModel::SetBrushSize(int brushsize) +{ _brushfilter->SetBrushSize(brushsize); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetBrushForm(int brushform) { +void ManualPaintModel::SetBrushForm(int brushform) +{ _brushfilter->SetBrushForm(brushform); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetToleranceFill(double tolerancefill) { +void ManualPaintModel::SetToleranceFill(double tolerancefill) +{ _fillfilter->SetToleranceFill(tolerancefill); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetDistanceFill(int distancefill) { +void ManualPaintModel::SetDistanceFill(int distancefill) +{ _fillfilter->SetDistanceFill(distancefill); } + //--------------------------------------------------------------------------- -void ManualPaintModel::GetScalarRange(double * range) { +void ManualPaintModel::GetScalarRange(double * range) +{ _fillfilter->GetScalarRange(range); } + //--------------------------------------------------------------------------- -void ManualPaintModel::SetUndoImage() { +void ManualPaintModel::SetUndoImage() +{ ImageMManager* imMManager = NULL; - if (_tool == 0) { - imMManager = this->_brushfilter->GetImageMManager(); - } - if (_tool == 1) { - imMManager = this->_fillfilter->GetImageMManager(); - } - this->_imageUndoRedo->SetURImages(imMManager); - this->_brushfilter->CleanImageMManager(); - this->_fillfilter->CleanImageMManager(); + if (_tool == 0) + { + imMManager = this->_brushfilter->GetImageMManager(); + } // if 0 + if (_tool == 1) + { + imMManager = this->_fillfilter->GetImageMManager(); + } // if 1 + this->_imageUndoRedo->SetURImages(imMManager); + this->_brushfilter->CleanImageMManager(); + this->_fillfilter->CleanImageMManager(); } //--------------------------------------------------------------------------- -void ManualPaintModel::Undo() { +void ManualPaintModel::Undo() +{ this->_imageUndoRedo->Undo(); } -void ManualPaintModel::Redo() { +void ManualPaintModel::Redo() +{ this->_imageUndoRedo->Redo(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx index e57059a..e987f8c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx @@ -36,25 +36,21 @@ HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent) : wxPanel(parent) { - _img = NULL; + _img = NULL; _bitmapcombo = NULL; _slidercolor = NULL; _sliderwindowlevel = NULL; + _ckboxActive = NULL; colorBar_Bitmap = NULL; _bitmapsizer = NULL; - InitCurrentPathColorsFuntion(); this->SetSizer(getBitmapCombo()); - _img = NULL; + _img = NULL; _currentitem = -1; _maxgreyvalue = 0; - - } - - HistogramDialogComboBox::~HistogramDialogComboBox() { } @@ -74,35 +70,39 @@ wxSizer* HistogramDialogComboBox::getBitmapCombo() wxBoxSizer* comboeditsizer = new wxBoxSizer(wxHORIZONTAL); _bitmapcombo = getBitmapComboElements(); - BitmapComboItemSelect(0); - + BitmapComboItemSelect(0); wxBitmap bitmap1(Edit_xpm); wxBitmapButton* edit = new wxBitmapButton(this, -1, bitmap1,wxDefaultPosition,wxSize(30,30)); Connect(edit->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialogComboBox::OnEditBitmapCombo); - + _ckboxActive= new wxCheckBox( this, + -1, + _T(" "), + wxDefaultPosition, + //wxSize(sizeX,sizeY), + wxDefaultSize, + wxCHK_2STATE | wxALIGN_RIGHT); + _ckboxActive->SetValue(false); + + Connect( _ckboxActive->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) (void (wxPanel::*)(wxScrollEvent&)) &HistogramDialogComboBox::OnChkBoxActive); + + comboeditsizer->Add(_ckboxActive,wxSizerFlags().Center().FixedMinSize()); comboeditsizer->Add(_bitmapcombo,wxSizerFlags().Center().FixedMinSize()); comboeditsizer->Add(edit,wxSizerFlags().Center()); - _bitmapsizer->Add(comboeditsizer,wxSizerFlags().FixedMinSize().Center()); _bitmapsizer->AddSpacer(5); _bitmapsizer->Add(getSlidersWlCo(),wxSizerFlags().Expand().Center()); - return _bitmapsizer; } wxSizer* HistogramDialogComboBox::getSlidersWlCo() { - wxBoxSizer* sizersliders = new wxBoxSizer(wxVERTICAL); - - _slidercolor = new wxSlider(this, -1,1,0,1,wxDefaultPosition,wxDefaultSize,wxSL_LABELS); - _sliderwindowlevel = new wxSlider(this, -1,1,0,1,wxDefaultPosition,wxDefaultSize,wxSL_LABELS); - + wxBoxSizer* sizersliders = new wxBoxSizer(wxVERTICAL); + _slidercolor = new wxSlider(this, -1,1,0,1,wxDefaultPosition,wxDefaultSize,wxSL_LABELS); + _sliderwindowlevel = new wxSlider(this, -1,1,0,1,wxDefaultPosition,wxDefaultSize,wxSL_LABELS); sizersliders->Add(_slidercolor,wxSizerFlags().Expand().Center()); sizersliders->Add(_sliderwindowlevel,wxSizerFlags().Expand().Center()); - - Connect(_slidercolor->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnColorLevelChanged); + Connect(_slidercolor->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnColorLevelChanged); Connect(_sliderwindowlevel->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnWindowLevelChanged); - return sizersliders; } @@ -110,7 +110,9 @@ double HistogramDialogComboBox::GetWindowLevel() { double val(0.0); if(_sliderwindowlevel != NULL) + { val= _sliderwindowlevel->GetValue(); + } return val; // JPR } @@ -118,10 +120,31 @@ double HistogramDialogComboBox::GetColorLevel() { double val(0.0); if(_slidercolor != NULL) + { val = _slidercolor->GetValue(); + } return val; // JPR } + +bool HistogramDialogComboBox::GetActive() +{ + bool result = false; + if (_ckboxActive!=NULL) + { + result = _ckboxActive->GetValue(); + } + return result; +} + + +void HistogramDialogComboBox::OnChkBoxActive(wxCommandEvent& event) +{ + wxCommandEvent newevent(wxEVT_COMMAND_COMBOBOX_SELECTED,this->GetId()); + ProcessEvent(newevent); +} + + void HistogramDialogComboBox::OnColorLevelChanged(wxCommandEvent& event) { _slidercolor->GetValue(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h index 9fc89ac..0eb2cb3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h @@ -42,7 +42,9 @@ #include "HistogramDialogComboBoxItem.h" #include + #include +#include #include "vtkImageData.h" #define COLORSFUNCTIONFILENAME "colorsfunction.txt" @@ -71,6 +73,7 @@ public: void OnColorLevelChanged(wxCommandEvent& event); void OnWindowLevelChanged(wxCommandEvent& event); + void OnChkBoxActive(wxCommandEvent& event); void setImageData(vtkImageData* img); @@ -88,9 +91,10 @@ public: std::vector& green, std::vector& blue); - double GetWindowLevel(); - double GetColorLevel(); - void InitCurrentPathColorsFuntion(); + double GetWindowLevel(); + double GetColorLevel(); + bool GetActive(); + void InitCurrentPathColorsFuntion(); std::string GetFileNameOfColorsFunction(); private: @@ -111,12 +115,13 @@ private: * Represents the color of the backGround. Default color is the parent color. */ - wxBitmapComboBox* _bitmapcombo; - wxSlider* _slidercolor; - wxSlider* _sliderwindowlevel; - std::vector _bitmapsitems; - wxBitmap* colorBar_Bitmap; - wxSizer* _bitmapsizer; + wxBitmapComboBox *_bitmapcombo; + wxCheckBox *_ckboxActive; + wxSlider *_slidercolor; + wxSlider *_sliderwindowlevel; + std::vector _bitmapsitems; + wxBitmap *colorBar_Bitmap; + wxSizer *_bitmapsizer; wxSizer* getBitmapCombo(); wxSizer* getSlidersWlCo(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx index e34a19e..8566966 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx @@ -34,6 +34,7 @@ vtkBaseData::vtkBaseData() _z = 0; _t = 0; _marImageData = 0; + _interpolate = true; _observable = vtkObject::New(); } @@ -42,8 +43,6 @@ vtkBaseData::~vtkBaseData() { } - - //------------------------------------------------------------------- void vtkBaseData::SetMarImageData(marImageData *marimagedata) { @@ -62,6 +61,7 @@ vtkImageData* vtkBaseData::GetImageData() } } + //------------------------------------------------------------------- marImageData* vtkBaseData::GetMarImageData() { @@ -198,4 +198,15 @@ void vtkBaseData::AddObserver(int eventNumber, vtkCommand *observer) //Configure(); } +//------------------------------------------------------------------- +bool vtkBaseData::GetInterpolate() +{ + return _interpolate; +} + +//------------------------------------------------------------------- +void vtkBaseData::SetInterpolate(bool value) +{ + _interpolate = value; +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h index 7d72298..09e36bd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h @@ -35,34 +35,35 @@ class creaMaracasVisu_EXPORT vtkBaseData { public: vtkBaseData(); - virtual ~vtkBaseData(); + virtual ~vtkBaseData(); vtkImageData* GetImageData(); marImageData* GetMarImageData(); - void SetMarImageData(marImageData *marimagedata); + void SetMarImageData(marImageData *marimagedata); virtual void Configure(); double GetZ(); - void SetZ(double z); + void SetZ(double z); int GetT(); - void SetT(double t); + void SetT(double t); - void SetColorWindow(double colorWindow); - void SetColorLevel(double colorLevel); + void SetColorWindow(double colorWindow); + void SetColorLevel(double colorLevel); double GetColorWindow(); double GetColorLevel(); - void AddObserver(int eventNumber, vtkCommand *observer); + void AddObserver(int eventNumber, vtkCommand *observer); + bool GetInterpolate(); + void SetInterpolate(bool value); protected: marImageData *_marImageData; double _z; int _t; - double _colorWindow; double _colorLevel; - + bool _interpolate; vtkObject* _observable; - private: + }; #endif /*VTKBASEDATA_H_*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h index 33a3e74..1461beb 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h @@ -59,7 +59,7 @@ public: // vtkImageActor* GetImageActor(int id); vtkActor* GetOutlineActor(); vtkClipPolyData* GetTissueClipper(int id); - vtkPolyDataMapper* GetTissueMapper(int id); + vtkPolyDataMapper* GetTissueMapper(int id); vtkPlanes* GetTissuePlanes(int id); vtkStripper* GetTissueStripper(int id); // vtkGlyph3D* GetGlyph(int id); @@ -68,56 +68,56 @@ public: vtkMarchingCubes *GetMCubes(int idTissue); virtual void Refresh(); - void RefreshSurface(); + void RefreshSurface(); virtual void Configure(); - void Configure_Tissue(); - void Configure_Volume(); + void Configure_Tissue(); + void Configure_Volume(); - void SetIsovalue(int idTissue, int isoValue); + void SetIsovalue(int idTissue, int isoValue); double GetIsovalue(int idTissue); vtkVolume *GetVolumeActor(); vtkVolumeRayCastMapper *GetVolumeMapper(); vtkPlanes *GetVolumePlanes(); - void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata); - vtkMPRBaseData* GetVtkMPRBaseData(); + void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata); + vtkMPRBaseData* GetVtkMPRBaseData(); - vtkActor *GetTissueActor(int id); - void SetVisibleTissue(int idTissue, bool visible); - bool GetVisibleTissue(int idTissue); - bool GetVisibleVolume(); - void SetVisibleVolume(bool visibleVolume); + vtkActor *GetTissueActor(int id); + void SetVisibleTissue(int idTissue, bool visible); + bool GetVisibleTissue(int idTissue); + bool GetVisibleVolume(); + void SetVisibleVolume(bool visibleVolume); - bool GetVisibleVolumeBox(); - void SetVisibleVolumeBox(bool visibleBox); + bool GetVisibleVolumeBox(); + void SetVisibleVolumeBox(bool visibleBox); - void SetRepresentationType(int idTissue, bool representationType); - bool GetRepresentationType(int idTissue); + void SetRepresentationType(int idTissue, bool representationType); + bool GetRepresentationType(int idTissue); - boxSurfaceObserver *GetObserverS(int idObserverS); - boxSurfaceObserver *GetObserverV(); + boxSurfaceObserver *GetObserverS(int idObserverS); + boxSurfaceObserver *GetObserverV(); //void ReadVolumeFunctions(char *namefile); - void ReadVolumeFunctions(); - void ReadMeshVTK(char *namefile); + void ReadVolumeFunctions(); + void ReadMeshVTK(char *namefile); - void Configure_VolumeBox(); - void SetInteractor(vtkRenderWindowInteractor* interactor); - void SetRenderer(vtkRenderer* renderer); + void Configure_VolumeBox(); + void SetInteractor(vtkRenderWindowInteractor* interactor); + void SetRenderer(vtkRenderer* renderer); //------------------- //Getters Vectors //------------------- - std::vector* GetGreyValuesTransferenceFVector(); - std::vector* GetIntensityValuesTransferenceFVector(); - std::vector* GetRedColorsOfColorTransferenceFVector(); - std::vector* GetGreenColorsOfColorTransferenceFVector(); - std::vector* GetBlueColorsOfColorTransferenceFVector(); - std::vector* GetGreyValueColorsOfColorTransferenceFVector(); + std::vector* GetGreyValuesTransferenceFVector(); + std::vector* GetIntensityValuesTransferenceFVector(); + std::vector* GetRedColorsOfColorTransferenceFVector(); + std::vector* GetGreenColorsOfColorTransferenceFVector(); + std::vector* GetBlueColorsOfColorTransferenceFVector(); + std::vector* GetGreyValueColorsOfColorTransferenceFVector(); void setColorTransferFunction(vtkColorTransferFunction* colortable); @@ -125,46 +125,45 @@ public: //Getters transference function //and color of the transference function //--------------------------------------- - vtkPiecewiseFunction *GetTransferencefunction(); + vtkPiecewiseFunction *GetTransferencefunction(); vtkColorTransferFunction *GetColorTransferenceFunction(); - void SetRayCasting(bool active); - void SetMIPActive(bool active); - void SetInterpolation(bool active); - void SetShade(bool active); - void updateVolume(); - void BoxActorChanged(bool changed); - void UpdateVolumeBox(vector gf, vector vf, vtkColorTransferFunction* ctfun); + void SetRayCasting(bool active); + void SetMIPActive(bool active); + void SetInterpolation(bool active); + void SetShade(bool active); + void updateVolume(); + void BoxActorChanged(bool changed); + void UpdateVolumeBox(vector gf, vector vf, vtkColorTransferFunction* ctfun); private: - - vtkMarchingCubes *_mCubes[ VTKMPRDATA_MAXTISSUE ]; - vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ]; - vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ]; - vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ]; - vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ]; + vtkMarchingCubes *_mCubes[ VTKMPRDATA_MAXTISSUE ]; + vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ]; + vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ]; + vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ]; + vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ]; // outline - vtkOutlineFilter *_outlineData; - vtkPolyDataMapper *_mapOutline; - vtkActor *_outline; + vtkOutlineFilter *_outlineData; + vtkPolyDataMapper *_mapOutline; + vtkActor *_outline; /// Volume - vtkPiecewiseFunction *_tfun; + vtkPiecewiseFunction *_tfun; vtkColorTransferFunction *_ctfun; // vtkVolumeRayCastCompositeFunction *_compositeFunction; - vtkPlanes *_volumePlanes; + vtkPlanes *_volumePlanes; vtkVolumeRayCastMapper *_volumeMapper; - vtkVolumeProperty *_volumeProperty; - vtkVolume *_newvol; - vtkMPRBaseData *_vtkmprbasedata; - bool _visibleVolume; - bool _visibleVolumeBox; - bool _representationType[VTKMPRDATA_MAXTISSUE]; - bool _visibleTissue[VTKMPRDATA_MAXTISSUE]; - vtkActor *_tissue[VTKMPRDATA_MAXTISSUE]; + vtkVolumeProperty *_volumeProperty; + vtkVolume *_newvol; + vtkMPRBaseData *_vtkmprbasedata; + bool _visibleVolume; + bool _visibleVolumeBox; + bool _representationType[VTKMPRDATA_MAXTISSUE]; + bool _visibleTissue[VTKMPRDATA_MAXTISSUE]; + vtkActor *_tissue[VTKMPRDATA_MAXTISSUE]; boxSurfaceObserver *_observerV; boxSurfaceObserver *_observerS[VTKMPRDATA_MAXTISSUE]; @@ -179,7 +178,7 @@ private: vtkVolumeRayCastMIPFunction *_compositeFunctionMIP ; bool _isRayCasting; - bool _isMIP; + bool _isMIP; bool _interpolation; bool _shade; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx index d1806fe..ff72cc5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx @@ -32,19 +32,19 @@ vtkMPR3DDataViewer::vtkMPR3DDataViewer() _visiblePosition[0]=false; _visiblePosition[1]=false; _visiblePosition[2]=false; - _ctfun = NULL; - _vtkmprbasedata=NULL; - - _ctfun=NULL; - _saggitalColors=NULL; - _saggital=NULL; - _axialColors=NULL; - _axial=NULL; - _coronalColors=NULL; - _coronal=NULL; - _mapOutline=NULL; - _outline=NULL; - _outlineData=NULL; + _ctfun = NULL; + _vtkmprbasedata = NULL; + + _ctfun = NULL; + _saggitalColors = NULL; + _saggital = NULL; + _axialColors = NULL; + _axial = NULL; + _coronalColors = NULL; + _coronal = NULL; + _mapOutline = NULL; + _outline = NULL; + _outlineData = NULL; } //------------------------------------------------------------------- vtkMPR3DDataViewer::~vtkMPR3DDataViewer() @@ -53,16 +53,16 @@ vtkMPR3DDataViewer::~vtkMPR3DDataViewer() if(_mapOutline) {_mapOutline-> Delete();} if(_outline) {_outline-> Delete();} -// if (_bwLut) _bwLut->Delete(); -// if (_hueLut) _hueLut->Delete(); -// if (_satLut) _satLut->Delete(); - if (_ctfun) _ctfun->Delete(); +// if (_bwLut) _bwLut->Delete(); +// if (_hueLut) _hueLut->Delete(); +// if (_satLut) _satLut->Delete(); + if (_ctfun) _ctfun->Delete(); if (_saggitalColors) _saggitalColors ->Delete(); - if (_saggital) _saggital->Delete(); - if (_axialColors) _axialColors->Delete(); - if (_axial) _axial->Delete(); - if (_coronalColors) _coronalColors->Delete(); - if (_coronal) _coronal->Delete(); + if (_saggital) _saggital->Delete(); + if (_axialColors) _axialColors->Delete(); + if (_axial) _axial->Delete(); + if (_coronalColors) _coronalColors->Delete(); + if (_coronal) _coronal->Delete(); } //------------------------------------------------------------------- @@ -74,17 +74,21 @@ vtkActor* vtkMPR3DDataViewer::GetOutlineActor() vtkImageActor* vtkMPR3DDataViewer::GetImageActor(int id) { vtkImageActor *tmpVtkActor=NULL; - if (id==0){ + if (id==0) + { tmpVtkActor = GetvtkActor_saggital(); } - if (id==1){ + if (id==1) + { tmpVtkActor = GetvtkActor_coronal(); } - if (id==2){ + if (id==2) + { tmpVtkActor = GetvtkActor_axial(); } return tmpVtkActor; } + //------------------------------------------------------------------- void vtkMPR3DDataViewer::Refresh() { @@ -343,30 +347,40 @@ vtkImageActor * vtkMPR3DDataViewer::GetvtkActor_axial() } //------------------------------------------------------------------------ -void vtkMPR3DDataViewer::SetPositionX(int pos){ +void vtkMPR3DDataViewer::SetPositionX(int pos) +{ int x1,x2,y1,y2,z1,z2; _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); if(_saggital) { _saggital->SetDisplayExtent( pos , pos , y1 ,y2 , z1 , z2 ); +//EED 2016/02/19 + _saggital->SetInterpolate( GetVtkMPRBaseData()->GetInterpolate() ); } } + //------------------------------------------------------------------------ -void vtkMPR3DDataViewer::SetPositionY(int pos){ +void vtkMPR3DDataViewer::SetPositionY(int pos) +{ int x1,x2,y1,y2,z1,z2; _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); if(_coronal) { _coronal->SetDisplayExtent(x1,x2, pos,pos, z1,z2); +//EED 2016/02/19 + _coronal->SetInterpolate( GetVtkMPRBaseData()->GetInterpolate() ); } } //------------------------------------------------------------------------ -void vtkMPR3DDataViewer::SetPositionZ(int pos){ +void vtkMPR3DDataViewer::SetPositionZ(int pos) +{ int x1,x2,y1,y2,z1,z2; _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2); if(_axial) { _axial->SetDisplayExtent(x1,x2, y1,y2, pos,pos); +//EED 2016/02/19 + _axial->SetInterpolate( GetVtkMPRBaseData()->GetInterpolate() ); } } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h index ce96cc40..d968ff3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h @@ -45,57 +45,57 @@ class creaMaracasVisu_EXPORT vtkMPR3DDataViewer { public: vtkMPR3DDataViewer(); - virtual ~vtkMPR3DDataViewer(); - vtkImageActor* GetImageActor(int id); - vtkActor* GetOutlineActor(); - virtual void Refresh(); - virtual void Configure(); - void SetVisiblePosition(int idPosition, bool visible); - bool GetVisiblePosition(int idPosition); - vtkImageActor* GetvtkActor_saggital(); - vtkImageActor* GetvtkActor_axial(); - vtkImageActor* GetvtkActor_coronal(); - void SetPositionX(int pos); - void SetPositionY(int pos); - void SetPositionZ(int pos); - void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata); - vtkMPRBaseData* GetVtkMPRBaseData(); + virtual ~vtkMPR3DDataViewer(); + vtkImageActor* GetImageActor(int id); + vtkActor* GetOutlineActor(); + virtual void Refresh(); + virtual void Configure(); + void SetVisiblePosition(int idPosition, bool visible); + bool GetVisiblePosition(int idPosition); + vtkImageActor* GetvtkActor_saggital(); + vtkImageActor* GetvtkActor_axial(); + vtkImageActor* GetvtkActor_coronal(); + void SetPositionX(int pos); + void SetPositionY(int pos); + void SetPositionZ(int pos); + void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata); + vtkMPRBaseData* GetVtkMPRBaseData(); - vtkColorTransferFunction *GetvtkColorTransferFunction(); - std::vector *GetctFunVectorPoint(); - std::vector *GetctFunVectorRed(); - std::vector *GetctFunVectorGreen(); - std::vector *GetctFunVectorBlue(); + vtkColorTransferFunction *GetvtkColorTransferFunction(); + std::vector *GetctFunVectorPoint(); + std::vector *GetctFunVectorRed(); + std::vector *GetctFunVectorGreen(); + std::vector *GetctFunVectorBlue(); void setColorTransferFunction(vtkColorTransferFunction* colortable); private: - bool _visiblePosition[3]; + bool _visiblePosition[3]; // outline - vtkOutlineFilter *_outlineData; - vtkPolyDataMapper *_mapOutline; - vtkActor *_outline; + vtkOutlineFilter *_outlineData; + vtkPolyDataMapper *_mapOutline; + vtkActor *_outline; // - vtkColorTransferFunction *_ctfun; - std::vector _ctFunVectorPoint; - std::vector _ctFunVectorRed; - std::vector _ctFunVectorGreen; - std::vector _ctFunVectorBlue; + vtkColorTransferFunction *_ctfun; + std::vector _ctFunVectorPoint; + std::vector _ctFunVectorRed; + std::vector _ctFunVectorGreen; + std::vector _ctFunVectorBlue; -// vtkLookupTable *_bwLut; -// vtkLookupTable *_hueLut; -// vtkLookupTable *_satLut; +// vtkLookupTable *_bwLut; +// vtkLookupTable *_hueLut; +// vtkLookupTable *_satLut; - vtkImageMapToColors *_saggitalColors; - vtkImageActor *_saggital; - vtkImageMapToColors *_axialColors; - vtkImageActor *_axial; - vtkImageMapToColors *_coronalColors; - vtkImageActor *_coronal; - vtkMPRBaseData *_vtkmprbasedata; + vtkImageMapToColors *_saggitalColors; + vtkImageActor *_saggital; + vtkImageMapToColors *_axialColors; + vtkImageActor *_axial; + vtkImageMapToColors *_coronalColors; + vtkImageActor *_coronal; + vtkMPRBaseData *_vtkmprbasedata; }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index e9d096a..6e9a593 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -28,6 +28,7 @@ #include "vtkInfoTextImage.h" #include "vtkInteractorStyleBaseView2D.h" #include "vtkInfoTextImageInteractor.h" +#include "vtkImageActor.h" wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent) @@ -310,6 +311,11 @@ void wxVtk2DBaseView::Refresh() { int z = (int)(GetVtkBaseData()->GetZ()); _imageViewer2XYZ->SetZSlice( z ); + +//EED 2016/02/19 + vtkImageActor *imageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor(); + imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() ); + //EED 01nov2012 UpdateColorWindowLevel(); wxVtkBaseView::Refresh(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h index c4d275a..d1874f1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h @@ -42,22 +42,22 @@ class vtkInfoTextImageInteractor; class creaMaracasVisu_EXPORT wxVtk2DBaseView: public wxVtkBaseView{ public: wxVtk2DBaseView(wxWindow *parent); - virtual ~wxVtk2DBaseView(); - virtual void Configure(bool okimage=true); - vtkImageViewer2_XYZ* _imageViewer2XYZ; + virtual ~wxVtk2DBaseView(); + virtual void Configure(bool okimage=true); + vtkImageViewer2_XYZ* _imageViewer2XYZ; - virtual void Refresh(); - virtual void ResetView(); - virtual int GetActualSlice(); - virtual void SetActualSlice(int slice); + virtual void Refresh(); + virtual void ResetView(); + virtual int GetActualSlice(); + virtual void SetActualSlice(int slice); void SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview); - virtual vtkRenderer* GetRenderer(); - virtual vtkRenderWindow* GetRenWin(); - virtual void TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z); - virtual void TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z); - virtual void GetSpacing(double spc[3]); + virtual vtkRenderer* GetRenderer(); + virtual vtkRenderWindow* GetRenWin(); + virtual void TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z); + virtual void TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z); + virtual void GetSpacing(double spc[3]); void setColorTransferFunction(vtkColorTransferFunction* colortable); void SetColorWindow(double level); @@ -71,9 +71,9 @@ public: private: - vtkInfoTextImage *_vtkIinfoTextImage; + vtkInfoTextImage *_vtkIinfoTextImage; vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor; - vtkInteractorStyleBaseView2D * _style2D; + vtkInteractorStyleBaseView2D *_style2D; protected: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h index 07d9e46..79391aa 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h @@ -69,36 +69,36 @@ public: wxVtkBaseView( ); wxVtkBaseView( wxWindow *parent ); virtual ~wxVtkBaseView(); - wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor() throw (char*); - virtual void Configure(); - virtual void Refresh(); - virtual void RefreshView(); - virtual vtkRenderer* GetRenderer(); + wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor() throw (char*); + virtual void Configure(); + virtual void Refresh(); + virtual void RefreshView(); + virtual vtkRenderer* GetRenderer(); virtual vtkRenderWindow* GetRenWin(); - virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2); + virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2); //RaC 03-2010 Method used by TransFromCoordScreenToWorld - void TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2); + void TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2); /* JCP 04/05/09 void SetInteractorStyleBaseView( vtkInteractorStyleBaseView* interactorStyle); */ - void SetInteractorStyleBaseView( vtkInteractorStyleImage* interactorStyle); + void SetInteractorStyleBaseView( vtkInteractorStyleImage* interactorStyle); /* JCP 04/05/09 * vtkInteractorStyleBaseView* GetInteractorStyleBaseView(); */ vtkInteractorStyleImage* GetInteractorStyleBaseView(); - virtual void GetSpacing(double spc[3]); - virtual int GetDirection(); + virtual void GetSpacing(double spc[3]); + virtual int GetDirection(); - vtkBaseData* GetVtkBaseData(); - void SetVtkBaseData(vtkBaseData *vtkbasedata); + vtkBaseData* GetVtkBaseData(); + void SetVtkBaseData(vtkBaseData *vtkbasedata); private: - wxWindow *_parent; + wxWindow *_parent; wxVTKRenderWindowInteractor *_iren; /** * JCP 04/05/09 @@ -107,7 +107,7 @@ private: vtkInteractorStyleImage *_interactorStyle; // EED Nov 15 2014 - vtkBaseData *_vtkbasedata; + vtkBaseData *_vtkbasedata; protected: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index b6e50ca..5fbab3e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -28,6 +28,8 @@ #include "vtkInteractorStyleBaseView.h" #include "vtkCellArray.h" +#include "vtkImageActor.h" + #ifdef WIN32 #include using namespace gtm; @@ -350,6 +352,11 @@ void wxVtkMPR2DView::Refresh() _backZ=zz; } + +//EED 2016/02/19 + vtkImageActor *imageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor(); + imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() ); + //EED 01nov2012 UpdateColorWindowLevel(); wxVtkBaseView::Refresh(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index 8776906..378dade 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -475,7 +475,7 @@ void wxVtkMPR3DView::setColorTransferFunction(vtkColorTransferFunction* colortab //------------------------------------------------------------------- void wxVtkMPR3DView::Refresh() // virtual { - _vtkmpr3Ddataviewer -> Refresh(); + _vtkmpr3Ddataviewer->Refresh(); if (_wxvtkmpr3DviewCntrlPanel!=NULL) { _wxvtkmpr3DviewCntrlPanel->Refresh(); @@ -514,18 +514,27 @@ void wxVtkMPR3DView::RefreshView() // virtual if ((normal[0]==1)&&(normal[1]==0)&&(normal[2]==0)) { _planeWidgetX->SetSlicePosition( x*spc[0] ); +//EED 2016/02/19 +// _planeWidgetX->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() ); + _planeWidgetX->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() ); } // FreePlaneY _planeWidgetY->GetNormal(normal); if ((normal[0]==0)&&(normal[1]==1)&&(normal[2]==0)) { _planeWidgetY->SetSlicePosition( y*spc[1] ); +//EED 2016/02/19 + _planeWidgetY->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() ); + _planeWidgetY->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() ); } // FreePlaneZ _planeWidgetZ->GetNormal(normal); if ((normal[0]==0)&&(normal[1]==0)&&(normal[2]==1)) { _planeWidgetZ->SetSlicePosition( z*spc[2] ); +//EED 2016/02/19 + _planeWidgetZ->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() ); + _planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() ); } x=x*spc[0]; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx index 47367ce..32624a5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx @@ -83,9 +83,10 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV _ckBoxXYZ->SetValue(false); ////EED 05Nov2012 _ckBox_BW_Color_Plane->SetValue(true); _ckBoxPlane->SetValue(false); - _ckBoxOutline= new wxCheckBox(panel,-1,_T("Outline")); _ckBoxOutline->SetValue(true); + _ckBoxInterpolate= new wxCheckBox(panel,-1,_T("Interpolate")); + _ckBoxInterpolate->SetValue(true); _ckBoxBackGroundBlack= new wxCheckBox(panel,-1,_T("Background Black"));; @@ -130,7 +131,8 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV Connect(_ckFreePlaneInteraction->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneInteraction ); Connect(_cbStereo->GetId() , wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnSetStereo ); Connect(_ckBoxOutline->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnOutline ); - Connect(_ckBoxBackGroundBlack->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnBackGroundBlack ); + Connect(_ckBoxBackGroundBlack->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnBackGroundBlack ); + Connect(_ckBoxInterpolate->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnInterpolate ); wxFlexGridSizer *sizer; @@ -145,7 +147,7 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV if(align) { - sizer = new wxFlexGridSizer(4); + sizer = new wxFlexGridSizer(4); sizerH4 = new wxFlexGridSizer(3); sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0); @@ -163,7 +165,11 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV sizerH4->Add( _positionZ ,1,wxGROW, 0 ); sizerH4->Add( _ckFreePlaneZ, 1, wxALL|wxEXPAND, 0); sizerH4->Add( _ckBoxZ ,0,wxALIGN_CENTER_VERTICAL|wxSHAPED, 0 ); - + +//EED 2016/02/19 + sizerH4->Add( _ckBoxInterpolate , 1, wxALL|wxEXPAND, 0); + sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0); + sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0); @@ -697,4 +703,16 @@ void wxVtkMPR3DViewCntrlPanel::OnBackGroundBlack(wxCommandEvent& event) } } +//------------------------------------------------------------------- +void wxVtkMPR3DViewCntrlPanel::OnInterpolate(wxCommandEvent& event) +{ + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetInterpolate( _ckBoxInterpolate->GetValue() ); + + _wxvtkmpr3Dview->Refresh(); + + wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh + _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); + +} + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h index 809c9dd..989dec2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h @@ -48,14 +48,16 @@ public: void OnEditColorTable(wxCommandEvent& event); ////EED 05Nov2012 void On_BW_Color_Plane(wxCommandEvent& event); - void OnVisibleFreePlaneX(wxCommandEvent& event); - void OnVisibleFreePlaneY(wxCommandEvent& event); - void OnVisibleFreePlaneZ(wxCommandEvent& event); - void OnVisibleFreePlaneInteraction(wxCommandEvent& event); - void OnSetStereo(wxCommandEvent& event); - void OnFreePlanesOrtho(wxCommandEvent& event); - void OnOutline(wxCommandEvent& event); - void OnBackGroundBlack(wxCommandEvent& event); + void OnVisibleFreePlaneX(wxCommandEvent& event); + void OnVisibleFreePlaneY(wxCommandEvent& event); + void OnVisibleFreePlaneZ(wxCommandEvent& event); + void OnVisibleFreePlaneInteraction(wxCommandEvent& event); + void OnSetStereo(wxCommandEvent& event); + void OnFreePlanesOrtho(wxCommandEvent& event); + void OnOutline(wxCommandEvent& event); + void OnBackGroundBlack(wxCommandEvent& event); + void OnInterpolate(wxCommandEvent& event); + virtual void Refresh(); void UpdateControlPanel(); @@ -109,7 +111,7 @@ private: wxCheckBox *_ckBoxOutline; wxCheckBox *_ckBoxBackGroundBlack; - + wxCheckBox *_ckBoxInterpolate; protected: