1 /*=========================================================================
4 Module: $RCSfile: wxMaracasIRMViewManager.h,v $
6 Date: $Date: 2009/04/09 13:58:38 $
7 Version: $Revision: 1.2 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
21 #ifndef __wxMaracasIRMViewManagerH__
22 #define __wxMaracasIRMViewManagerH__
27 #include "vtkProp3D.h"
28 #include "vtkRenderer.h"
29 #include "vtkSTLReader.h"
30 #include "vtkPolyDataMapper.h"
32 #include "vtkProperty.h"
33 #include "vtkMetaImageReader.h"
34 #include "vtkMarchingCubes.h"
35 #include "vtkCleanPolyData.h"
36 #include "vtkImageData.h"
41 class wxMaracasIRMViewManagerData {
44 wxMaracasIRMViewManagerData(vtkProp3D* _prop3Dvect, std::string dataname="");
45 wxMaracasIRMViewManagerData(vtkImageData* imagedata, std::string dataname="");
46 ~wxMaracasIRMViewManagerData();
50 ** Adds a prop3D to the world of the application
52 void setVtkImageData(vtkImageData* imagedata);
54 ** Adds a prop3D to the world of the application
56 void setProp3D(vtkProp3D* prop3D);
58 ** Changes the opacity in a prop3D
60 void changeOpacity(int value);
62 ** changes the isovalue in a prop3D
64 void changeIsoValue(int value);
66 ** Check if the variables are setted correctly
68 void checkInvariant();
72 vtkProp3D* getProp3D();
74 ** return the id from the daat
80 void setId(int propid);
84 std::string getDataname();
88 void setDataname(std::string dataname);
90 ** Returns the grey max level of the image
93 int getMaxGreyLevel();
98 void contourExtractor(int isovalue);
101 ** Changes the color of the actor
103 void changeColor(double red, double green, double blue);
107 vtkImageData* _imagedata;
109 std::string _dataname;
115 vtkPolyDataMapper* _dataMapper;
116 vtkPolyData* _polydata;
118 ** Get's the max grey level of the image
120 int getMaxLevel(vtkImageData* img);
126 class wxMaracasIRMViewManager {
129 wxMaracasIRMViewManager();
130 ~wxMaracasIRMViewManager();
133 ** Sets the renderer to manage the prop3D from the view
135 void setRenderer(vtkRenderer* renderer);
137 ** Adds a prop3D to the manager and returns the identifier
139 int addProp3D(vtkProp3D* prop3D, std::string dataname);
141 ** Adds a prop3D to the manager and returns the identifier
143 int addPropMHD(vtkImageData* imagedata, std::string dataname);
145 ** Changes the opacity in a prop3D
147 void changeOpacity(int propid, int value);
150 ** changes the isovalue in a prop3D
152 void changeIsoValue(int propid, int value);
155 ** loads a prop3D from a nSTL file
157 vtkProp3D* getProp3D(std::string filename);
160 ** loads a MHD file to convert it into an actor
162 vtkImageData* getImageData(std::string filename);
165 ** adds or removes an actor depending of the bool value
167 void addRemoveActor(int propid, bool addremove);
169 ** Check if the variables are setted correctly
171 void checkInvariant();
174 ** Given an id search the data in the vector
176 wxMaracasIRMViewManagerData* getViewData(int id);
179 ** Given the id, return the max iso value from the imagedata
181 int getMaxIsoValue(int propid);
185 ** Changes the color of the actor
187 void changeColor(int propid, double red, double green, double blue);
190 std::vector<wxMaracasIRMViewManagerData*> prop3Dvect;
192 vtkRenderer* _renderer;