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