00001 #ifndef VTKPLANE2DVIEW_H_ 00002 #define VTKPLANE2DVIEW_H_ 00003 00004 #include "vtkInteractorStylePlane2D.h" 00005 #include "vtkInfoTextImageInteractorPlane2D.h" 00006 #include "vtkInfoTextImage.h" 00007 00008 #include "wxVtk2DBaseView.h" 00009 00010 #include "vtkTransform.h" 00011 #include "vtkImageChangeInformation.h" 00012 #include "vtkStructuredPoints.h" 00013 #include "vtkPlaneSource.h" 00014 #include "vtkProbeFilter.h" 00015 #include "vtkPolyDataMapper.h" 00016 00017 class vtkPlane2DView : public wxVtk2DBaseView 00018 { 00019 public: 00020 vtkPlane2DView(wxWindow *parent); 00021 ~vtkPlane2DView(); 00022 void Configure(); 00023 void ExtractPlane(); 00024 int GetImgSize(); 00025 void SetImgSize( int imgSize ); 00026 00027 void RotationStart(); 00028 void RotationDrag(double vx, double vy, bool ok_v, bool ok_ang); 00029 00030 virtual int GetActualSlice(); 00031 virtual void SetActualSlice(int slice); 00032 00033 virtual void Refresh( ); 00034 00035 vtkMPRBaseData *GetVtkmprbasedata(); 00036 vtkInteractorStylePlane2D *GetInteractorstyleplane2D(); 00037 00038 void SetActive(bool active); 00039 void SetVisibleLine(bool ok); 00040 00041 void TransfromCoordViewWorld2(double &X, double &Y, double &Z); 00042 00043 int GetMipWidth(); 00044 void SetMipWidth(int value); 00045 bool GetMipVisualization(); 00046 void SetMipVisualization(bool ok); 00047 00048 void ResetBack(); 00049 00050 private: 00051 bool _active; 00052 int _mip_width; 00053 bool _mip_visualization; 00054 00055 double _backX; 00056 double _backY; 00057 double _backZ; 00058 double _backOrient[4]; 00059 00060 double _ang; 00061 double _vxb; 00062 double _vyb; 00063 double _n[3]; // Normal 00064 00065 double _cx; 00066 double _cy; 00067 double _cz; 00068 00069 int _sizeIma; 00070 00071 vtkImageData * _imageResult; 00072 00073 // Horizontal line 00074 vtkPoints *_pts; 00075 vtkActor *_lineActor; 00076 vtkPolyDataMapper *_lineMapper; 00077 vtkPolyData *_pd; 00078 00079 vtkProbeFilter *_3Dslices; 00080 vtkPlaneSource *_pSource; 00081 vtkStructuredPoints *_stPoints; 00082 vtkImageChangeInformation *_change; 00083 vtkTransform *_transform1; 00084 vtkTransform *_transform2; 00085 00086 vtkInteractorStylePlane2D *_interactorstyleplane2D; 00087 00088 vtkInfoTextImage *_vtkInfoTextImage; 00089 vtkInfoTextImageInteractorPlane2D *_vtkInfoTextImageInteractorPlane2D; 00090 00091 00092 void SetPSource(int sizeIma); 00093 void HorizontalLine(); 00094 void ResetPlane(); 00095 void Extract_One_PlaneVTK(); 00096 void Extract_MIP_PlaneVTK(); 00097 00098 protected: 00099 }; 00100 00101 #endif /*VTKPLANE2DVIEW_H_*/