]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuContourVOI.h
#3262 creaMaracasVisu Feature New Normal - Export LookupTable fron ColorLayerImageV...
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuContourVOI.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
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
8 #
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.
15 #
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
20 #  liability.
21 #
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 # ------------------------------------------------------------------------ */
25
26 #ifdef _USE_WXWIDGETS_
27 #ifndef __bbcreaMaracasVisuContourVOI_h_INCLUDED__
28 #define __bbcreaMaracasVisuContourVOI_h_INCLUDED__
29 #include "bbtkWxBlackBox.h"
30
31
32 #include <vtkImageData.h>
33
34 #include "Contour/ContourVOIWidget.h"
35
36 namespace bbcreaMaracasVisu
37 {
38
39
40   //--------------------------------------------------------------------------
41   class ContourVOI;
42   class wxWidgetVOI : public wxPanel
43   {
44         public:
45                 wxWidgetVOI(wxWindow* parent, wxVtkBaseView *wxvtkbaseview=NULL, vtkImageData   *imagedata=NULL);
46                 ~wxWidgetVOI();
47             
48                 //if the MPR had generated the refresh event
49                 void OnRefreshView(wxCommandEvent & event);
50                 void OnDClickLeft(wxCommandEvent & event); 
51
52                 //refreshView
53                 void Refresh();
54
55                 ContourVOIWidget* GetContourVOIWidget();
56
57             void setImageData(vtkImageData * imagedata);
58                 void setBaseView(wxVtkBaseView * wxvtkbaseview);
59
60                 void initializeVOIWidget();
61
62         private:
63
64 //              ContourVOI                      *mbbViewerMPR;
65                 ContourVOIWidget        *mcontourvoiwidget;
66
67                 wxVtkBaseView * wxvtkbaseview;
68                 vtkImageData * imagedata;
69                 
70
71                 
72
73         DECLARE_EVENT_TABLE( );     
74   };
75   
76   //------------------------------------------------------------------------
77   //------------------------------------------------------------------------
78   //------------------------------------------------------------------------
79
80
81
82
83
84
85 class /*BBTK_EXPORT*/ ContourVOI
86  : 
87    public bbtk::WxBlackBox
88 {
89   BBTK_BLACK_BOX_INTERFACE(ContourVOI,bbtk::WxBlackBox);
90   BBTK_DECLARE_INPUT(Title,std::string);
91     BBTK_DECLARE_INPUT(In, vtkImageData*);
92     BBTK_DECLARE_INPUT(wxVtkBaseView, wxVtkBaseView*);
93         BBTK_DECLARE_OUTPUT(Index,std::string);
94         BBTK_DECLARE_OUTPUT(Size,std::string);
95         BBTK_DECLARE_OUTPUT(VOI,vtkImageData*);
96   BBTK_PROCESS(Process);
97   void Process();
98   BBTK_CREATE_WIDGET(CreateWidget);
99   void CreateWidget(wxWindow*);
100
101 private:
102         vtkImageData* _img;
103         wxVtkBaseView* _base;
104 //EED 20Juin2011        vtkExtractVOI*  _extract;
105
106 };
107
108 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ContourVOI,bbtk::WxBlackBox);
109 BBTK_NAME("ContourVOI");
110 BBTK_AUTHOR("Eduardo.Davila [at] creatis.insa-lyon.fr");
111 BBTK_DESCRIPTION("define VOI widget");
112 //BBTK_CATEGORY("__CategoryBlackBox__");
113     BBTK_INPUT(ContourVOI,Title,"Title prepended to the text",std::string,"");
114         BBTK_INPUT(ContourVOI,In,"Input Image", vtkImageData *,"" );
115         BBTK_INPUT(ContourVOI,wxVtkBaseView,"maracas visu wxVtkBaseView",wxVtkBaseView*,"");
116         BBTK_OUTPUT(ContourVOI,Index, "Index"   ,       std::string,"");
117         BBTK_OUTPUT(ContourVOI,Size, "Size"     ,       std::string,"");
118         BBTK_OUTPUT(ContourVOI,VOI,"Region of interest",vtkImageData*,"");
119 BBTK_END_DESCRIBE_BLACK_BOX(ContourVOI);
120 }
121 // EO namespace bbcreaMaracasVisu
122
123 #endif // __bbcreaMaracasVisuContourVOI_h_INCLUDED__
124 #endif // _USE_WXWIDGETS_
125