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"
24 #include <vtkImageChangeInformation.h>
26 class KernelManagerContour{
28 //------------------------------------------------------------------------------------------------------------
29 // Constructors & Destructors
30 //------------------------------------------------------------------------------------------------------------
34 ** With this constructor the setVectImages and initialize environment must be called
36 KernelManagerContour();
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
41 KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir);
42 ~KernelManagerContour();
44 std::vector<vtkImageData*> getVectImages();
45 void setVectImages(std::vector<vtkImageData*> vectimg);
48 ** This method returns the source of the image data selected by the user.
50 vtkImageData* getSourceImage();
54 void initializeEnvironment(std::string datadir);
58 ** This methods connect the event in the class interfNewContourMenu with the world of the appli
61 std::string createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector);
62 /////////////////////////////////
64 std::string intToString(int num);
66 std::vector<std::string> GetLstNameThingsStatic();
68 void SaveThingName(FILE* pFile, FILE *pFileData, std::string name );
70 std::vector<std::string> GetLstNameThings();
72 bool IsPartOfStaticList(std::string keyName );
74 void deleteCModel(std::string theKeyName);
76 void removeAllOutlines();
78 //void setInstance(theInstant);
80 std::vector<NameWrapper *> getActualInstantOutlines();
82 int getNamesWrappingSize();
84 std::string getNameWrapping(int i);
86 void setInstant(Instant* theInstant);
87 void setInstant(std::vector<int> vectInstant);
88 std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
90 Instant * getCurrentInstant();
92 manualBaseModel* getOutlineByKeyName(std::string cloneName);
94 bool onRedo(std::string& filename);
96 bool onUndo(std::string& filename);
98 bool onUndoSaveFile(std::string& filename);
100 std::string saveState();
102 void changeContourOfManager(std::string keyName, Instant *instant);
106 std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
108 void getMaxMinZ(double *minZ,double *maxZ);
110 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);
113 // Method which creates the model associated with the type in parameter. The possible contour types are:
122 // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
123 // @param typeContour - int
124 // @return manualBaseModel - Model created based on the type
125 manualBaseModel* factoryManualContourModel(int typeContour);
127 void CalculeSplinePropagation();
129 std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
131 std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
133 std::vector<manualBaseModel*> ExploseEachModel( std::vector<manualBaseModel*> lstManConMod );
136 void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
138 vtkImageData* getImageAtInstant(std::vector<int> inst);
140 //------------------------------------------------------------------------------------------------------------
142 //------------------------------------------------------------------------------------------------------------
144 void setCurrentFileName(std::string filenam);
145 std::string getCurrentFileName();
147 //------------------------------------------------------------------------------------------------------------
149 //------------------------------------------------------------------------------------------------------------
150 std::vector<vtkImageData*> vectimages;
152 ImageSourceThing * imageSource;
154 //Instant * _actualInstant;
155 //Temporary attribute should be removed
156 OutlineModelManager * modelManager;
158 std::string filename;
163 std::string stundoredo;
165 ContourPropagation* _contourPropagation;
167 bool isInitContourPropagation();
169 OutlineModelManager* getOutlineModelManager();