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: vtk3DQuantSurfaceWidget.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 =========================================================================*/
42 #ifndef __VTK3DQUANTSURFACEWIDGET__
43 #define __VTK3DQUANTSURFACEWIDGET__
49 #include "vtk3DSurfaceWidget.h"
50 #include "kernel/marInterface.h"
51 #include "kernel/marInterfaceCT.h"
52 #include <vtkDataSetMapper.h>
54 #include <vtkProbeFilter.h>
55 #include <vtkWindowLevelLookupTable.h>
56 #include <vtkLookupTable.h>
58 #include <vtkPolyLine.h>
60 //----------------------------------------------------------------------------
62 class RectangleGuideVtk{
69 vtkPolyLine* _poly_line;
70 vtkDataSetMapper* _mapper;
71 vtkUnstructuredGrid* _grid;
75 //----------------------------------------------------------------------------
77 class vtk3DQuantSurfaceWidget;
79 class listContourVTK {
81 listContourVTK(vtk3DQuantSurfaceWidget *quantSurfaceWidget);
83 void EraseListContourActor();
84 void EraseSliceContourActor(int slice, bool refresh=true);
85 void InitListContourActor(int nos);
86 void Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor);
87 void Show3DContourActor();
88 void Hide3DContourActor();
89 void SetColour(int r,int g,int b);
93 vtk3DQuantSurfaceWidget *_vtk3DQuantSurfaceWidget;
94 std::vector< vtkActor* > _lst3DContoursVtkActor;
95 std::vector< vtkUnstructuredGrid* > _lst3DContoursVtkUnstructuredGrid;
96 std::vector< vtkDataSetMapper* > _lst3DContoursVtkDataSetMapper;
97 std::vector< vtkPolyLine* > _lst3DContoursVtkPolyLine;
99 //----------------------------------------------------------------------------
103 * \brief Class that brigde to VTK, override double click...
105 class vtk3DQuantSurfaceWidget : public vtk3DSurfaceWidget
109 vtk3DQuantSurfaceWidget(
112 const wxPoint& pos = wxDefaultPosition,
113 const wxSize& size = wxDefaultSize,
115 const wxString& name = wxPanelNameStr
117 ~vtk3DQuantSurfaceWidget();
118 void ShowMARACASDataAndAxe( marInterface* mar );
119 void ShowMARACASDataAndAxeCT( marInterfaceCT* mar);
121 void SetImage( vtkProbeFilter* pFilter );
124 void InitListContourActor( int type, int nos);
125 void Show3DContourActor( int type=0 );
126 void Hide3DContourActor( int type=0 );
127 void Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor, int type=0 );
128 void Erase3DContourActor( int slice);
130 void Show3DSliceActor( );
131 void Hide3DSliceActor( );
133 void SetColorLookUp( );
136 void Show3DHealthySliceActor();
137 void Hide3DHealthySliceActor();
138 void Set3DHealthySliceActor( );
140 void Set3DRegionSliceActor( int type, int k1,int k2 );
141 void Set3DStartRegionSliceActor( int type, int k );
142 void Set3DEndRegionSliceActor( int type, int k );
144 void Show3DRegionSliceActor(int type );
145 void Show3DStartRegionSliceActor(int type );
146 void Show3DEndRegionSliceActor(int type );
148 void Hide3DRegionSliceActor(int type );
149 void Hide3DStartRegionSliceActor(int type );
150 void Hide3DEndRegionSliceActor(int type );
152 void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
154 int GetAnalysisTypeStenosis();
155 void SetAnalysisTypeStenosis(int analysisTypeStenosis);
158 vtkRenderer* QuantSurfaceWidget_GetRenderer() {return _pRenderer; };
159 vtkRenderWindow* QuantSurfaceWidget_GetRenderWindow() {return _pRenderWindow; };
163 vtkDataSetMapper *_3DSliceMapper;
164 vtkActor *_3DSliceActor;
166 RectangleGuideVtk *_hs_rectGuide;
167 RectangleGuideVtk *_s1_rectGuide;
168 RectangleGuideVtk *_s2_rectGuide;
169 RectangleGuideVtk *_sA_rectGuide;
170 RectangleGuideVtk *_sB_rectGuide;
172 vtkWindowLevelLookupTable* _bwlookup;
173 vtkLookupTable* _collookup;
178 int _analysisTypeStenosis;
179 listContourVTK *_lstContVtk;
180 listContourVTK *_lstContHealtyVtk;
182 // DECLARE_EVENT_TABLE( );
183 void Set3DSliceActor( RectangleGuideVtk *_rectGuide ,float scale, int k,int r,int g,int b);
186 #endif //__VTK3DQUANTSURFACEWIDGET__