1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #ifdef _USE_WXWIDGETS_
27 #ifndef __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
28 #define __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
29 #include "bbtkWxBlackBox.h"
31 #include "vtkImageData.h"
32 //#include "HistogramWidget.h"
33 #include "HistogramDialogComboBox.h"
35 #include "vtkPiecewiseFunction.h"
36 #include "vtkColorTransferFunction.h"
39 namespace bbcreaMaracasVisu
44 class /*BBTK_EXPORT*/ TransferFunctionView
46 public bbtk::WxBlackBox
48 BBTK_BLACK_BOX_INTERFACE(TransferFunctionView,bbtk::WxBlackBox);
49 BBTK_DECLARE_INPUT(In, vtkImageData*);
50 BBTK_DECLARE_OUTPUT(OpacityFunction, vtkPiecewiseFunction*);
51 BBTK_DECLARE_OUTPUT(ColorFunction, vtkColorTransferFunction*);
53 BBTK_DECLARE_OUTPUT(Active , bool );
54 BBTK_DECLARE_OUTPUT(WindowLevel , double );
55 BBTK_DECLARE_OUTPUT(ColorLevel , double );
56 /*BBTK_DECLARE_OUTPUT(GreyLevel, std::vector<double> );
57 BBTK_DECLARE_OUTPUT(Value, std::vector<double> );
58 BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector<double>);
59 BBTK_DECLARE_OUTPUT(Red, std::vector<double>);
60 BBTK_DECLARE_OUTPUT(Green, std::vector<double>);
61 BBTK_DECLARE_OUTPUT(Blue, std::vector<double>);*/
63 BBTK_PROCESS(Process);
65 BBTK_CREATE_WIDGET(CreateWidget);
66 void CreateWidget(wxWindow* parent);
69 void onSliderChange();
72 //HistogramWidget *mwxwidget;
73 HistogramDialogComboBox *mwxwidget;
74 vtkImageData* _currentimg;
76 vtkPiecewiseFunction* _tfun;
77 vtkColorTransferFunction* _ctfun;
81 class HandlerTransferFunctionView : public wxEvtHandler
84 HandlerTransferFunctionView(TransferFunctionView* box);
85 ~HandlerTransferFunctionView();
86 // void onActive(wxCommandEvent& event);
87 void onColorChange(wxCommandEvent& event);
88 void onSliderChange(wxCommandEvent& event);
90 TransferFunctionView *_box;
94 BBTK_BEGIN_DESCRIBE_BLACK_BOX(TransferFunctionView,bbtk::WxBlackBox);
95 BBTK_NAME("TransferFunctionView");
96 BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
97 BBTK_DESCRIPTION("Transfer Function Window");
98 //BBTK_CATEGORY("__CategoryBlackBox__");
99 BBTK_INPUT(TransferFunctionView,In,"Input image",vtkImageData*,"");
100 BBTK_OUTPUT(TransferFunctionView,OpacityFunction,"Transfer function for the opacity", vtkPiecewiseFunction*,"");
101 BBTK_OUTPUT(TransferFunctionView,ColorFunction,"Transfer function for the color", vtkColorTransferFunction*,"");
102 BBTK_OUTPUT(TransferFunctionView,WindowLevel,"WidowLevel for the current window", double,"");
103 BBTK_OUTPUT(TransferFunctionView,ColorLevel,"ColorLevel for the current window", double,"");
104 BBTK_OUTPUT(TransferFunctionView,Active,"Active", bool,"");
105 /*BBTK_OUTPUT(TransferFunctionView,GreyLevel,"Greylevel related to the transparency",std::vector<double>,"");
106 BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector<double>,"");
107 BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector<double>,"");
108 BBTK_OUTPUT(TransferFunctionView,Red,"Red value according to the GreyLevelColors",std::vector<double>,"");
109 BBTK_OUTPUT(TransferFunctionView,Green,"Green value according to the GreyLevelColors",std::vector<double>,"");
110 BBTK_OUTPUT(TransferFunctionView,Blue,"Blue value according to the GreyLevelColors",std::vector<double>,"");*/
111 BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionView);
115 // EO namespace bbcreaMaracasVisu
117 #endif // __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
118 #endif // _USE_WXWIDGETS_