]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 15 Sep 2009 11:25:04 +0000 (11:25 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 15 Sep 2009 11:25:04 +0000 (11:25 +0000)
13 files changed:
bbtk/src/bbmaracasvisuTransferFunctionView.cxx
bbtk/src/bbmaracasvisuTransferFunctionView.h
bbtk/src/bbmaracasvisuViewerNV.cxx
bbtk/src/bbmaracasvisuViewerNV.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h

index 4fab7db27fba1e394e13ffbaeefdaf4e909d6c89..569e80f659653aa3f286021cd2cc10068057ebd5 100644 (file)
@@ -10,13 +10,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(TransferFunctionView,bbtk::WxBlackBox);
 void TransferFunctionView::Process()
 {
 
-       std::vector<double> greylevel;
-       std::vector<double> value;
-
-       std::vector<double> greylevelcolors;
-       std::vector<double> red;
-       std::vector<double> green;
-       std::vector<double> 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 "<<greylevel[i]<<" "<< value[i]<<std::endl;
-               }
-               _ctfun->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 "<<greylevelcolors[i]<<" "<<red[i]<<" "<<green[i]<<" "<<blue[i]<<std::endl;
-               }               
-
-
-               bbSetOutputOpacityFunction(_tfun);
-               bbSetOutputColorFunction(_ctfun);
+               onColorChange();
+               
                /*bbSetOutputGreyLevel(greylevel);
                bbSetOutputValue(value);
                bbSetOutputGreyLevelColors(greylevelcolors);
@@ -62,19 +40,68 @@ void TransferFunctionView::Process()
     
 }
 
+void TransferFunctionView::onColorChange(){
+
+       std::vector<double> greylevel;
+       std::vector<double> value;
+
+       std::vector<double> greylevelcolors;
+       std::vector<double> red;
+       std::vector<double> green;
+       std::vector<double> 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 "<<greylevel[i]<<" "<< value[i]<<std::endl;
+       }
+       _ctfun->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 "<<greylevelcolors[i]<<" "<<red[i]<<" "<<green[i]<<" "<<blue[i]<<std::endl;
+       }               
+
+       bbSignalOutputModification();
+
+       bbSetOutputOpacityFunction(_tfun);
+       bbSetOutputColorFunction(_ctfun);
+}
+
+void TransferFunctionView::onSliderChange(){
+       
+
+
+
+       bbSignalOutputModification();
+
+       bbSetOutputWindowLevel(mwxwidget->GetWindowLevel());
+       bbSetOutputColorLevel(mwxwidget->GetColorLevel());
+
+}
+
 //-----------------------------------------------------
 void TransferFunctionView::CreateWidget(wxWindow* parent)
 {
        bbtkDebugMessageInc("Core",9,"TransferFunctionView::CreateWxWindow()"<<std::endl);
+       
+       mwxwidget = new HistogramDialogComboBox(parent);                                
+
 
-       //mwxwidget = new HistogramWidget(parent, -1);
-       mwxwidget = new HistogramDialogComboBox(parent);
+       HandlerTransferFunctionView* handler = new HandlerTransferFunctionView(this);
+
+       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 ); 
+       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
 
 
index ef3fd0351e22aade539d8fc5b5592b7b0b4e4663..bcd1a09e348676de01513ce2fccb004fa9edad5c 100644 (file)
@@ -9,10 +9,13 @@
 
 #include "vtkPiecewiseFunction.h"
 #include "vtkColorTransferFunction.h"
+#include <wx/wx.h>
 
 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<double> );
        BBTK_DECLARE_OUTPUT(Value, std::vector<double> );
        BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector<double>);
@@ -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<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>,"");
@@ -58,6 +84,8 @@ BBTK_DESCRIPTION("Transfer Function Window");
   BBTK_OUTPUT(TransferFunctionView,Blue,"Blue value according to the GreyLevelColors",std::vector<double>,"");*/
 BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionView);
 }
+
+
 // EO namespace bbcreaMaracasVisu
 
 #endif // __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
index f5cf90cd8911a1ba609d76770d4aedf38c99a4e9..ae2c0c9d3b84410c21b349a89e5f78a1b65fb12f 100644 (file)
@@ -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);
 }
 
        //-----------------------------------------------------------------     
index eb6b39cfbe5e7949685a6f1ac73bc5dc1588a891..ec3aa26d634009a67debf7079e7e58959920014e 100644 (file)
@@ -47,6 +47,8 @@ class /*BBTK_EXPORT*/ ViewerNV
       BBTK_DECLARE_INPUT(In, vtkImageData *);
          BBTK_DECLARE_INPUT(nTypeView, std::vector<int> );
          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<int>,"");
        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  *,"");
index 6c8dcd3ed31f210f6e140c88829beee1d50b005c..3a997d5d22b75a6a63546958fa5a60b258f6d709 100644 (file)
@@ -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<double> 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);
                }
+
+
                
        }
        
index 71f6d4aea9e7390972206f0b04494f204c0b4860..ff63d22029a4802d356e5f1a074523110ea56da8 100644 (file)
@@ -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<double>& green,
                                                                        std::vector<double>& blue);
 
+       double GetWindowLevel();
+       double GetColorLevel();
+
 private:
 
        std::vector<double> _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<HistogramDialogComboBoxItem*> _bitmapsitems;
        wxBitmap* colorBar_Bitmap;
        wxSizer* _bitmapsizer;
 
        wxSizer* getBitmapCombo();
+       wxSizer* getSlidersWlCo();
        wxBitmapComboBox* getBitmapComboElements();
        void OnLoadComboBoxData(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
        void saveCurrentConfiguration(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
+       void setSlidersValue();
+
+
        
 };
 
index 3cfdc1a9e69ec210799c3be347428827ea4a100a..1c5c0e55a71aa3f2efd45ee621646bcde7df4ca8 100644 (file)
@@ -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);
+       }
+}
+
index 67a0e0c7b362081e6805187bbfa790d31c1a5eac..1907c155b418bdb265eaf42382d460d224257f7e 100644 (file)
@@ -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
        //------------------------------------------------------------------------------------------------------------
index 987b0b1d3ae1c482cfb2cbaf313f2f3cd9634ce3..4e2e626b3ac071286f4ca25c087fda2733b110b0 100644 (file)
@@ -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:
                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
index 77a37edf9d9f6c8f07611d648c960c963a8831cc..e45edd491af34088ddbdea877aa17c2b0d5c29c5 100644 (file)
@@ -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:
        //------------------------------------------------------------------------------------------------------------
 
        void setColorTransferFunction(vtkColorTransferFunction* colortable);
+
+       void setWindowLevel(double level);
+
+       void setColorLevel(double level);
   private:
                int                                                             mType;
 
index a7a406ba828a7bc7c37e7f113559bcabf52f4291..fa26572f836005c976c57b10cc5bea4c9cd68c40 100644 (file)
@@ -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();
+}
index 7ceccfb34f905bb327c97be8925e39c29ccc28a6..7516b6c0104e8b839cce0c31ee36a43fc95884a4 100644 (file)
@@ -36,6 +36,10 @@ public:
 
        void setColorTransferFunction(vtkColorTransferFunction* colortable);
 
+       void setWindowLevel(double level);
+
+       void setColorLevel(double level);
+
 private:
        vtkBaseData                                                     *_vtkbasedata;
 
index 751bdbd3bf8278c6114b050440b9733eeb1b0566..b4d15a07d558b90fff161aec9b97ab94aab878f1 100644 (file)
@@ -34,6 +34,7 @@ public:
                        void                    SetVisibleAxis(bool ok);
 
 
+
 private:
 
        int                                                     _backX;