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 __bbcreaMaracasVisuViewerNV_h_INCLUDED__
28 #define __bbcreaMaracasVisuViewerNV_h_INCLUDED__
29 #include "bbtkWxBlackBox.h"
31 #include "vtkImageData.h"
32 #include "vtkRenderer.h"
34 #include "wxVtkBaseView.h"
36 //#include "widgets/wxMPRWidget.h"
37 //#include "widgets/wxMaracas_ViewerWidget.h"
38 //#include "widgets/wxMaracas_N_ViewersWidget.h"
40 #include "wxMPRWidget.h"
41 #include "wxMaracas_ViewerWidget.h"
42 #include "wxMaracas_N_ViewersWidget.h"
44 #include "vtkImagePlaneWidget.h"
46 namespace bbcreaMaracasVisu
49 class bbwxMaracas_N_ViewersWidget : public wxMaracas_N_ViewersWidget
52 bbwxMaracas_N_ViewersWidget(ViewerNV* box,wxWindow *parent, vtkImageData* imagedata=NULL, std::vector<int> *nTypeView=NULL);
53 ~bbwxMaracas_N_ViewersWidget();
55 //if the MPR had generated the refresh event
56 void OnRefreshView(wxCommandEvent &event);
57 void OnDClickLeft(wxCommandEvent &event);
59 ViewerNV *mbbViewerNV;
60 DECLARE_EVENT_TABLE( );
63 //-------------------------------------------------------------------
64 //-------------------------------------------------------------------
65 //-------------------------------------------------------------------
67 class /*BBTK_EXPORT*/ ViewerNV
69 public bbtk::WxBlackBox
71 BBTK_BLACK_BOX_INTERFACE(ViewerNV,bbtk::WxBlackBox);
72 BBTK_DECLARE_INPUT(Title,std::string);
73 BBTK_DECLARE_INPUT(In, vtkImageData *);
74 BBTK_DECLARE_INPUT(nTypeView, std::vector<int> );
75 BBTK_DECLARE_INPUT(ColorFunction, vtkColorTransferFunction* );
76 BBTK_DECLARE_INPUT(WindowLevel, double );
77 BBTK_DECLARE_INPUT(ColorLevel, double );
78 BBTK_DECLARE_INPUT(Obs1, vtkInteractorObserver *);
79 BBTK_DECLARE_INPUT(Obs2, vtkInteractorObserver *);
80 BBTK_DECLARE_INPUT(Obs3, vtkInteractorObserver *);
81 BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *);
82 BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *);
83 BBTK_DECLARE_INPUT(Interpolate, bool);
86 BBTK_DECLARE_OUTPUT(wxVtkBaseView1,wxVtkBaseView*);
87 BBTK_DECLARE_OUTPUT(wxVtkBaseView2,wxVtkBaseView*);
88 BBTK_DECLARE_OUTPUT(wxVtkBaseView3,wxVtkBaseView*);
89 BBTK_DECLARE_OUTPUT(wxVtkBaseView4,wxVtkBaseView*);
90 BBTK_DECLARE_OUTPUT(Renderer1,vtkRenderer*);
91 BBTK_DECLARE_OUTPUT(Renderer2,vtkRenderer*);
92 BBTK_DECLARE_OUTPUT(Renderer3,vtkRenderer*);
93 BBTK_DECLARE_OUTPUT(Renderer4,vtkRenderer*);
94 BBTK_DECLARE_OUTPUT(Interactor1,vtkRenderWindowInteractor*);
95 BBTK_DECLARE_OUTPUT(Point,std::vector<int>);
97 BBTK_PROCESS(Process);
99 BBTK_CREATE_WIDGET(CreateWidget);
100 void CreateWidget(wxWindow* parent);
102 std::vector<int> _point;
105 vtkImageData *_currentimg;
106 std::vector<int> _currenttype;
107 wxMaracas_N_ViewersWidget *_mwxwidget;
109 bool compareVectors(std::vector<int> type,std::vector<int> currenttype);
110 void updateObservers();
113 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerNV,bbtk::WxBlackBox);
114 BBTK_NAME("ViewerNV");
115 BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
116 BBTK_DESCRIPTION("Viewer : N view configuration 2D and 3D");
117 BBTK_CATEGORY("viewer");
118 BBTK_INPUT(ViewerNV,Title,"Title prepended to the text",std::string,"");
119 BBTK_INPUT(ViewerNV,In,"Input image",vtkImageData*,"");
120 BBTK_INPUT(ViewerNV,nTypeView,"vector of viewer types (default 5 1 2 0): -1=Z_2DwithOutAxis 0=Z_2D 1=X_2D 2=Y_2D 3=Plane 4=Sphere 5=3D 6=3Dplane 7=3D_empty",std::vector<int>,"");
121 BBTK_INPUT(ViewerNV,ColorFunction,"Optional: set a different color for the viewers 2D",vtkColorTransferFunction*,"");
122 BBTK_INPUT(ViewerNV,WindowLevel,"Optional: set a different Window level by using an other widget",double,"");
123 BBTK_INPUT(ViewerNV,ColorLevel,"Optional: set a different Color level by using an other widget",double,"");
124 BBTK_INPUT(ViewerNV,Obs1,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
125 BBTK_INPUT(ViewerNV,Obs2,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
126 BBTK_INPUT(ViewerNV,Obs3,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
127 BBTK_INPUT(ViewerNV,Obs4,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
128 BBTK_INPUT(ViewerNV,Obs5,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
129 BBTK_INPUT(ViewerNV,Interpolate,"Interpolate true/false (default true)",bool,"");
131 BBTK_OUTPUT(ViewerNV,wxVtkBaseView1,"wxVtkBaseView 1",wxVtkBaseView *,"");
132 BBTK_OUTPUT(ViewerNV,wxVtkBaseView2,"wxVtkBaseView 2",wxVtkBaseView *,"");
133 BBTK_OUTPUT(ViewerNV,wxVtkBaseView3,"wxVtkBaseView 3",wxVtkBaseView *,"");
134 BBTK_OUTPUT(ViewerNV,wxVtkBaseView4,"wxVtkBaseView 4",wxVtkBaseView *,"");
135 BBTK_OUTPUT(ViewerNV,Renderer1,"Renderer 1",vtkRenderer *,"");
136 BBTK_OUTPUT(ViewerNV,Renderer2,"Renderer 2",vtkRenderer *,"");
137 BBTK_OUTPUT(ViewerNV,Renderer3,"Renderer 3",vtkRenderer *,"");
138 BBTK_OUTPUT(ViewerNV,Renderer4,"Renderer 4",vtkRenderer *,"");
139 BBTK_OUTPUT(ViewerNV,Interactor1,"Interactor1",vtkRenderWindowInteractor *,"");
140 BBTK_OUTPUT(ViewerNV,Point,"Axis point",std::vector<int>,"");
142 BBTK_END_DESCRIBE_BLACK_BOX(ViewerNV);
144 // EO namespace bbcreaMaracasVisu
146 #endif // __bbcreaMaracasVisuViewerNV_h_INCLUDED__
147 #endif // _USE_WXWIDGETS_