]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuContourToControlPoints.h
.
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuContourToControlPoints.h
1 #ifndef __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
2 #define __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
3 #include "bbtkAtomicBlackBox.h"
4 #include "iostream"
5
6 #include "Contour/ExtractControlPoints2D.h"
7 #include "Contour/ContourPropagation.h"
8 #include "Contour/Propagation.h"
9
10 #include "vtkImageData.h"
11
12 namespace bbcreaMaracasVisu
13 {
14
15 class /*BBTK_EXPORT*/ ContourToControlPoints
16  : 
17    public bbtk::AtomicBlackBox
18 {
19         //BBTK_USER_BLACK_BOX_INTERFACE(ContourToControlPoints,bbtk::AtomicBlackBox);
20         BBTK_BLACK_BOX_INTERFACE(ContourToControlPoints,bbtk::AtomicBlackBox);
21   BBTK_DECLARE_INPUT(In,double);
22                 BBTK_DECLARE_INPUT(Sampling, double);
23                 BBTK_DECLARE_INPUT(Slice,int);
24                 BBTK_DECLARE_INPUT(InContourX, std::vector<double>*);
25                 BBTK_DECLARE_INPUT(InContourY, std::vector<double>*);
26                 BBTK_DECLARE_INPUT(InContourZ, std::vector<double>*);
27                 BBTK_DECLARE_INPUT(RadRBF, double);
28                 BBTK_DECLARE_INPUT(Option, int);
29                 BBTK_DECLARE_INPUT(LoadContour, int);
30   BBTK_DECLARE_OUTPUT(Out,double);
31                 BBTK_DECLARE_OUTPUT(ControlPointX, std::vector<double>*);
32                 BBTK_DECLARE_OUTPUT(ControlPointY, std::vector<double>*);
33                 BBTK_DECLARE_OUTPUT(ControlPointZ, std::vector<double>*);
34                 BBTK_DECLARE_OUTPUT(ImagePropg, vtkImageData*);
35
36   BBTK_PROCESS(Process);
37   void Process();
38   private:
39                         int pos;
40                         bool inic;
41                         
42                         ContourPropagation              *_contprop;
43                         PropContour                             *_propgdata;
44                         ExtractControlPoints2D  *_ext2D;
45
46                         vtkImageData                    *_imagedata;
47                         FILE                                    *_fd;
48                         
49                         std::vector<double> OutContourX;
50                         std::vector<double> OutContourY;
51                         std::vector<double> OutContourZ;
52
53                         std::vector<double> KeyContourX;
54                         std::vector<double> KeyContourY;
55                         std::vector<double> KeyContourZ;
56                         std::vector<int> KeySizes;
57                         
58                         //TEMP DATA
59                         std::vector<double> tempX;
60                         std::vector<double> tempY;
61                         std::vector<double> tempZ;
62                         std::vector<int>::iterator it;
63   
64 };
65
66 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ContourToControlPoints,bbtk::AtomicBlackBox);
67 BBTK_NAME("ContourToControlPoints");
68 BBTK_AUTHOR("Juan Sebasltian Torres");
69 BBTK_DESCRIPTION("Generates the control points of a contour");
70 BBTK_CATEGORY("filter");
71    BBTK_INPUT(ContourToControlPoints,Sampling,"Sampling (in %) to obtain the control points",double,"");
72    BBTK_INPUT(ContourToControlPoints,Slice,"Slice Number Propagation",int,"");
73    BBTK_INPUT(ContourToControlPoints,InContourX,"Coordinate X of a Contour",std::vector<double>*,"");
74    BBTK_INPUT(ContourToControlPoints,InContourY,"Coordinate Y of a Contour",std::vector<double>*,"");
75    BBTK_INPUT(ContourToControlPoints,InContourZ,"Coordinate Z of a Contour",std::vector<double>*,"");
76    BBTK_INPUT(ContourToControlPoints,RadRBF,"Radius of th RBF method",double,"");
77    BBTK_INPUT(ContourToControlPoints,Option,"1 -> Control Points || 2 -> Propagation",int,"");
78    BBTK_INPUT(ContourToControlPoints,LoadContour,"1 -> Load Saved Manual Points",int,"");
79 //THE OUTPUTS
80    BBTK_OUTPUT(ContourToControlPoints,ControlPointX,"Processed Coordinate X of the Boundary",std::vector<double>*,"");
81    BBTK_OUTPUT(ContourToControlPoints,ControlPointY,"Processed Coordinate Y of the Boundary",std::vector<double>*,"");
82    BBTK_OUTPUT(ContourToControlPoints,ControlPointZ,"Processed Coordinate Z of the Boundary",std::vector<double>*,"");
83    BBTK_OUTPUT(ContourToControlPoints,ImagePropg,"vtkImageData of the propagation image-3D",vtkImageData*,"");
84 BBTK_END_DESCRIBE_BLACK_BOX(ContourToControlPoints);
85 }
86 // EO namespace bbcreaMaracasVisu
87
88 #endif // __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
89