1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 #ifndef __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
27 #define __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__
28 #include "bbtkAtomicBlackBox.h"
31 #include "Contour/ExtractControlPoints2D.h"
32 #include "Contour/ContourPropagation.h"
33 #include "Contour/Propagation.h"
35 #include "vtkImageData.h"
37 namespace bbcreaMaracasVisu
40 class /*BBTK_EXPORT*/ ContourToControlPoints
42 public bbtk::AtomicBlackBox
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*);
61 BBTK_PROCESS(Process);
67 ContourPropagation *_contprop;
68 PropContour *_propgdata;
69 ExtractControlPoints2D *_ext2D;
71 vtkImageData *_imagedata;
74 std::vector<double> OutContourX;
75 std::vector<double> OutContourY;
76 std::vector<double> OutContourZ;
78 std::vector<double> KeyContourX;
79 std::vector<double> KeyContourY;
80 std::vector<double> KeyContourZ;
81 std::vector<int> KeySizes;
84 std::vector<double> tempX;
85 std::vector<double> tempY;
86 std::vector<double> tempZ;
87 std::vector<int>::iterator it;
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,"");
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);
111 // EO namespace bbcreaMaracasVisu
113 #endif // __bbcreaMaracasVisuContourToControlPoints_h_INCLUDED__