]> Creatis software - creaMaracasVisu.git/commitdiff
#2844 creaMaracasVisu Feature New Normal - ManualPaint_model box, Refresh TransferF...
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Sun, 21 Feb 2016 00:27:43 +0000 (01:27 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Sun, 21 Feb 2016 00:27:43 +0000 (01:27 +0100)
27 files changed:
bbtk/bbs/appli/exampleManualPaint_Model.bbg [new file with mode: 0644]
bbtk/bbs/appli/exampleManualPaint_Model.bbs [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuManualPaint_Model.h [new file with mode: 0644]
bbtk/src/bbmaracasvisuTransferFunctionView.cxx
bbtk/src/bbmaracasvisuTransferFunctionView.h
lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session
lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.h

diff --git a/bbtk/bbs/appli/exampleManualPaint_Model.bbg b/bbtk/bbs/appli/exampleManualPaint_Model.bbg
new file mode 100644 (file)
index 0000000..5e3ed2c
--- /dev/null
@@ -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:<VOID>
+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 (file)
index 0000000..1b249c4
--- /dev/null
@@ -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 "<VOID>"
+
+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 (file)
index 0000000..87c4312
--- /dev/null
@@ -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 = " <<bbGetOutputOut() << std::endl;
+
+       if (bbGetInputImage()!=NULL)
+       {  
+               manualpaintmodel->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<int> point;
+       point.push_back(0);
+       point.push_back(0);
+       point.push_back(0);
+       bbSetInputPoint(point);
+
+       std::vector<double> 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 (file)
index 0000000..ed8279a
--- /dev/null
@@ -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 <ManualPaintModel.h>
+
+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<int>);
+  BBTK_DECLARE_INPUT(Range,std::vector<double>);
+
+
+//  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<int>,"");
+  BBTK_INPUT(ManualPaint_Model,Range,"min-max range [0 200] default",std::vector<double>,"");
+
+
+//  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__
+
index d829ab0132116d39157955adbe22a68fee364fa6..7d6765e4344345f820d58e3d4c81b4c9c8b5c576 100644 (file)
@@ -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<double> greylevel;
        std::vector<double> 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 "<<greylevel[i]<<" "<< value[i]<<std::endl;
        }
@@ -98,7 +91,7 @@ void TransferFunctionView::onColorChange(){
                double dif = max-min;
                if (dif==0) dif=0.0001;
                double nc;
-               int i;
+               unsigned int i;
                i=0;
                _ctfun->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()"<<std::endl);
-       
-       mwxwidget = new HistogramDialogComboBox(parent);                                
+       bbSignalOutputModification();
 
+   printf("EED TransferFunctionView::onActive popopopopopopopop \n");
+}
+*/
 
+//-----------------------------------------------------
+void TransferFunctionView::CreateWidget(wxWindow* parent)
+{
+       bbtkDebugMessageInc("Core",9,"TransferFunctionView::CreateWxWindow()"<<std::endl);      
+       mwxwidget = new HistogramDialogComboBox(parent);                                
        HandlerTransferFunctionView* handler = new HandlerTransferFunctionView(this);
-
+//     parent->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
 
index 08e386a69509de2c4a21f7723f6e2ffa2b69c9a3..665858503caa9a13c20e2e2a039b702f19051fdf 100644 (file)
@@ -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<double> );
        BBTK_DECLARE_OUTPUT(Value, std::vector<double> );
        BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector<double>);
@@ -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<double>,"");
   BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector<double>,"");
   BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector<double>,"");
