]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuContourToControlPoints.h
#3262 creaMaracasVisu Feature New Normal - Export LookupTable fron ColorLayerImageV...
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuContourToControlPoints.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #ifndef __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
27 #define __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
28 #include "bbtkAtomicBlackBox.h"
29 #include "iostream"
30
31 #include "Contour/ExtractControlPoints2D.h"
32 #include "Contour/ContourPropagation.h"
33 #include "Contour/Propagation.h"
34
35 #include "vtkImageData.h"
36
37 namespace bbcreaMaracasVisu
38 {
39
40 class /*BBTK_EXPORT*/ ContourToControlPoints
41  : 
42    public bbtk::AtomicBlackBox
43 {
44         //BBTK_USER_BLACK_BOX_INTERFACE(ContourToControlPoints,bbtk::AtomicBlackBox);
45         BBTK_BLACK_BOX_INTERFACE(ContourToControlPoints,bbtk::AtomicBlackBox);
46   BBTK_DECLARE_INPUT(In,double);
47                 BBTK_DECLARE_INPUT(Sampling, double);
48                 BBTK_DECLARE_INPUT(Slice,int);
49                 BBTK_DECLARE_INPUT(InContourX, std::vector<double>*);
50                 BBTK_DECLARE_INPUT(InContourY, std::vector<double>*);
51                 BBTK_DECLARE_INPUT(InContourZ, std::vector<double>*);
52                 BBTK_DECLARE_INPUT(RadRBF, double);
53                 BBTK_DECLARE_INPUT(Option, int);
54                 BBTK_DECLARE_INPUT(LoadContour, int);
55   BBTK_DECLARE_OUTPUT(Out,double);
56                 BBTK_DECLARE_OUTPUT(ControlPointX, std::vector<double>*);
57                 BBTK_DECLARE_OUTPUT(ControlPointY, std::vector<double>*);
58                 BBTK_DECLARE_OUTPUT(ControlPointZ, std::vector<double>*);
59                 BBTK_DECLARE_OUTPUT(ImagePropg, vtkImageData*);
60
61   BBTK_PROCESS(Process);
62   void Process();
63   private:
64                         int pos;
65                         bool inic;
66                         
67                         ContourPropagation              *_contprop;
68                         PropContour                             *_propgdata;
69                         ExtractControlPoints2D  *_ext2D;
70
71                         vtkImageData                    *_imagedata;
72                         FILE                                    *_fd;
73                         
74                         std::vector<double> OutContourX;
75                         std::vector<double> OutContourY;
76                         std::vector<double> OutContourZ;
77
78                         std::vector<double> KeyContourX;
79                         std::vector<double> KeyContourY;
80                         std::vector<double> KeyContourZ;
81                         std::vector<int> KeySizes;
82                         
83                         //TEMP DATA
84                         std::vector<double> tempX;
85                         std::vector<double> tempY;
86                         std::vector<double> tempZ;
87                         std::vector<int>::iterator it;
88   
89 };
90
91 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ContourToControlPoints,bbtk::AtomicBlackBox);
92 BBTK_NAME("ContourToControlPoints");
93 BBTK_AUTHOR("Juan Sebasltian Torres");
94 BBTK_DESCRIPTION("Generates the control points of a contour");
95 BBTK_CATEGORY("filter");
96    BBTK_INPUT(ContourToControlPoints,Sampling,"Sampling (in %) to obtain the control points",double,"");
97    BBTK_INPUT(ContourToControlPoints,Slice,"Slice Number Propagation",int,"");
98    BBTK_INPUT(ContourToControlPoints,InContourX,"Coordinate X of a Contour",std::vector<double>*,"");
99    BBTK_INPUT(ContourToControlPoints,InContourY,"Coordinate Y of a Contour",std::vector<double>*,"");
100    BBTK_INPUT(ContourToControlPoints,InContourZ,"Coordinate Z of a Contour",std::vector<double>*,"");
101    BBTK_INPUT(ContourToControlPoints,RadRBF,"Radius of th RBF method",double,"");
102    BBTK_INPUT(ContourToControlPoints,Option,"1 -> Control Points || 2 -> Propagation",int,"");
103    BBTK_INPUT(ContourToControlPoints,LoadContour,"1 -> Load Saved Manual Points",int,"");
104 //THE OUTPUTS
105    BBTK_OUTPUT(ContourToControlPoints,ControlPointX,"Processed Coordinate X of the Boundary",std::vector<double>*,"");
106    BBTK_OUTPUT(ContourToControlPoints,ControlPointY,"Processed Coordinate Y of the Boundary",std::vector<double>*,"");
107    BBTK_OUTPUT(ContourToControlPoints,ControlPointZ,"Processed Coordinate Z of the Boundary",std::vector<double>*,"");
108    BBTK_OUTPUT(ContourToControlPoints,ImagePropg,"vtkImageData of the propagation image-3D",vtkImageData*,"");
109 BBTK_END_DESCRIBE_BLACK_BOX(ContourToControlPoints);
110 }
111 // EO namespace bbcreaMaracasVisu
112
113 #endif // __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
114