00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00048 #ifdef _USE_VTK_
00049
00050
00051 #ifndef __vtkIsoSurfaceExtractor_h__
00052 #define __vtkIsoSurfaceExtractor_h__
00053
00054 #include "vtkImageData.h"
00055 #include "vtkRenderer.h"
00056 #include "vtkMarchingCubes.h"
00057 #include "vtkPolyDataMapper.h"
00058 #include "vtkProp3D.h"
00059 #include "vtkActor.h"
00060 #include <vector>
00061
00062 #include "bbtkAtomicBlackBox.h"
00063
00064 namespace bbvtk
00065 {
00066
00067 class IsoSurfaceExtractor
00068 :
00069 public bbtk::AtomicBlackBox
00070 {
00071 bool firsttime;
00072 vtkMarchingCubes *marchingcubes;
00073 vtkPolyDataMapper *polydatamapper;
00074 vtkActor *vtkactor;
00075
00076
00077 BBTK_BLACK_BOX_INTERFACE(IsoSurfaceExtractor,bbtk::AtomicBlackBox);
00078
00079 BBTK_DECLARE_INPUT(In,vtkImageData *);
00080
00081 BBTK_DECLARE_INPUT(Isovalue,double);
00082 BBTK_DECLARE_INPUT(Opacity,double);
00083 BBTK_DECLARE_INPUT(Colour,std::vector<double>);
00084 BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
00085 BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
00086
00087 BBTK_PROCESS(DoProcess);
00088 void DoProcess();
00089
00090 protected:
00091 virtual void bbUserConstructor();
00092 virtual void bbUserCopyConstructor();
00093 virtual void bbUserDestructor();
00094 void Init();
00095 };
00096
00097 BBTK_BEGIN_DESCRIBE_BLACK_BOX(IsoSurfaceExtractor,bbtk::AtomicBlackBox);
00098 BBTK_NAME("IsoSurfaceExtractor");
00099 BBTK_AUTHOR("eduardo.davila / laurent.guigues at creatis.insa-lyon.fr");
00100 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)");
00101 typedef std::vector<double> vectorcolour;
00102 BBTK_CATEGORY("3D object creator");
00103 BBTK_INPUT(IsoSurfaceExtractor,In,"Input image",vtkImageData*,"");
00104
00105
00106 BBTK_INPUT(IsoSurfaceExtractor,Isovalue,"Isovalue",double,"");
00107 BBTK_INPUT(IsoSurfaceExtractor,Opacity,"Opacity",double,"");
00108 BBTK_INPUT(IsoSurfaceExtractor,Colour,"r g b",vectorcolour,"colour");
00109 BBTK_INPUT(IsoSurfaceExtractor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,"");
00110 BBTK_OUTPUT(IsoSurfaceExtractor,Out,"Extracted iso-surface",vtkProp3D *,"");
00111
00112 BBTK_END_DESCRIBE_BLACK_BOX(IsoSurfaceExtractor);
00113
00114 }
00115
00116
00117 #endif //__IsoSurfaceExtractor_h__
00118
00119 #endif //_USE_VTK_
00120