--- /dev/null
+# ----------------------------------
+# - 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
--- /dev/null
+# ----------------------------------
+# - 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
--- /dev/null
+//=====
+// 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
+
+
--- /dev/null
+//=====
+// 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__
+
//-----------------------------------------------------
void TransferFunctionView::Process()
{
-
-
-
-
-
- if(bbGetInputIn()!=NULL){
+ if(bbGetInputIn()!=NULL)
+ {
if(_currentimg != bbGetInputIn()){
_currentimg = bbGetInputIn();
//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;
_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;
}
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++)
_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()
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()
{
}
-
//-----------------------------------------------------------------
-
-
HandlerTransferFunctionView::HandlerTransferFunctionView(TransferFunctionView* box)
{
_box = box;
_box->onSliderChange();
}
-}
+/*
+ void HandlerTransferFunctionView::onActive(wxCommandEvent& event)
+ {
+ _box->onActive();
+ }
+*/
+}
// EO namespace bbcreaMaracasVisu
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>);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
void CreateWidget(wxWindow* parent);
-
+// void onActive();
void onColorChange();
-
void onSliderChange();
private:
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>,"");
-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
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
}
_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") );
_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);
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
_imageReslicer->SetResliceAxesOrigin(0,0,z);
}
-
_imageReslicer->SetOutputDimensionality(2);
// _imageReslicer->SetInterpolationModeToLinear();
_imageReslicer->SetInterpolationModeToNearestNeighbor();
+ _imageReslicer->Modified();
+
vtkImageData *img = _imageReslicer->GetOutput();
// img->Update();
virtual bool OnRightButtonUp();
private:
- bool _state;
+ bool _state;
bool _stateKey;
LayerImageBase* _layerImageBase;
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
}
}
//---------------------------------------------------------------------------
-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();
}
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()
{
}
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;
}
{
double val(0.0);
if(_sliderwindowlevel != NULL)
+ {
val= _sliderwindowlevel->GetValue();
+ }
return val; // JPR
}
{
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();
#include "HistogramDialogComboBoxItem.h"
#include <fstream>
+
#include <wx/bmpcbox.h>
+#include <wx/checkbox.h>
#include "vtkImageData.h"
#define COLORSFUNCTIONFILENAME "colorsfunction.txt"
void OnColorLevelChanged(wxCommandEvent& event);
void OnWindowLevelChanged(wxCommandEvent& event);
+ void OnChkBoxActive(wxCommandEvent& event);
void setImageData(vtkImageData* img);
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:
* 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();
_z = 0;
_t = 0;
_marImageData = 0;
+ _interpolate = true;
_observable = vtkObject::New();
}
{
}
-
-
//-------------------------------------------------------------------
void vtkBaseData::SetMarImageData(marImageData *marimagedata)
{
}
}
+
//-------------------------------------------------------------------
marImageData* vtkBaseData::GetMarImageData()
{
//Configure();
}
+//-------------------------------------------------------------------
+bool vtkBaseData::GetInterpolate()
+{
+ return _interpolate;
+}
+
+//-------------------------------------------------------------------
+void vtkBaseData::SetInterpolate(bool value)
+{
+ _interpolate = value;
+}
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_*/
// 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);
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);
//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];
vtkVolumeRayCastMIPFunction *_compositeFunctionMIP ;
bool _isRayCasting;
- bool _isMIP;
+ bool _isMIP;
bool _interpolation;
bool _shade;
_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()
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();
}
//-------------------------------------------------------------------
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()
{
}
//------------------------------------------------------------------------
-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() );
}
}
//-------------------------------------------------------------------
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;
};
#include "vtkInfoTextImage.h"
#include "vtkInteractorStyleBaseView2D.h"
#include "vtkInfoTextImageInteractor.h"
+#include "vtkImageActor.h"
wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent)
{
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();
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);
private:
- vtkInfoTextImage *_vtkIinfoTextImage;
+ vtkInfoTextImage *_vtkIinfoTextImage;
vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor;
- vtkInteractorStyleBaseView2D * _style2D;
+ vtkInteractorStyleBaseView2D *_style2D;
protected:
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
vtkInteractorStyleImage *_interactorStyle;
// EED Nov 15 2014
- vtkBaseData *_vtkbasedata;
+ vtkBaseData *_vtkbasedata;
protected:
#include "vtkInteractorStyleBaseView.h"
#include "vtkCellArray.h"
+#include "vtkImageActor.h"
+
#ifdef WIN32
#include <mathdefs.h>
using namespace gtm;
_backZ=zz;
}
+
+//EED 2016/02/19
+ vtkImageActor *imageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
+ imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
+
//EED 01nov2012
UpdateColorWindowLevel();
wxVtkBaseView::Refresh();
//-------------------------------------------------------------------
void wxVtkMPR3DView::Refresh() // virtual
{
- _vtkmpr3Ddataviewer -> Refresh();
+ _vtkmpr3Ddataviewer->Refresh();
if (_wxvtkmpr3DviewCntrlPanel!=NULL)
{
_wxvtkmpr3DviewCntrlPanel->Refresh();
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];
_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"));;
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;
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);
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);
}
}
+//-------------------------------------------------------------------
+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);
+
+}
+
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();
wxCheckBox *_ckBoxOutline;
wxCheckBox *_ckBoxBackGroundBlack;
-
+ wxCheckBox *_ckBoxInterpolate;
protected: