From 6a3077638c3045db3888c8c5641d141ff078c8dc Mon Sep 17 00:00:00 2001 From: Juan Prieto Date: Tue, 15 Sep 2009 11:25:04 +0000 Subject: [PATCH] *** empty log message *** --- .../src/bbmaracasvisuTransferFunctionView.cxx | 102 +++++++++++++----- bbtk/src/bbmaracasvisuTransferFunctionView.h | 30 +++++- bbtk/src/bbmaracasvisuViewerNV.cxx | 9 ++ bbtk/src/bbmaracasvisuViewerNV.h | 4 + .../pPlotter/HistogramDialogComboBox.cxx | 84 ++++++++++++++- .../pPlotter/HistogramDialogComboBox.h | 14 ++- .../widgets/wxMaracas_N_ViewersWidget.cxx | 33 +++++- .../widgets/wxMaracas_N_ViewersWidget.h | 7 +- .../widgets/wxMaracas_ViewerWidget.cxx | 36 ++++++- .../widgets/wxMaracas_ViewerWidget.h | 8 +- .../wxWindows/widgets/wxVtk2DBaseView.cxx | 12 +++ .../wxWindows/widgets/wxVtk2DBaseView.h | 4 + .../wxWindows/widgets/wxVtkMPR2DView.h | 1 + 13 files changed, 300 insertions(+), 44 deletions(-) diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx index 4fab7db..569e80f 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx @@ -10,13 +10,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(TransferFunctionView,bbtk::WxBlackBox); void TransferFunctionView::Process() { - std::vector greylevel; - std::vector value; - - std::vector greylevelcolors; - std::vector red; - std::vector green; - std::vector blue; + @@ -29,24 +23,8 @@ void TransferFunctionView::Process() //mwxwidget->Refresh(); } - mwxwidget->GetValuesPointsFunction(greylevel, value); - mwxwidget->GetValuesColorPointsFunction(greylevelcolors,red, green,blue); - - - _tfun->RemoveAllPoints(); - for(int i = 0; i < greylevel.size();i++){ - _tfun->AddPoint(greylevel[i], value[i]); - //std::cout<<"TransferFunctionView::Process()transfer function "<RemoveAllPoints(); - for(int i = 0; i < greylevelcolors.size();i++){ - _ctfun->AddRGBPoint(greylevelcolors[i], red[i],green[i], blue[i]); - //std::cout<<"TransferFunctionView::Process()transfer color function "< greylevel; + std::vector value; + + std::vector greylevelcolors; + std::vector red; + std::vector green; + std::vector blue; + + mwxwidget->GetValuesPointsFunction(greylevel, value); + mwxwidget->GetValuesColorPointsFunction(greylevelcolors,red, green,blue); + + + _tfun->RemoveAllPoints(); + for(int i = 0; i < greylevel.size();i++){ + _tfun->AddPoint(greylevel[i], value[i]); + //std::cout<<"TransferFunctionView::Process()transfer function "<RemoveAllPoints(); + for(int i = 0; i < greylevelcolors.size();i++){ + _ctfun->AddRGBPoint(greylevelcolors[i], red[i],green[i], blue[i]); + //std::cout<<"TransferFunctionView::Process()transfer color function "<GetWindowLevel()); + bbSetOutputColorLevel(mwxwidget->GetColorLevel()); + +} + //----------------------------------------------------- void TransferFunctionView::CreateWidget(wxWindow* parent) { bbtkDebugMessageInc("Core",9,"TransferFunctionView::CreateWxWindow()"<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 ); + bbSetOutputWidget( mwxwidget ); } //----------------------------------------------------- + void TransferFunctionView::bbUserSetDefaultValues() { mwxwidget = NULL; @@ -101,10 +128,27 @@ void TransferFunctionView::bbUserSetDefaultValues() void TransferFunctionView::bbUserFinalizeProcessing() { } - + + //----------------------------------------------------------------- + + + HandlerTransferFunctionView::HandlerTransferFunctionView(TransferFunctionView* box){ + _box = box; + } + HandlerTransferFunctionView::~HandlerTransferFunctionView(){ + + } + void HandlerTransferFunctionView::onColorChange(wxCommandEvent& event){ + _box->onColorChange(); + } + void HandlerTransferFunctionView::onSliderChange(wxCommandEvent& event){ + _box->onSliderChange(); + } } + + // EO namespace bbcreaMaracasVisu diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.h b/bbtk/src/bbmaracasvisuTransferFunctionView.h index ef3fd03..bcd1a09 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.h +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.h @@ -9,10 +9,13 @@ #include "vtkPiecewiseFunction.h" #include "vtkColorTransferFunction.h" +#include namespace bbcreaMaracasVisu { + + class /*BBTK_EXPORT*/ TransferFunctionView : public bbtk::WxBlackBox @@ -21,6 +24,9 @@ class /*BBTK_EXPORT*/ TransferFunctionView BBTK_DECLARE_INPUT(In, vtkImageData*); BBTK_DECLARE_OUTPUT(OpacityFunction, vtkPiecewiseFunction*); BBTK_DECLARE_OUTPUT(ColorFunction, vtkColorTransferFunction*); + + BBTK_DECLARE_OUTPUT(WindowLevel, double); + BBTK_DECLARE_OUTPUT(ColorLevel, double); /*BBTK_DECLARE_OUTPUT(GreyLevel, std::vector ); BBTK_DECLARE_OUTPUT(Value, std::vector ); BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector); @@ -31,7 +37,11 @@ class /*BBTK_EXPORT*/ TransferFunctionView BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); - void CreateWidget(wxWindow* parent); + void CreateWidget(wxWindow* parent); + + void onColorChange(); + + void onSliderChange(); private: //HistogramWidget *mwxwidget; @@ -42,6 +52,20 @@ class /*BBTK_EXPORT*/ TransferFunctionView vtkColorTransferFunction* _ctfun; }; +class HandlerTransferFunctionView : public wxEvtHandler +{ + public: + HandlerTransferFunctionView(TransferFunctionView* box); + ~HandlerTransferFunctionView(); + + 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"); @@ -50,6 +74,8 @@ BBTK_DESCRIPTION("Transfer Function Window"); 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,GreyLevel,"Greylevel related to the transparency",std::vector,""); BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector,""); BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector,""); @@ -58,6 +84,8 @@ BBTK_DESCRIPTION("Transfer Function Window"); BBTK_OUTPUT(TransferFunctionView,Blue,"Blue value according to the GreyLevelColors",std::vector,"");*/ BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionView); } + + // EO namespace bbcreaMaracasVisu #endif // __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__ diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index f5cf90c..ae2c0c9 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -110,6 +110,13 @@ void ViewerNV::Process() if(bbGetInputColorFunction()!=NULL){ mwxwidget->setColorTransferFunction(bbGetInputColorFunction()); } + + if(bbGetInputWindowLevel()!=-1){ + mwxwidget->setWindowLevel(bbGetInputWindowLevel()); + } + if(bbGetInputColorLevel()!=-1){ + mwxwidget->setColorLevel(bbGetInputColorLevel()); + } } } @@ -151,6 +158,8 @@ void ViewerNV::bbUserSetDefaultValues() bbSetOutputRenderer3( NULL ); bbSetOutputRenderer4( NULL ); bbSetInputColorFunction(NULL); + bbSetInputWindowLevel(-1); + bbSetInputColorLevel(-1); } //----------------------------------------------------------------- diff --git a/bbtk/src/bbmaracasvisuViewerNV.h b/bbtk/src/bbmaracasvisuViewerNV.h index eb6b39c..ec3aa26 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.h +++ b/bbtk/src/bbmaracasvisuViewerNV.h @@ -47,6 +47,8 @@ class /*BBTK_EXPORT*/ ViewerNV BBTK_DECLARE_INPUT(In, vtkImageData *); BBTK_DECLARE_INPUT(nTypeView, std::vector ); BBTK_DECLARE_INPUT(ColorFunction, vtkColorTransferFunction* ); + BBTK_DECLARE_INPUT(WindowLevel, int ); + BBTK_DECLARE_INPUT(ColorLevel, int ); BBTK_DECLARE_OUTPUT(wxVtkBaseView1,wxVtkBaseView*); BBTK_DECLARE_OUTPUT(wxVtkBaseView2,wxVtkBaseView*); BBTK_DECLARE_OUTPUT(wxVtkBaseView3,wxVtkBaseView*); @@ -82,6 +84,8 @@ BBTK_DESCRIPTION("Viewer : N view configuration 2D and 3D"); BBTK_INPUT(ViewerNV,In,"Input image",vtkImageData*,""); BBTK_INPUT(ViewerNV,nTypeView,"vector of viewer types (default 5 0 1 3 ): -1=Z_2DwithOutAxis 0=Z_2D 1=X_2D 2=Y_2D 3=Plane 4=Sphere 5=3D 6=3Dplane",std::vector,""); BBTK_INPUT(ViewerNV,ColorFunction,"Optional: set a different color for the viewers 2D",vtkColorTransferFunction*,""); + BBTK_INPUT(ViewerNV,WindowLevel,"Optional: set a different Window level by using an other widget",int,""); + BBTK_INPUT(ViewerNV,ColorLevel,"Optional: set a different Color level by using an other widget",int,""); BBTK_OUTPUT(ViewerNV,wxVtkBaseView1,"wxVtkBaseView 1",wxVtkBaseView *,""); BBTK_OUTPUT(ViewerNV,wxVtkBaseView2,"wxVtkBaseView 2",wxVtkBaseView *,""); BBTK_OUTPUT(ViewerNV,wxVtkBaseView3,"wxVtkBaseView 3",wxVtkBaseView *,""); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx index 6c8dcd3..3a997d5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx @@ -12,6 +12,13 @@ HistogramDialogComboBox::HistogramDialogComboBox(wxWindow* parent) : wxPanel(parent) { + _img = NULL; + _bitmapcombo=NULL; + _slidercolor=NULL; + _sliderwindowlevel=NULL; + colorBar_Bitmap=NULL; + _bitmapsizer=NULL; + this->SetSizer(getBitmapCombo()); _img = NULL; _currentitem = -1; @@ -33,7 +40,12 @@ void HistogramDialogComboBox::SetColors(std::vector greyvect, std::vecto wxSizer* HistogramDialogComboBox::getBitmapCombo(){ - _bitmapsizer = new wxBoxSizer(wxHORIZONTAL); + //_bitmapsizer = new wxBoxSizer(wxVERTICAL); + _bitmapsizer = new wxBoxSizer(wxVERTICAL); + + + + wxBoxSizer* comboeditsizer = new wxBoxSizer(wxHORIZONTAL); _bitmapcombo = getBitmapComboElements(); @@ -41,15 +53,76 @@ wxSizer* HistogramDialogComboBox::getBitmapCombo(){ wxBitmapButton* edit = new wxBitmapButton(this, -1, bitmap1,wxDefaultPosition,wxSize(30,30)); Connect(edit->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialogComboBox::OnEditBitmapCombo); - _bitmapsizer->Add(_bitmapcombo,wxSizerFlags().Center().FixedMinSize()); - _bitmapsizer->Add(edit,wxSizerFlags().Center()); + 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); + + sizersliders->Add(_slidercolor,wxSizerFlags().Expand().Center()); + sizersliders->Add(_sliderwindowlevel,wxSizerFlags().Expand().Center()); + + Connect(_slidercolor->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnColorLevelChanged); + Connect(_sliderwindowlevel->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&HistogramDialogComboBox::OnWindowLevelChanged); + + return sizersliders; + +} + +double HistogramDialogComboBox::GetWindowLevel(){ + if(_sliderwindowlevel != NULL){ + return _sliderwindowlevel->GetValue(); + } +} +double HistogramDialogComboBox::GetColorLevel(){ + if(_slidercolor != NULL){ + return _slidercolor->GetValue(); + } +} + +void HistogramDialogComboBox::OnColorLevelChanged(wxCommandEvent& event){ + _slidercolor->GetValue(); + + wxCommandEvent newevent(wxEVT_SCROLL_THUMBTRACK,this->GetId()); + ProcessEvent(newevent); + +} +void HistogramDialogComboBox::OnWindowLevelChanged(wxCommandEvent& event){ + _sliderwindowlevel->GetValue(); + + wxCommandEvent newevent(wxEVT_SCROLL_THUMBTRACK,this->GetId()); + ProcessEvent(newevent); + } void HistogramDialogComboBox::setImageData(vtkImageData* img){ _maxgreyvalue = img->GetScalarRange()[1]; _img = img; + + setSlidersValue(); + +} +void HistogramDialogComboBox::setSlidersValue(){ + if(_img!=NULL){ + if(_slidercolor!=NULL){ + _slidercolor->SetRange(_img->GetScalarRange()[0],_img->GetScalarRange()[1]); + _slidercolor->SetValue((_img->GetScalarRange()[0]+_img->GetScalarRange()[1])/2); + } + if(_sliderwindowlevel!=NULL){ + _sliderwindowlevel->SetRange(_img->GetScalarRange()[0],_img->GetScalarRange()[1]); + _sliderwindowlevel->SetValue((_img->GetScalarRange()[0]+_img->GetScalarRange()[1])/2); + } + } } void HistogramDialogComboBox::OnEditBitmapCombo(wxCommandEvent& event){ @@ -167,7 +240,8 @@ wxBitmapComboBox* HistogramDialogComboBox::getBitmapComboElements(){ bitmapcombo->SetSize(65,30); Connect(bitmapcombo->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction)&HistogramDialogComboBox::OnBitmapComboItemSelected); - + + for(int i = 0; i < bitmapsitems.size(); i++){ bitmapcombo->SetItemBitmap(i, bitmapsitems[i]->GetBitmap()); @@ -192,6 +266,8 @@ void HistogramDialogComboBox::OnBitmapComboItemSelected(wxCommandEvent& event){ wxCommandEvent newevent(wxEVT_COMMAND_COMBOBOX_SELECTED,this->GetId()); ProcessEvent(newevent); } + + } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h index 71f6d4a..ff63d22 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h @@ -45,6 +45,9 @@ public: void OnEditBitmapCombo(wxCommandEvent& event); void OnBitmapComboItemSelected(wxCommandEvent& event); + void OnColorLevelChanged(wxCommandEvent& event); + void OnWindowLevelChanged(wxCommandEvent& event); + void setImageData(vtkImageData* img); /** @@ -61,6 +64,9 @@ public: std::vector& green, std::vector& blue); + double GetWindowLevel(); + double GetColorLevel(); + private: std::vector _greyvect; @@ -77,15 +83,21 @@ private: * Represents the color of the backGround. Default color is the parent color. */ - wxBitmapComboBox* _bitmapcombo; + wxBitmapComboBox* _bitmapcombo; + wxSlider* _slidercolor; + wxSlider* _sliderwindowlevel; std::vector _bitmapsitems; wxBitmap* colorBar_Bitmap; wxSizer* _bitmapsizer; wxSizer* getBitmapCombo(); + wxSizer* getSlidersWlCo(); wxBitmapComboBox* getBitmapComboElements(); void OnLoadComboBoxData(std::vector& itembitmaps,std::string filename); void saveCurrentConfiguration(std::vector& itembitmaps,std::string filename); + void setSlidersValue(); + + }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx index 3cfdc1a..1c5c0e5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracas_N_ViewersWidget.cxx,v $ Language: C++ - Date: $Date: 2009/07/27 07:58:20 $ - Version: $Revision: 1.11 $ + Date: $Date: 2009/09/15 11:25:07 $ + Version: $Revision: 1.12 $ Copyright: (c) 2002, 2003 License: @@ -297,3 +297,32 @@ void wxMaracas_N_ViewersWidget::setColorTransferFunction(vtkColorTransferFunctio } } +void wxMaracas_N_ViewersWidget::setWindowLevel(double level){ + if (wxwindow1!=NULL) { + wxwindow1->setWindowLevel(level); + } + if (wxwindow2!=NULL) { + wxwindow2->setWindowLevel(level); + } + if (wxwindow3!=NULL) { + wxwindow3->setWindowLevel(level); + } + if (wxwindow4!=NULL) { + wxwindow4->setWindowLevel(level); + } +} +void wxMaracas_N_ViewersWidget::setColorLevel(double level){ + if (wxwindow1!=NULL) { + wxwindow1->setColorLevel(level); + } + if (wxwindow2!=NULL) { + wxwindow2->setColorLevel(level); + } + if (wxwindow3!=NULL) { + wxwindow3->setColorLevel(level); + } + if (wxwindow4!=NULL) { + wxwindow4->setColorLevel(level); + } +} + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h index 67a0e0c..1907c15 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracas_N_ViewersWidget.h,v $ Language: C++ - Date: $Date: 2009/07/27 07:58:20 $ - Version: $Revision: 1.7 $ + Date: $Date: 2009/09/15 11:25:07 $ + Version: $Revision: 1.8 $ Copyright: (c) 2002, 2003 License: @@ -80,6 +80,9 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel void setColorTransferFunction(vtkColorTransferFunction* colortable); + void setWindowLevel(double level); + void setColorLevel(double level); + //------------------------------------------------------------------------------------------------------------ // Attributes //------------------------------------------------------------------------------------------------------------ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index 987b0b1..4e2e626 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $ Language: C++ - Date: $Date: 2009/09/08 08:14:30 $ - Version: $Revision: 1.16 $ + Date: $Date: 2009/09/15 11:25:07 $ + Version: $Revision: 1.17 $ Copyright: (c) 2002, 2003 License: @@ -400,4 +400,34 @@ if(mwxvtkmpr3Dview!=NULL){ mwxvtkmpr3Dview->setColorTransferFunction(colortable); } - } \ No newline at end of file + } + + void wxMaracas_ViewerWidget::setWindowLevel(double level){ + if(mvtkmpr2Dview_X!=NULL){ + mvtkmpr2Dview_X->setWindowLevel(level); + } + if(mvtkmpr2Dview_Y!=NULL){ + mvtkmpr2Dview_Y->setWindowLevel(level); + } + if(mvtkmpr2Dview_Z!=NULL){ + mvtkmpr2Dview_Z->setWindowLevel(level); + } + /*if(mwxvtkmpr3Dview!=NULL){ + mwxvtkmpr3Dview->setWindowLevel(level); + }*/ + } + + void wxMaracas_ViewerWidget::setColorLevel(double level){ + if(mvtkmpr2Dview_X!=NULL){ + mvtkmpr2Dview_X->setColorLevel(level); + } + if(mvtkmpr2Dview_Y!=NULL){ + mvtkmpr2Dview_Y->setColorLevel(level); + } + if(mvtkmpr2Dview_Z!=NULL){ + mvtkmpr2Dview_Z->setColorLevel(level); + } + /*if(mwxvtkmpr3Dview!=NULL){ + mwxvtkmpr3Dview->setColorLevel(level); + }*/ + } \ No newline at end of file diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h index 77a37ed..e45edd4 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracas_ViewerWidget.h,v $ Language: C++ - Date: $Date: 2009/07/27 07:58:20 $ - Version: $Revision: 1.7 $ + Date: $Date: 2009/09/15 11:25:07 $ + Version: $Revision: 1.8 $ Copyright: (c) 2002, 2003 License: @@ -77,6 +77,10 @@ //------------------------------------------------------------------------------------------------------------ void setColorTransferFunction(vtkColorTransferFunction* colortable); + + void setWindowLevel(double level); + + void setColorLevel(double level); private: int mType; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index a7a406b..fa26572 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -244,5 +244,17 @@ void wxVtk2DBaseView::GetSpacing(double spc[3]) // virtual void wxVtk2DBaseView::setColorTransferFunction(vtkColorTransferFunction* colortable){ if(_imageViewer2XYZ!=NULL){ _imageViewer2XYZ->setColorTransferFunction(colortable); + this->Refresh(); } } + +void wxVtk2DBaseView::setWindowLevel(double level){ + _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level); + + this->Refresh(); +} + +void wxVtk2DBaseView::setColorLevel(double level){ + _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel(level); + this->Refresh(); +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h index 7ceccfb..7516b6c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h @@ -36,6 +36,10 @@ public: void setColorTransferFunction(vtkColorTransferFunction* colortable); + void setWindowLevel(double level); + + void setColorLevel(double level); + private: vtkBaseData *_vtkbasedata; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h index 751bdbd..b4d15a0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h @@ -34,6 +34,7 @@ public: void SetVisibleAxis(bool ok); + private: int _backX; -- 2.46.0