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"
16 #ifdef ParserOsirix_BUILD
17 #include "OsirixParser.h"
19 #include "ContourPropagation.h"
21 #include "manualContourModel.h"
22 #include "manualContourModelCircle.h"
23 #include "manualContourModelLine.h"
24 #include "manualContourModelRoi.h"
25 #include "manualContourModelPolygon.h"
27 #include <vtkImageChangeInformation.h>
29 class KernelManagerContour{
31 //------------------------------------------------------------------------------------------------------------
32 // Constructors & Destructors
33 //------------------------------------------------------------------------------------------------------------
37 ** With this constructor the setVectImages and initialize environment must be called
39 KernelManagerContour();
41 ** If images are available before the construction of the kernelManager this method should be used
42 ** it sets the vector images and initializes the environment
44 KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir);
45 ~KernelManagerContour();
47 std::vector<vtkImageData*> getVectImages();
48 void setVectImages(std::vector<vtkImageData*> vectimg);
51 ** This method returns the source of the image data selected by the user.
53 vtkImageData* getSourceImage();
57 void initializeEnvironment(std::string datadir);
61 ** This methods connect the event in the class interfNewContourMenu with the world of the appli
64 std::string createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector);
65 /////////////////////////////////
67 std::string intToString(int num);
69 std::vector<std::string> GetLstNameThingsStatic();
71 void SaveThingName(FILE* pFile, FILE *pFileData, std::string name );
73 std::vector<std::string> GetLstNameThings();
75 bool IsPartOfStaticList(std::string keyName );
77 void deleteCModel(std::string theKeyName);
79 void removeAllOutlines();
81 //void setInstance(theInstant);
83 std::vector<NameWrapper *> getActualInstantOutlines();
85 int getNamesWrappingSize();
87 std::string getNameWrapping(int i);
89 void setInstant(Instant* theInstant);
90 void setInstant(std::vector<int> vectInstant);
91 std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
93 Instant * getCurrentInstant();
95 manualBaseModel* getOutlineByKeyName(std::string cloneName);
97 bool onRedo(std::string& filename);
99 bool onUndo(std::string& filename);
101 bool onUndoSaveFile(std::string& filename);
103 std::string saveState();
105 void changeContourOfManager(std::string keyName, Instant *instant);
109 std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
111 void getMaxMinZ(double *minZ,double *maxZ);
113 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);
116 // Method which creates the model associated with the type in parameter. The possible contour types are:
125 // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
126 // @param typeContour - int
127 // @return manualBaseModel - Model created based on the type
128 manualBaseModel* factoryManualContourModel(int typeContour);
130 void CalculeSplinePropagation();
132 std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
134 std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
136 std::vector<manualBaseModel*> ExploseEachModel( std::vector<manualBaseModel*> lstManConMod );
139 void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
141 vtkImageData* getImageAtInstant(std::vector<int> inst);
143 //------------------------------------------------------------------------------------------------------------
145 //------------------------------------------------------------------------------------------------------------
147 void setCurrentFileName(std::string filenam);
148 std::string getCurrentFileName();
150 std::string parseOsirixFile(std::string filename);
152 //------------------------------------------------------------------------------------------------------------
154 //------------------------------------------------------------------------------------------------------------
155 std::vector<vtkImageData*> vectimages;
157 ImageSourceThing * imageSource;
159 //Instant * _actualInstant;
160 //Temporary attribute should be removed
161 OutlineModelManager * modelManager;
163 std::string filename;
168 std::string stundoredo;
169 std::string _datadir;
171 ContourPropagation* _contourPropagation;
173 OutlineModelManager* getOutlineModelManager();