]> Creatis software - clitk.git/blob - vv/vvLandmarks.h
remove antique RCS headers
[clitk.git] / vv / vvLandmarks.h
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Pierre Seroul (pierre.seroul@gmail.com)
6
7 Copyright (C) 2008
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
10
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 =========================================================================*/
24 #ifndef vvLandmarks_h
25 #define vvLandmarks_h
26
27 #include <iostream>
28 #include <vector>
29
30 #include "vtkFloatArray.h"
31 #include "vtkPolyData.h"
32 #include "vtkPoints.h"
33 #include "vvLandmarksGlyph.h"
34
35 //typedef
36 struct vvLandmark {
37     float coordinates[4];
38     std::string comments;
39     double pixel_value;
40 };
41
42 class vvLandmarks
43 {
44 public :
45     vvLandmarks(int size);
46     ~vvLandmarks();
47
48     void LoadFile(std::string filename);
49     void SaveFile(std::string filename);
50
51     void AddLandmark(float x,float y,float z,float t,double value);
52     void RemoveLastLandmark();
53     void ChangeComments(int index, std::string comments);
54     float* GetCoordinates(int index);
55     double GetPixelValue(int index);
56     std::string GetComments(int index);
57     int GetNumberOfPoints() {
58         return mLandmarks.size();
59     }
60     //int GetNumberOfSources(){return mText.size();}
61
62     vtkPolyData* GetOutput() {
63         return mPolyData;
64     }
65     //vtkPolyData* GetSources(int i){return mText[i]->GetOutput();}
66     void SetTime(int time);
67
68     bool ErrorMsg(int num,const char * text);
69
70 private:
71     ///Helper function to tackle the use of the comma as the decimal separator
72     std::string replace_dots(std::string input);
73     std::vector<vvLandmark> mLandmarks;
74     vtkPolyData *mPolyData;
75     std::vector<vtkPoints*> mPoints;
76     vtkFloatArray* mIds;
77     //std::vector<vvLandmarksGlyph*> mText;
78     std::string mFilename;
79     int mFormatVersion;
80 };
81
82 #endif