FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
CardinalSplineModel.hpp
Go to the documentation of this file.
1 #ifndef CARDINAL_SPLINE_MODEL_HPP
2 #define CARDINAL_SPLINE_MODEL_HPP
3 
5 
6 namespace fast {
7 
8 class FAST_EXPORT CardinalSplineModel : public ShapeModel {
10  public:
11  Shape::pointer getShape(VectorXf state);
12  MatrixXf getStateTransitionMatrix1();
13  MatrixXf getStateTransitionMatrix2();
14  MatrixXf getStateTransitionMatrix3();
15  MatrixXf getProcessErrorMatrix();
16  VectorXf getInitialState(std::shared_ptr<Image> image);
17  std::vector<MatrixXf> getMeasurementVectors(VectorXf state, Shape::pointer shape);
18  void initializeShapeToImageCenter();
25  void setControlPoints(std::vector<Vector2f> controlPoints);
26  void setInitialScaling(float x, float y);
27  void setInitialRotation(float angleInRadians);
28  void setInitialTranslation(float x, float y);
29  void setLocalProcessError(float error);
30  void setGlobalProcessError(float error);
31  /*
32  * Set a single tension for all control points
33  */
34  void setTension(float tension);
35  /*
36  * Set the tension value for each control point. This vector has to be
37  * the same size as the number of control points.
38  */
39  void setTension(std::vector<float> tension);
40  void setResolution(int resolution);
41  VectorXf restrictState(VectorXf state);
42  /*
43  * Set min and max limit for scaling
44  */
45  void setScalingLimit(float min = -1, float max = -1);
46  private:
48  void assertControlPointsGiven();
49  void updateProcessErrorMatrix();
50  std::vector<Vector2f> getLocallyDeformedVertices(VectorXf state);
51  std::vector<float> getTensionVector(uint nrOfControlPoints) const;
52 
53  MatrixXf mA1;
54  MatrixXf mA2;
55  MatrixXf mA3;
56  MatrixXf mProcessErrorMatrix;
57  float mLocalProcessError;
58  float mGlobalProcessError;
59  VectorXf mInitialGlobalState;
60  int mStateSize;
61  int mResolution;
62  float mMinScaling, mMaxScaling;
63 
64  std::vector<Vector2f> mControlPoints;
65  float mGlobalTension;
66  std::vector<float> mTensionPerVertex;
67  Vector2f mCentroid;
68  bool mClockwise; // True if control points are in clockwise order
69 
70  bool mInitializeShapeToImageCenter;
71 
72 };
73 
74 }
75 
76 #endif
fast::ShapeModel
Definition: ShapeModel.hpp:16
fast
Definition: AffineTransformation.hpp:7
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::max
T max(T a, T b)
Definition: Utility.hpp:46
fast::Object::pointer
std::shared_ptr< Object > pointer
Definition: Object.hpp:36
fast::min
T min(T a, T b)
Definition: Utility.hpp:41
ShapeModel.hpp
fast::CardinalSplineModel
Definition: CardinalSplineModel.hpp:8
uint
unsigned int uint
Definition: DataTypes.hpp:16