]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h
023846c7164fbce76065d74f40b6253f6e440976
[creaContours.git] / lib / kernel_ManagerContour_NDimensions / KernelManagerContour.h
1 #ifndef __KERNELMANAGERCONTOUR__
2 #define __KERNELMANAGERCONTOUR__
3
4
5
6 //------------------------------------------------------------------------------------------------------------
7 // Includes
8 //------------------------------------------------------------------------------------------------------------
9 //#include "ImageSourceThing.h"
10 //#include "ImageSectionThing.h"
11 //#include "AxeThing.h"
12 //#include "ContourThing.h"
13 #include "OutlineModelManager.h"
14 #include "OutlineModelBuilder.h"
15 #include "time.h"
16
17 #include "ContourPropagation.h"
18
19 #include "manualContourModel.h"
20 #include "manualContourModelCircle.h"
21 #include "manualContourModelLine.h"
22 #include "manualContourModelRoi.h"
23
24 #include <vtkImageChangeInformation.h>
25
26 class KernelManagerContour{
27
28 //------------------------------------------------------------------------------------------------------------
29 // Constructors & Destructors
30 //------------------------------------------------------------------------------------------------------------
31 public:
32
33         /**
34         ** With this constructor the setVectImages and initialize environment must be called
35         **/
36         KernelManagerContour();
37         /**
38         **      If images are available before the construction of the kernelManager this method should be used
39         **      it sets the vector images and initializes the environment
40         **/
41         KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir);
42         ~KernelManagerContour();
43
44         std::vector<vtkImageData*> getVectImages();
45         void setVectImages(std::vector<vtkImageData*> vectimg);
46
47         /**
48         **      This method returns the source of the image data selected by the user.
49         */
50         vtkImageData* getSourceImage();
51
52         
53
54         void initializeEnvironment(std::string datadir);
55
56
57         /**
58         **      This methods connect the event in the class interfNewContourMenu with the world of the appli
59         **/     
60
61         std::string createOutline(manualContourModel * manModelContour,std::vector<int> instantVector);
62         /////////////////////////////////
63
64         std::string intToString(int num);
65
66         std::vector<std::string> GetLstNameThingsStatic();
67
68         void SaveThingName(FILE* pFile, std::string name );
69
70         std::vector<std::string> GetLstNameThings();
71
72         bool IsPartOfStaticList(std::string keyName );
73
74         void deleteCModel(std::string theKeyName);
75
76         void removeAllOutlines();
77
78         //void setInstance(theInstant);
79
80         std::vector<NameWrapper *> getActualInstantOutlines();
81
82         int getNamesWrappingSize();
83
84         std::string getNameWrapping(int i);
85
86         void setInstant(Instant* theInstant);
87         void setInstant(std::vector<int> vectInstant);
88         std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
89         
90         Instant * getCurrentInstant();
91
92         manualContourModel* getOutlineByKeyName(std::string cloneName);
93
94         bool onRedo(std::string& filename);
95
96         bool onUndo(std::string& filename);
97
98         bool onUndoSaveFile(std::string& filename);
99
100         std::string saveState();
101
102         void changeContourOfManager(std::string keyName, Instant *instant);
103
104         void resetAppend();
105
106         std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
107
108         void getMaxMinZ(double *minZ,double *maxZ);
109
110         manualContourModel* GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector);
111
112         manualContourModel* factoryManualContourModel(int typeContour);
113
114         void CalculeSplinePropagation();
115
116         std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
117
118         std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
119
120         std::vector<manualContourModel*> ExploseEachModel( std::vector<manualContourModel*> lstManConMod );
121
122         
123         void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
124
125         vtkImageData* getImageAtInstant(std::vector<int> inst);
126         
127 //------------------------------------------------------------------------------------------------------------
128 // Constants
129 //------------------------------------------------------------------------------------------------------------
130
131         void setCurrentFileName(std::string filenam);
132         std::string getCurrentFileName();
133 private:        
134 //------------------------------------------------------------------------------------------------------------
135 // Attributes
136 //------------------------------------------------------------------------------------------------------------
137         std::vector<vtkImageData*> vectimages;
138
139         ImageSourceThing                * imageSource;
140
141         //Instant * _actualInstant;
142 //Temporary attribute should be removed
143         OutlineModelManager             * modelManager;
144
145         std::string filename;
146
147         int inredo;
148         int inundo;
149         int _currentIndex;
150         std::string     stundoredo;
151
152         ContourPropagation* _contourPropagation;
153
154         bool isInitContourPropagation();
155
156         OutlineModelManager* getOutlineModelManager();
157 };
158 #endif