]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkIsoSurfaceExtractor.h
*** empty log message ***
[bbtk.git] / packages / vtk / src / bbvtkIsoSurfaceExtractor.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbvtkIsoSurfaceExtractor.h,v $
5   Language:  C++
6   Date:      $Date: 2008/05/09 10:39:47 $
7   Version:   $Revision: 1.8 $
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_VTK_
34
35
36 #ifndef __vtkIsoSurfaceExtractor_h__
37 #define __vtkIsoSurfaceExtractor_h__
38
39 #include "vtkImageData.h"
40 #include "vtkRenderer.h"
41 #include "vtkMarchingCubes.h"
42 #include "vtkPolyDataMapper.h"
43 #include "vtkProp3D.h"
44 #include "vtkActor.h"
45 #include <vector>
46
47 #include "bbtkAtomicBlackBox.h"
48
49 namespace bbvtk
50 {
51   
52   class /*BBTK_EXPORT*/ IsoSurfaceExtractor
53     : 
54     public bbtk::AtomicBlackBox
55   {
56     bool              firsttime;
57     vtkMarchingCubes  *marchingcubes;
58     vtkPolyDataMapper *polydatamapper;
59     vtkActor          *vtkactor; 
60     
61     
62     BBTK_BLACK_BOX_INTERFACE(IsoSurfaceExtractor,bbtk::AtomicBlackBox);
63     
64     BBTK_DECLARE_INPUT(In,vtkImageData *);
65     //    BBTK_DECLARE_INPUT(InVtkObject,vtkObject *);
66     BBTK_DECLARE_INPUT(Isovalue,double);
67     BBTK_DECLARE_INPUT(Opacity,double);
68     BBTK_DECLARE_INPUT(Colour,std::vector<double>);
69     BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
70     BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
71     
72     BBTK_PROCESS(DoProcess);
73     void DoProcess();
74     
75   protected:
76     virtual void bbUserConstructor();
77     virtual void bbUserCopyConstructor();
78     virtual void bbUserDestructor();
79     void Init();
80   };
81   
82   BBTK_BEGIN_DESCRIBE_BLACK_BOX(IsoSurfaceExtractor,bbtk::AtomicBlackBox);
83   BBTK_NAME("IsoSurfaceExtractor");
84   BBTK_AUTHOR("eduardo.davila / laurent.guigues at creatis.insa-lyon.fr");
85   BBTK_DESCRIPTION("Extracts an iso-surface of a 3D image and creates a vtkProp3D object to insert into a 3D scene (e.g. a Viewer3D)");
86   typedef std::vector<double> vectorcolour;
87   BBTK_CATEGORY("3D object creator");
88   BBTK_INPUT(IsoSurfaceExtractor,In,"Input image",vtkImageData*,"");
89   //  BBTK_INPUT(IsoSurfaceExtractor,InVtkObject,"Image vtkObject",vtkObject*);
90
91   BBTK_INPUT(IsoSurfaceExtractor,Isovalue,"Isovalue",double,"");
92   BBTK_INPUT(IsoSurfaceExtractor,Opacity,"Opacity",double,"");
93   BBTK_INPUT(IsoSurfaceExtractor,Colour,"r g b",vectorcolour,"colour");
94   BBTK_INPUT(IsoSurfaceExtractor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,"");
95   BBTK_OUTPUT(IsoSurfaceExtractor,Out,"Extracted iso-surface",vtkProp3D *,"");
96   
97   BBTK_END_DESCRIBE_BLACK_BOX(IsoSurfaceExtractor);
98   
99 }// EO namespace bbtk
100
101
102 #endif  //__IsoSurfaceExtractor_h__
103
104 #endif //_USE_VTK_
105