]> Creatis software - bbtk.git/blob - packages/wxvtk/src/bbwxvtkMIPViewer.h
3295ed25b3fa68018aedcc3535c9ad759b629411
[bbtk.git] / packages / wxvtk / src / bbwxvtkMIPViewer.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxvtkMIPViewer.h,v $
5   Language:  C++
6   Date:      $Date: 2008/03/03 13:14:27 $
7   Version:   $Revision: 1.1 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*//**
18  * \brief Short description in one line
19  * 
20  * Long description which 
21  * can span multiple lines
22  */
23 /**
24  * \file 
25  * \brief Pattern for the definition of a new type of Node (header)
26  */
27 /**
28  * \class bbtk::NodePatern 
29  * \brief Pattern for the definition of a new type of Node 
30  */
31
32
33 #ifdef _USE_WXWIDGETS_
34 #ifdef _USE_VTK_
35
36
37 #ifndef __bbwxvtkMIPViewer_h_INCLUDED__
38 #define __bbwxvtkMIPViewer_h_INCLUDED__
39
40 #include "vtkImageData.h"
41 #include "vtkImageViewer2.h"
42
43 #include "bbtkWxBlackBox.h"
44 #include "wxVTKRenderWindowInteractor.h"
45
46 #include <vtkImageShiftScale.h>
47 #include <vtkVolumeRayCastMIPFunction.h>
48 #include <vtkVolumeRayCastMapper.h>
49 #include <vtkVolume.h>
50 #include <vtkActor.h>
51 #include <vtkCamera.h>
52
53 namespace bbwxvtk
54 {
55
56   class MIPViewer; 
57
58   //--------------------------------------------------------------------------
59   class MIPViewerWidget : public wxPanel
60   {
61   public:
62     MIPViewerWidget(MIPViewer* box, wxWindow *parent);
63     ~MIPViewerWidget();
64     void Update();   
65     vtkRenderWindowInteractor* GetInteractor() { return mRenderWindowInteractor; }
66   private:
67     MIPViewer              *mBox;
68     vtkImageData           *mImageData;
69     
70     wxVTKRenderWindowInteractor  *mRenderWindowInteractor;
71
72     /*
73     vtkContourFilter* mContourFilter;
74     vtkSmoothPolyDataFilter* mSmoothPolyDataFilter;
75     vtkPolyDataNormals* mPolyDataNormals;
76     vtkPolyDataMapper* mPolyDataMapper;
77     */
78     vtkImageShiftScale* mCast;
79     vtkVolumeRayCastMIPFunction* mMIP;
80     vtkVolumeRayCastMapper* mMapper;
81
82     vtkVolume* mActor;
83     vtkCamera* mCamera;
84     vtkRenderer* mRenderer;
85     vtkRenderWindow* mRenderWindow;
86  };
87   
88   //------------------------------------------------------------------------
89   //------------------------------------------------------------------------
90   //------------------------------------------------------------------------
91   
92   class /*BBTK_EXPORT*/ MIPViewer : public bbtk::WxBlackBox
93   {    
94     BBTK_USER_BLACK_BOX_INTERFACE(MIPViewer,bbtk::WxBlackBox);
95     //    BBTK_DECLARE_INPUT(Contour,int);
96     BBTK_DECLARE_INPUT(In,vtkImageData *);
97     BBTK_DECLARE_INPUT(Shift,int);
98     BBTK_DECLARE_INPUT(Scale,float);
99     BBTK_DECLARE_OUTPUT(Interactor,vtkRenderWindowInteractor*);
100     BBTK_PROCESS(Process);
101     void Process();
102     BBTK_CREATE_WIDGET(CreateWidget);
103     void CreateWidget();
104   };
105    
106   //=================================================================
107   // UserBlackBox description
108   BBTK_BEGIN_DESCRIBE_BLACK_BOX(MIPViewer,bbtk::WxBlackBox);
109   BBTK_NAME("MIPViewer");
110   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
111   BBTK_DESCRIPTION("Maximum Intensity Projection (MIP) view of a 3D image");
112   BBTK_CATEGORY("viewer");
113   BBTK_INPUT(MIPViewer,Shift,"Gray scale shift",int);
114   BBTK_INPUT(MIPViewer,Scale,"Gray scale scaling",float);
115   BBTK_INPUT(MIPViewer,In,"Input Image",vtkImageData *);
116   BBTK_OUTPUT(MIPViewer,Interactor,"Interactor",vtkRenderWindowInteractor *);
117   BBTK_END_DESCRIBE_BLACK_BOX(MIPViewer);
118   //=================================================================
119
120
121 }//namespace bbwxvtk
122
123 #endif  //__bbtwxvtkMIPViewer_h__
124
125 #endif //_USE_VTK_
126 #endif //_USE_WXWIDGETS_