1 #ifndef __KERNELMANAGERCONTOUR__
2 #define __KERNELMANAGERCONTOUR__
6 //------------------------------------------------------------------------------------------------------------
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"
17 #include "ContourPropagation.h"
19 #include "manualContourModel.h"
20 #include "manualContourModelCircle.h"
21 #include "manualContourModelLine.h"
22 #include "manualContourModelRoi.h"
23 #include "manualContourModelPolygon.h"
25 #include <vtkImageChangeInformation.h>
27 class KernelManagerContour{
29 //------------------------------------------------------------------------------------------------------------
30 // Constructors & Destructors
31 //------------------------------------------------------------------------------------------------------------
35 ** With this constructor the setVectImages and initialize environment must be called
37 KernelManagerContour();
39 ** If images are available before the construction of the kernelManager this method should be used
40 ** it sets the vector images and initializes the environment
42 KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir);
43 ~KernelManagerContour();
45 std::vector<vtkImageData*> getVectImages();
46 void setVectImages(std::vector<vtkImageData*> vectimg);
49 ** This method returns the source of the image data selected by the user.
51 vtkImageData* getSourceImage();
55 void initializeEnvironment(std::string datadir);
59 ** This methods connect the event in the class interfNewContourMenu with the world of the appli
62 std::string createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector);
63 /////////////////////////////////
65 std::string intToString(int num);
67 std::vector<std::string> GetLstNameThingsStatic();
69 void SaveThingName(FILE* pFile, FILE *pFileData, std::string name );
71 std::vector<std::string> GetLstNameThings();
73 bool IsPartOfStaticList(std::string keyName );
75 void deleteCModel(std::string theKeyName);
77 void removeAllOutlines();
79 //void setInstance(theInstant);
81 std::vector<NameWrapper *> getActualInstantOutlines();
83 int getNamesWrappingSize();
85 std::string getNameWrapping(int i);
87 void setInstant(Instant* theInstant);
88 void setInstant(std::vector<int> vectInstant);
89 std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
91 Instant * getCurrentInstant();
93 manualBaseModel* getOutlineByKeyName(std::string cloneName);
95 bool onRedo(std::string& filename);
97 bool onUndo(std::string& filename);
99 bool onUndoSaveFile(std::string& filename);
101 std::string saveState();
103 void changeContourOfManager(std::string keyName, Instant *instant);
107 std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
109 void getMaxMinZ(double *minZ,double *maxZ);
111 manualBaseModel* 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);
114 // Method which creates the model associated with the type in parameter. The possible contour types are:
123 // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
124 // @param typeContour - int
125 // @return manualBaseModel - Model created based on the type
126 manualBaseModel* factoryManualContourModel(int typeContour);
128 void CalculeSplinePropagation();
130 std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
132 std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
134 std::vector<manualBaseModel*> ExploseEachModel( std::vector<manualBaseModel*> lstManConMod );
137 void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
139 vtkImageData* getImageAtInstant(std::vector<int> inst);
141 //------------------------------------------------------------------------------------------------------------
143 //------------------------------------------------------------------------------------------------------------
145 void setCurrentFileName(std::string filenam);
146 std::string getCurrentFileName();
148 //------------------------------------------------------------------------------------------------------------
150 //------------------------------------------------------------------------------------------------------------
151 std::vector<vtkImageData*> vectimages;
153 ImageSourceThing * imageSource;
155 //Instant * _actualInstant;
156 //Temporary attribute should be removed
157 OutlineModelManager * modelManager;
159 std::string filename;
164 std::string stundoredo;
166 ContourPropagation* _contourPropagation;
168 bool isInitContourPropagation();
170 OutlineModelManager* getOutlineModelManager();