1 #ifndef vvSlicerManager_h
2 #define vvSlicerManager_h
11 #include <vtksys/SystemTools.hxx>
13 class vtkInteractorStyle;
14 class vtkRenderWindow;
18 #include "vvConstants.h"
19 #include "clitkCommon.h"
23 class vvInteractorStyleNavigator;
28 class vvSlicerManager : public QObject {
32 vvSlicerManager(int numberOfSlicers);
35 std::string GetLastError() {
39 bool SetImage(std::string filename,LoadedImageType type);
40 void SetImage(vvImage::Pointer image);
41 void SetExtractedImage(std::string filename, vvImage::Pointer image, int slice);
42 bool SetImages(std::vector<std::string> filenames,LoadedImageType type);
44 bool SetOverlay(std::string filename, int dim, std::string component);
45 bool SetFusion(std::string filename, int dim, std::string component);
46 ///Set a VF by loading it from the disk
47 bool SetVF(std::string filename);
48 ///Set a VF from memory
49 bool SetVF(vvImage::Pointer vf,std::string filename);
50 ///Add a mesh to the slicers, with optional propagation using a vector field
51 void AddContour(vvMesh::Pointer ,bool propagate=false);
52 ///Toggle temporal superposition of contours
53 void ToggleContourSuperposition();
55 std::string GetFileName() {
58 std::string GetVFName() {
61 std::string GetOverlayName() {
64 std::string GetFusionName() {
68 ///Switch between nearest neighbor and linear interpolation
69 void ToggleInterpolation();
70 vvSlicer* GetSlicer(int i);
71 void UpdateSlicer(int num, bool state);
72 void SetSlicerWindow(int i, vtkRenderWindow* RW);
73 void SetInteractorStyleNavigator(int i,vtkInteractorStyle* style);
74 int NumberOfSlicers() {
75 return mSlicers.size();
77 vvImage::Pointer GetImage() {
80 vvImage::Pointer GetVF() {
84 if (mImage) return mImage->GetNumberOfDimensions();
92 void SetId(std::string id) {
99 void SetFilename(std::string f) {
103 void SetTSlice(int slice);
104 void SetNextTSlice(int originating_slicer);
105 void SetPreviousTSlice(int originating_slicer);
106 void SetTSliceInSlicer(int tslice, int slicer);
108 void GenerateDefaultLookupTable();
109 void SetColorWindow(double s);
110 void SetColorLevel(double s);
111 void SetLocalColorWindowing(const int slicer);
112 void SetOpacity(int i, double factor);
114 void SetColorMap(int colormap);
115 void SetPreset(int preset);
116 void SetOverlayColor(int color) {
117 mOverlayColor = color;
119 void SetFusionOpacity(int opacity) {
120 mFusionOpacity = opacity;
122 void SetFusionColorMap(int colorMap) {
123 mFusionColorMap = colorMap;
125 void SetFusionWindow(int window) {
126 mFusionWindow = window;
128 void SetFusionLevel(int level) {
129 mFusionLevel = level;
132 double GetColorWindow();
133 double GetColorLevel();
140 int GetOverlayColor() {
141 return mOverlayColor;
144 int GetFusionOpacity() {
145 return mFusionOpacity;
147 int GetFusionColorMap() {
148 return mFusionColorMap;
150 double GetFusionWindow() {
151 return mFusionWindow;
153 double GetFusionLevel() {
157 void SetCursorVisibility(int s);
158 void UpdateViews(int current, int slicer);
159 void UpdateLinked(int slicer);
162 void AddLink(std::string newId) {
163 mLinkedId.push_back(newId);
165 void RemoveLink(std::string oldId) {
166 mLinkedId.remove(oldId);
169 ///Remove the actor defined by its type and index (example: 3rd contour)
170 void RemoveActor(const std::string& actor_type, int overlay_index);
173 void ReloadOverlay();
178 void UpdateInfoOnCursorPosition(int slicer);
179 void UpdateWindowLevel();
180 void UpdateSlice(int slicer);
181 void UpdateTSlice(int slicer);
182 void UpdateSliceRange(int slicer);
184 vvLandmarks *GetLandmarks();
185 void AddLandmark(float x,float y,float z,float t);
188 void currentImageChanged(std::string id);
189 void UpdatePosition(int visibility,double x, double y, double z, double X, double Y, double Z, double value);
190 void UpdateVector(int display, double x, double y, double z, double value);
191 void UpdateOverlay(int display, double valueOver, double valueRef);
192 void UpdateFusion(int display, double valueFus);
193 void UpdateWindows(int slicer, int view, int slice);
194 void UpdateSlice(int slicer, int slice);
195 void UpdateTSlice(int slicer, int slice);
196 void UpdateSliceRange(int slice, int min, int max, int tmin, int tmax);
197 void WindowLevelChanged(double window, double level, int preset, int colormap);
198 void UpdateLinkManager(std::string, int slicer, double x, double y, double z, int temps);
199 void LandmarkAdded();
202 std::vector<vvSlicer*> mSlicers;
203 vvImageReader* mReader;
204 vvImageReader* mOverlayReader;
205 vvImageReader* mFusionReader;
206 vvImage::Pointer mImage;
207 vvImage::Pointer mVF;
208 vvImageReader* mVectorReader;
214 double mFusionWindow;
218 LoadedImageType mType;
219 std::string mVFComponent;
220 std::string mOverlayComponent;
221 std::string mFusionComponent;
222 std::string mFileName;
225 std::string mOverlayName;
226 std::string mFusionName;
228 std::string mLastError;
229 std::list<std::string> mLinkedId;
231 vvLandmarks* mLandmarks;