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 /*=========================================================================
29 Module: $RCSfile: wxImageViewerWidget.h,v $
31 Date: $Date: 2012/11/15 14:15:18 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
37 This software is distributed WITHOUT ANY WARRANTY; without even
38 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
39 PURPOSE. See the above copyright notice for more information.
41 =========================================================================*/
43 #ifndef __WX__IMAGE__VIEWER__WIDGET__
44 #define __WX__IMAGE__VIEWER__WIDGET__
46 //As it is extremely easy to use vtkImageViewer/ vtkImageViewer2, I gave up with
50 #include "InterfaceVtkPanelWidgets.h"
51 // #include "vtk3DSurfaceWidget.h" //EED pour avoir access a la classe "InterfaceVtkPanelWidgets"
53 #include "../manualContour.h"
54 #include "wxVTKRenderWindowInteractorEditContour.h"
56 #include "wxVTKRenderWindowInteractor.h"
57 #include "vtkImageViewer2.h"
58 #include "vtkImageData.h"
60 #include "vtkPoints.h"
62 class marZoomROIObserver;
65 class wxVtk2DView_TMP : public wxVtkBaseView{
67 wxVtk2DView_TMP(vtkImageViewer2 *imageviewer2);
69 virtual vtkRenderer *GetRenderer();
70 virtual vtkRenderWindow *GetRenWin();
71 virtual void Configure();
72 void SetWxVTKRenderWindowInteractor( wxVTKRenderWindowInteractor *wxVTKiren);
73 virtual wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor();
76 wxVTKRenderWindowInteractor *_wxVTKiren;
77 vtkImageViewer2 *_imageviewer2;
82 * \brief Panel class composed of a vtk renderwindow with double click available
83 * and add some buttons
85 class wxImageViewerWidget : public wxPanel{
91 const wxPoint &pos = wxDefaultPosition,
92 const wxSize& size = wxDefaultSize,
93 long style = wxSUNKEN_BORDER, //wxTAB_TRAVERSAL,
94 const wxString& name = wxPanelNameStr
96 ~wxImageViewerWidget( );
98 virtual void ConstructVTK(vtkImageData *imageData);
99 virtual void ExecuteEvent(vtkObject *wdg, unsigned long event, void* calldata);
100 void ExecuteEvent1(vtkObject *wdg, unsigned long event, void* calldata);
101 void ExecuteEvent2(vtkObject *wdg, unsigned long event, void* calldata);
102 void SetImage(vtkImageData* imagedata);
103 void SetInterfaceVtkPanelWidgets(InterfaceVtkPanelWidgets * intVtkPanWid) { _intVtkPanWid = intVtkPanWid; };
105 void SetState(int state);
106 void SetStateManualContour(int state);
107 void CreateNewManualContour();
108 int GetNumberOfPointsSplineManualContour();
109 double* GetVectorPointsXManualContour();
110 double* GetVectorPointsYManualContour();
111 void EraseManualContour();
112 void SetZSlice(int z);
117 void AddObserver_1();
118 void AddObserver_2();
122 marZoomROIObserver *_Observer;
123 vtkInteractorStyle2DMaracas *_interactorStyle2DMaracas;
124 vtkImageViewer2 *_imageViewer;
125 InterfaceVtkPanelWidgets *_intVtkPanWid;
126 wxVTKRenderWindowInteractorEditContour *_wxVTKiren;
129 manualContourControler *_manContControl;
130 manualContourModel *_mContourModel;
131 manualViewContour *_mViewContour;
135 //----------------------------------------------------------------------------
137 class wxImageViewerWidgetRoi : public wxImageViewerWidget{
139 wxImageViewerWidgetRoi(
142 const wxPoint &pos = wxDefaultPosition,
143 const wxSize& size = wxDefaultSize,
144 long style = wxSUNKEN_BORDER, //wxTAB_TRAVERSAL,
145 const wxString& name = wxPanelNameStr
147 ~wxImageViewerWidgetRoi( );
148 void GetROI( int extent[6] );
149 virtual void ConstructVTK(vtkImageData *imageData);
150 void TransfromeCoordViewWorld(int &X, int &Y, int &Z);
151 bool GetRoiSelected();
154 virtual void ExecuteEvent(vtkObject *wdg, unsigned long event, void* calldata);
159 vtkActor *_bboxActor;
160 vtkPolyDataMapper *_bboxMapper;
163 #endif // __WX__IMAGE__VIEWER__WIDGET__