00001 #ifndef __Propagation_h_INCLUDED__
00002 #define __Propagation_h_INCLUDED__
00003
00004 #include "vtkImageData.h"
00005
00006
00007
00008
00009
00010 #include "marTypes.h"
00011 #include "manualContourModel.h"
00012 #include "time.h"
00013 #include <wx/wx.h>
00014
00015 class Vector
00016 {
00017 public:
00018 Vector ();
00019 ~Vector ();
00020 void set_vec ( double val );
00021 void set_var ( double val );
00022 double get_vec ( int id );
00023 double get_var ( );
00024 int getsize_vec ( );
00025 void copyVector ( std::vector<Vector>*vec1, std::vector<Vector>*vec2 );
00026 void printVector ( std::vector<Vector>*vec1 );
00027 void set_x ( double val );
00028 void set_y ( double val );
00029 void set_z ( double val );
00030 void set_plane ( int val );
00031 double get_x ( int id );
00032 int getsize_x ( );
00033 double get_y ( int id );
00034 int getsize_y ( );
00035 double get_z ( int id );
00036 int getsize_z ( );
00037 int get_plane ( );
00038 void resetVec ( );
00039 std::vector<double> getVec();
00040
00041 private:
00042 double _var;
00043 int _plane;
00044 std::vector<double> _vec;
00045 std::vector<double> _vecX;
00046 std::vector<double> _vecY;
00047 std::vector<double> _vecZ;
00048 };
00049
00050 class creaMaracasVisu_EXPORT PropContour
00051 {
00052 public:
00053 PropContour();
00054 ~PropContour();
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 int VectorDirection ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
00066 void VectorOrder ( int dir, int posinic, std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ);
00067 void ReadKeyContour ( FILE* fd );
00068 void ResetKeyContours ( );
00069 void SetKeyContours ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
00070 vtkImageData* CalculeSplinePropagation ( );
00071 void GetKeyContours ( std::vector<double>*KeyX, std::vector<double>*KeyY, std::vector<double>*KeyZ, std::vector<int>*KeyS );
00072 void GetPropagatedContours ( std::vector<Vector>*planevec );
00073 void GetIdContour ( int id, std::vector<double>*vecX, std::vector<double>*vecY, std::vector<double>*vecZ );
00074 void SetInterpNumber ( int val );
00075 int FindIdWithZ ( double z );
00076
00077 private:
00078
00079
00080
00081
00082
00083
00084
00085 void PreparePointsForSpline ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ, std::vector<int>*Sizes );
00086 vtkImageData* method_Spline ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ, std::vector<int>*Sizes );
00087 void ResetPlaneVector();
00088
00089 int _interpnumber;
00090
00091 int _dimImage[3];
00092 vtkImageData *imagedataValue;
00093 manualContourModel *_mContourModel;
00094
00095 std::vector<double> _KeyContourX;
00096 std::vector<double> _KeyContourY;
00097 std::vector<double> _KeyContourZ;
00098 std::vector<int> _KeyContourSizes;
00099
00100 std::vector<Vector> _planevector;
00101 };
00102 #endif // __Propagation_h_INCLUDED__
00103
00104