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);
50 void GetSpacing(double *vecspc, int iImage);
54 ** This method returns the source of the image data selected by the user.
56 vtkImageData* getSourceImage();
60 void initializeEnvironment(std::string datadir);
64 ** This methods connect the event in the class interfNewContourMenu with the world of the appli
67 std::string createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector);
68 /////////////////////////////////
70 std::string intToString(int num);
72 std::vector<std::string> GetLstNameThingsStatic();
74 void SaveThingName(FILE* pFile, FILE *pFileData, std::string name );
76 std::vector<std::string> GetLstNameThings();
78 bool IsPartOfStaticList(std::string keyName );
80 void deleteCModel(std::string theKeyName);
82 void removeAllOutlines();
84 //void setInstance(theInstant);
86 std::vector<NameWrapper *> getActualInstantOutlines();
88 int getNamesWrappingSize();
90 std::string getNameWrapping(int i);
92 void setInstant(Instant* theInstant);
93 void setInstant(std::vector<int> vectInstant);
94 std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
96 Instant * getCurrentInstant();
98 manualBaseModel* getOutlineByKeyName(std::string cloneName);
100 bool onRedo(std::string& filename);
102 bool onUndo(std::string& filename);
104 bool onUndoSaveFile(std::string& filename);
106 std::string saveState();
108 void changeContourOfManager(std::string keyName, Instant *instant);
112 std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
114 void getMaxMinZ(double *minZ,double *maxZ);
116 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);
119 // Method which creates the model associated with the type in parameter. The possible contour types are:
128 // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
129 // @param typeContour - int
130 // @return manualBaseModel - Model created based on the type
131 manualBaseModel* factoryManualContourModel(int typeContour);
133 void CalculeSplinePropagation();
135 std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
137 std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
139 std::vector<manualBaseModel*> ExploseEachModel( std::vector<manualBaseModel*> lstManConMod );
142 void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
144 vtkImageData* getImageAtInstant(std::vector<int> inst);
146 //------------------------------------------------------------------------------------------------------------
148 //------------------------------------------------------------------------------------------------------------
150 void setCurrentFileName(std::string filenam);
151 std::string getCurrentFileName();
153 std::string parseOsirixFile(std::string filename);
155 //------------------------------------------------------------------------------------------------------------
157 //------------------------------------------------------------------------------------------------------------
158 std::vector<vtkImageData*> vectimages;
159 std::vector<std::vector<double> > vectimagesSpacing;
161 ImageSourceThing *imageSource;
163 //Instant * _actualInstant;
164 //Temporary attribute should be removed
165 OutlineModelManager *modelManager;
167 std::string filename;
172 std::string stundoredo;
173 std::string _datadir;
175 ContourPropagation *_contourPropagation;
177 OutlineModelManager *getOutlineModelManager();