]> Creatis software - clitk.git/blob - vv/vvLandmarks.h
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / vv / vvLandmarks.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef vvLandmarks_h
19 #define vvLandmarks_h
20 #include <iostream>
21 #include <vector>
22
23 #include "vtkFloatArray.h"
24 #include "vtkPolyData.h"
25 #include "vtkPoints.h"
26 #include "vvLandmarksGlyph.h"
27
28 //typedef
29 struct vvLandmark {
30     float coordinates[4];
31     std::string comments;
32     double pixel_value;
33 };
34
35 class vvLandmarks
36 {
37 public :
38     vvLandmarks(int size);
39     ~vvLandmarks();
40
41     void LoadFile(std::string filename);
42     void SaveFile(std::string filename);
43
44     void AddLandmark(float x,float y,float z,float t,double value);
45     void RemoveLastLandmark();
46     void RemoveLandmark(int index);
47     void ChangeComments(int index, std::string comments);
48     float* GetCoordinates(int index);
49     double GetPixelValue(int index);
50     std::string GetComments(int index);
51     unsigned int GetNumberOfPoints() { return (unsigned int) mLandmarks.size(); }
52     //int GetNumberOfSources(){return mText.size();}
53
54     vtkPolyData* GetOutput() {
55         return mPolyData;
56     }
57     //vtkPolyData* GetSources(int i){return mText[i]->GetOutput();}
58     void SetTime(int time);
59
60     bool ErrorMsg(int num,const char * text);
61
62 private:
63     ///Helper function to tackle the use of the comma as the decimal separator
64     std::string replace_dots(std::string input);
65     std::vector<vvLandmark> mLandmarks;
66     vtkPolyData *mPolyData;
67     std::vector<vtkPoints*> mPoints;
68     vtkFloatArray* mIds;
69     //std::vector<vvLandmarksGlyph*> mText;
70     std::string mFilename;
71     int mFormatVersion;
72 };
73
74 #endif