]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/src/bbPackRecalageCalculateVectorBox.h
Feature #1766 Add licence terms for all files.
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageCalculateVectorBox.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Santé)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 #
8 #  This software is governed by the CeCILL-B license under French law and 
9 #  abiding by the rules of distribution of free software. You can  use, 
10 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
11 #  license as circulated by CEA, CNRS and INRIA at the following URL 
12 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
13 #  or in the file LICENSE.txt.
14 #
15 #  As a counterpart to the access to the source code and  rights to copy,
16 #  modify and redistribute granted by the license, users are provided only
17 #  with a limited warranty  and the software's author,  the holder of the
18 #  economic rights,  and the successive licensors  have only  limited
19 #  liability. 
20 #
21 #  The fact that you are presently reading this means that you have had
22 #  knowledge of the CeCILL-B license and that you accept its terms.
23 # ------------------------------------------------------------------------   
24 */
25
26
27 #ifndef __bbPackRecalageCalculateVectorBox_h_INCLUDED__
28 #define __bbPackRecalageCalculateVectorBox_h_INCLUDED__
29 #include "bbPackRecalage_EXPORT.h"
30 #include "bbtkAtomicBlackBox.h"
31 #include "iostream"
32
33 #include "PlanesOperations.h"
34
35 namespace bbPackRecalage
36 {
37
38 class bbPackRecalage_EXPORT CalculateVectorBox
39  : 
40    public bbtk::AtomicBlackBox
41 {
42   BBTK_BLACK_BOX_INTERFACE(CalculateVectorBox,bbtk::AtomicBlackBox);
43
44   /*Points in X for the first vector (the vector in the first image), this array should have the structure (a,b), "a" being the position in X for the starting point of the vector
45         and "b" the position in X for the ending point of the vector */
46   BBTK_DECLARE_INPUT(PointsX1,std::vector<int>);
47   
48   /*Points in X for the second vector (the vector in the second image), this array should have the structure (a,b), "a" being the position in X for the starting point of the vector
49         and "b" the position in X for the ending point of the vector */
50   BBTK_DECLARE_INPUT(PointsX2,std::vector<int>);
51
52   /*Points in Y for the first vector (the vector in the first image), this array should have the structure (a,b), "a" being the position in Y for the starting point of the vector
53         and "b" the position in Y for the ending point of the vector */
54   BBTK_DECLARE_INPUT(PointsY1,std::vector<int>);
55
56   /*Points in Y for the second vector (the vector in the second image), this array should have the structure (a,b), "a" being the position in Y for the starting point of the vector
57         and "b" the position in Y for the ending point of the vector */
58   BBTK_DECLARE_INPUT(PointsY2,std::vector<int>);
59
60   /*Points in Z for the first vector (the vector in the first image), this array should have the structure (a,b), "a" being the position in Z for the starting point of the vector
61         and "b" the position in Z for the ending point of the vector */
62   BBTK_DECLARE_INPUT(PointsZ1,std::vector<int>);
63
64   /*Points in Z for the second vector (the vector in the second image), this array should have the structure (a,b), "a" being the position in Z for the starting point of the vector
65         and "b" the position in Z for the ending point of the vector */
66   BBTK_DECLARE_INPUT(PointsZ2,std::vector<int>);
67
68   /*Origin (starting point of the vector) of the second image, this is necesary for the translation matrix of a transform filter*/
69   BBTK_DECLARE_OUTPUT(Origin, std::vector<int>);
70
71   /*Origin (starting point of the vector) of the first image, this is necesary for the imageReslicer filter*/
72   BBTK_DECLARE_OUTPUT(OriginReslicer, std::vector<int>);
73   
74   /*The rotation axis (this axis is defined by the cross product of the 2 vectors)*/
75   BBTK_DECLARE_OUTPUT(TransformAxis, std::vector<double>);
76
77   /*Scale difference in X*/
78   BBTK_DECLARE_OUTPUT(OutScaleX,int);
79
80   /*Scale difference in Y*/
81   BBTK_DECLARE_OUTPUT(OutScaleY,int);
82
83   /*Scale difference in Z*/
84   BBTK_DECLARE_OUTPUT(OutScaleZ,int);
85
86   /*Rotation Angle*/
87   BBTK_DECLARE_OUTPUT(OutAngle,double);
88   BBTK_PROCESS(Process);
89   void Process();
90
91   private:
92           
93           PlanesOperations *_vector;
94 };
95
96 BBTK_BEGIN_DESCRIBE_BLACK_BOX(CalculateVectorBox,bbtk::AtomicBlackBox);
97 BBTK_NAME("CalculateVectorBox");
98 BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
99 BBTK_DESCRIPTION("Box for calculating the cross and point multiplications of 2 vectors");
100 BBTK_CATEGORY("__CATEGORY__");
101 BBTK_INPUT(CalculateVectorBox,PointsX1,"List of points in X for the first vector",std::vector<int>,"");
102 BBTK_INPUT(CalculateVectorBox,PointsX2,"List of points in X for the second vector",std::vector<int>,"");
103 BBTK_INPUT(CalculateVectorBox,PointsY1,"List of points in Y for the first vector",std::vector<int>,"");
104 BBTK_INPUT(CalculateVectorBox,PointsY2,"List of points in Y for the second vector",std::vector<int>,"");
105 BBTK_INPUT(CalculateVectorBox,PointsZ1,"List of points in Z for the first vector",std::vector<int>,"");
106 BBTK_INPUT(CalculateVectorBox,PointsZ2,"List of points in Z for the second vector",std::vector<int>,"");
107 BBTK_OUTPUT(CalculateVectorBox,Origin,"Points of Origin for the transformation",std::vector<int>,"");
108 BBTK_OUTPUT(CalculateVectorBox,OriginReslicer,"Points of Origin for the transformation for the Reslicer",std::vector<int>,"");
109 BBTK_OUTPUT(CalculateVectorBox,TransformAxis,"Axis used for the transformation (Result of Cross multiplication)",std::vector<double>,"");
110 BBTK_OUTPUT(CalculateVectorBox,OutScaleX,"Difference in scale for X for the cross multiplication",int,"");
111 BBTK_OUTPUT(CalculateVectorBox,OutScaleY,"Difference in scale for Y for the cross multiplication",int,"");
112 BBTK_OUTPUT(CalculateVectorBox,OutScaleZ,"Difference in scale for Z for the cross multiplication",int,"");
113 BBTK_OUTPUT(CalculateVectorBox,OutAngle,"Angle that represents the dot multiplication",double,"");
114 BBTK_END_DESCRIBE_BLACK_BOX(CalculateVectorBox);
115 }
116 // EO namespace bbPackRecalage
117
118 #endif // __bbPackRecalageCalculateVectorBox_h_INCLUDED__
119