index 59ad99866e4359c34aac41f32bdd4ce0064a6c19..192959bd00b41457a8bb51083d33aaf687d3dbed 100644 (file)
@@ -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
index 665e7a23c560a73e33e0af66eaf45140b71a5f08..3c0f1d58393fd219a5c7aace864e2722fd9bc7fe 100644 (file)
@@ -74,22 +74,23 @@ namespace creaMaracasVisuKernel{
                                std::cout<<erreur<<"imagehandle "<<gimmickhandle<<std::endl;                
                        }else{
                                getImageDataDialog = (GETIMAGEDATADIALOG) dlsym (gimmickhandle, "getImageDataDialog");
-                               if(!getImageDataDialog){
-                               erreur = dlerror ();
-                               std::cout<<erreur<<"getImageDataDialog "<<getImageDataDialog<<std::endl;                        
+                               if(!getImageDataDialog)
+                               {
+                                       erreur = dlerror ();
+                                       std::cout<<erreur<<"getImageDataDialog "<<getImageDataDialog<<std::endl;                        
                                }else{
                                        img = (*getImageDataDialog)();
                                        gimmickfound = true;
                                        
-                               }
+                               } // if getImageDataDialog
                                /*dlclose returns 0 on success, non-zero on error*/
                                closingerror = dlclose(gimmickhandle);
                                if(closingerror!=0){
                                        std::cout<<closingerror<<"error closing handle  "<<gimmickhandle<<std::endl;  
                                }else{
                                        std::cout<<"handle released..."<<std::endl;  
-                               }
-                       }
+                               } // if closingerror
+                       } // if gimmickhandle
 
                #endif
                }
index ec4cd796ff6453cc9e7a65715108762e13696838..0d7cc29458bd18d695d9dc3de3cc895426173e94 100644 (file)
@@ -105,11 +105,12 @@ printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel Start\n");
        _histogram                              = NULL;
        _histogramMinMaxLevel   = NULL;
 
-       wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
+       wxFlexGridSizer * sizer         = NULL;
        _colorLayerImageViewManager     = new ColorLayerImageViewManager();
 
        if (type==1)
        {
+               sizer                                                   = new wxFlexGridSizer(1);
                _btn_ReadImage                                  = new wxButton(this, wxID_ANY, _T("Read Image") );
                _thresholdGo                                    = true;
                _cb_ShowHide                                    = new wxCheckBox(this, wxID_ANY, _T("Show/Hide Layer") );
@@ -125,7 +126,7 @@ printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel Start\n");
                _sl_SliceImageX->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
index 925dc8f84157ab708b9b93d0fb7de3255b327952..d89c05ed8da74f5e309c9d3ca49cba03a4b90c85 100644 (file)
@@ -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();
index f9989b0176ba4f8a258f797d898f7e08b45fa3cd..6de2f5d4a85e1e069e518e261a9d7885b353f7a1 100644 (file)
@@ -63,7 +63,7 @@ public:
        virtual bool OnRightButtonUp();
 
 private:
-    bool                                       _state;
+    bool                               _state;
     bool                               _stateKey;
     LayerImageBase*    _layerImageBase;
 
index 964e0e645b5554ca34141ed57293f63a4029a511..ce9bf014a21137341eb0afecd7bb51d6f0b24824 100644 (file)
@@ -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
 }
 
index ac69465260736205c291c5a5c9ad1b8fead13e72..f0de5e28650a9480226af3f9197c12b0582e0b0c 100644 (file)
@@ -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();
 }
index e57059a3fed44f08493276d8d7f8684a49800434..e987f8c1b495c424e8993225607d4f0ea6508527 100644 (file)
 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();
index 9fc89ac6600153985365952f9d7639396f3852bf..0eb2cb343f23bb24a76c5e5f779acd1564b68eda 100644 (file)
@@ -42,7 +42,9 @@
 
 #include "HistogramDialogComboBoxItem.h"
 #include <fstream>
+
 #include <wx/bmpcbox.h>
+#include <wx/checkbox.h>
 #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<double>& green,
                                                                        std::vector<double>& 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<HistogramDialogComboBoxItem*> _bitmapsitems;
-       wxBitmap* colorBar_Bitmap;
-       wxSizer* _bitmapsizer;
+       wxBitmapComboBox                                                        *_bitmapcombo;
+       wxCheckBox                                                                      *_ckboxActive;
+       wxSlider                                                                        *_slidercolor;
+       wxSlider                                                                        *_sliderwindowlevel;
+       std::vector<HistogramDialogComboBoxItem*>       _bitmapsitems;
+       wxBitmap                                                                        *colorBar_Bitmap;
+       wxSizer                                                                         *_bitmapsizer;
 
        wxSizer* getBitmapCombo();
        wxSizer* getSlidersWlCo();
index e34a19e94bde117e3ddf2e0676ef98eba66f79e8..8566966ce942924af8e121aaecdb4bf665fba60e 100644 (file)
@@ -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;
+}
 
