]> Creatis software - bbtk.git/blob - packages/itkvtk/src/bbitkvtkGeodesicMeshDeformation.h
#3501 Geodesic Deformation
[bbtk.git] / packages / itkvtk / src / bbitkvtkGeodesicMeshDeformation.h
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #ifndef __bbitkvtkGeodesicMeshDeformation_h_INCLUDED__
5 #define __bbitkvtkGeodesicMeshDeformation_h_INCLUDED__
6
7 #include "bbitkvtk_EXPORT.h"
8 #include "bbtkAtomicBlackBox.h"
9 #include "iostream"
10
11 #include "vtkPolyData.h"
12 #include "itkQuadEdgeMesh.h"
13 #include "itkFastMarchingThresholdStoppingCriterion.h"
14 //#include "itkFastMarchingQuadEdgeMeshFilterBase.h"
15 #include "itkFastMarchingQuadEdgeMeshFilterResultsBase.h"
16
17 namespace bbitkvtk
18 {
19
20 class bbitkvtk_EXPORT GeodesicMeshDeformation
21  : 
22    public bbtk::AtomicBlackBox
23 {
24   BBTK_BLACK_BOX_INTERFACE(GeodesicMeshDeformation,bbtk::AtomicBlackBox);
25 //===== 
26 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
27 //===== 
28   BBTK_DECLARE_INPUT(Active, bool);
29   BBTK_DECLARE_INPUT(TypeIn, int);
30   BBTK_DECLARE_INPUT(In,vtkPolyData*);
31   BBTK_DECLARE_INPUT(EdgeId, long);
32   BBTK_DECLARE_INPUT(S, double);
33   BBTK_DECLARE_INPUT(Center, std::vector<double>);
34   BBTK_DECLARE_INPUT(Direction, std::vector<double>);
35   BBTK_DECLARE_OUTPUT(Out, std::vector<double>);
36   BBTK_PROCESS(Process);
37   void Process();
38   
39   using MeshType = itk::QuadEdgeMesh<double, 3>;
40   
41   //This is not the FastMarchingQuadEdge filter from ITK, this is a modified version to increase performance in our use
42   using FastMarchingType = itk::FastMarchingQuadEdgeMeshFilterResultsBase<MeshType, MeshType>;
43   
44         long                                                                    EdgeIdBack;
45         std::vector<int>                                        voiIdPoints;
46         std::vector<double>                                     backLstCenter;
47         vtkPolyData                                                     *polydata;
48         MeshType::Pointer                                               quadEdgeMesh;
49         double                                                                  sCurrent;
50         FastMarchingType::Pointer                               fmmFilter;
51         bool                                                                    firstTime;
52 //===== 
53 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
54 //===== 
55 };
56
57 BBTK_BEGIN_DESCRIBE_BLACK_BOX(GeodesicMeshDeformation,bbtk::AtomicBlackBox);
58 BBTK_NAME("GeodesicMeshDeformation");
59 BBTK_AUTHOR("InfoDev");
60 BBTK_DESCRIPTION("No Description.");
61 BBTK_CATEGORY("empty");
62 BBTK_INPUT(GeodesicMeshDeformation,Active,"(default true) true/false",bool,"");
63 BBTK_INPUT(GeodesicMeshDeformation,TypeIn,"(default 0) 0:Direction  1:Center",int,"");
64 BBTK_INPUT(GeodesicMeshDeformation,In,"vtk PolyData",vtkPolyData*,"");
65 BBTK_INPUT(GeodesicMeshDeformation,EdgeId,"Edge Id",long,"");
66 BBTK_INPUT(GeodesicMeshDeformation,S,"Deformation",double,"");
67 BBTK_INPUT(GeodesicMeshDeformation,Center,"[X,Y,Z]",std::vector<double>,"");
68 BBTK_INPUT(GeodesicMeshDeformation,Direction,"(default [1,0,0])   [X,Y,Z]",std::vector<double>,"");
69 BBTK_OUTPUT(GeodesicMeshDeformation,Out,"double vector output, for output information for other tools",std::vector<double>,"");
70 BBTK_END_DESCRIBE_BLACK_BOX(GeodesicMeshDeformation);
71 //===== 
72 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
73 //===== 
74 }
75 // EO namespace bbitkvtk
76
77 #endif // __bbitkvtkGeodesicMeshDeformation_h_INCLUDED__
78