index 7d72298b28a2a923ac07ae275d05d95c0884b6c9..09e36bd479dc5501ced2fb3f0697a03fbb99d046 100644 (file)
 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_*/
index 33a3e74cefb8c6ecc881c5b45e555cf40b736c1c..1461bebd4649e1e21839d6ab84bbb32224070f2a 100644 (file)
@@ -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<double>*                                    GetGreyValuesTransferenceFVector();
-       std::vector<double>*                                    GetIntensityValuesTransferenceFVector();
-       std::vector<double>*                                    GetRedColorsOfColorTransferenceFVector();
-       std::vector<double>*                                    GetGreenColorsOfColorTransferenceFVector();
-       std::vector<double>*                                    GetBlueColorsOfColorTransferenceFVector();
-       std::vector<double>*                                    GetGreyValueColorsOfColorTransferenceFVector();
+       std::vector<double>*    GetGreyValuesTransferenceFVector();
+       std::vector<double>*    GetIntensityValuesTransferenceFVector();
+       std::vector<double>*    GetRedColorsOfColorTransferenceFVector();
+       std::vector<double>*    GetGreenColorsOfColorTransferenceFVector();
+       std::vector<double>*    GetBlueColorsOfColorTransferenceFVector();
+       std::vector<double>*    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<double> gf, vector<double> 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<double> gf, vector<double> 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;
 
index d1806fe0c1fd7654e357d6c5d5c802a3058e0c7f..ff72cc520cea6d0aba29689ae9fc82244269c954 100644 (file)
@@ -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() );
        }
 }
 //-------------------------------------------------------------------
index ce96cc400586deb9a0cfa51ca60a8cea8d4d83b0..d968ff3b2f11f0d09a601f198a044c3dd80d1a3a 100644 (file)
 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<double >       *GetctFunVectorPoint();
-       std::vector<double >       *GetctFunVectorRed();
-       std::vector<double >       *GetctFunVectorGreen();
-       std::vector<double >       *GetctFunVectorBlue();
+       vtkColorTransferFunction        *GetvtkColorTransferFunction();
+       std::vector<double >            *GetctFunVectorPoint();
+       std::vector<double >            *GetctFunVectorRed();
+       std::vector<double >            *GetctFunVectorGreen();
+       std::vector<double >            *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<double>                             _ctFunVectorPoint;
-       std::vector<double>                             _ctFunVectorRed;
-       std::vector<double>                             _ctFunVectorGreen;
-       std::vector<double>                             _ctFunVectorBlue;
+       vtkColorTransferFunction        *_ctfun;
+       std::vector<double>                     _ctFunVectorPoint;
+       std::vector<double>                     _ctFunVectorRed;
+       std::vector<double>                     _ctFunVectorGreen;
+       std::vector<double>                     _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;
 
 
 };
index e9d096ab41ef4f380e103cddeea6d27284bf99ed..6e9a593ecf92b19d245dcbdbc1d104e42d31391d 100644 (file)
@@ -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();
index c4d275a70495cb3bac305ef3c8a53c5f1e3fe50b..d1874f17a1fef0ef412ab6549a3cc4e24418c447 100644 (file)
@@ -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:
 
index 07d9e462d6afc2817a7bbe11791d6719583f832a..79391aa6dc764f31119b84efdeb433f4d026f047 100644 (file)
@@ -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:
 
index b6e50ca0e95e42fc60d84e5a851cb28a1b325b41..5fbab3eedb7363684bccf1e2054e18cc5a9efda5 100644 (file)
@@ -28,6 +28,8 @@
 #include "vtkInteractorStyleBaseView.h"
 
 #include "vtkCellArray.h"
+#include "vtkImageActor.h"
+
 #ifdef WIN32
 #include <mathdefs.h>
 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();
index 8776906760f76410b6d6a8cff3b1f8af020fa988..378dadec80206f992eda9fbe9c3a01ebb9a64f70 100644 (file)
@@ -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];
index 47367ce30a939e03e524d35209012d508944409b..32624a50b213a59d12842f9a9c0cfa284aa79757 100644 (file)
@@ -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);
+
+}
+
 
index 809c9dd783a8620d9705404f1b7a4f5478dfccac..989dec22e3955f4ef17d1724e1146a5c93fff0c7 100644 (file)
@@ -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: