6 #include "ui_vvMainWindow.h"
7 #include "vvMainWindowBase.h"
8 #include "vvToolManager.h"
9 #include "vvConstants.h"
12 class vvSlicerManager;
14 class vvDocumentation;
15 class vtkRenderWindowInteractor;
18 class vvDicomSeriesSelector;
20 //------------------------------------------------------------------------------
21 class vvMainWindow: public vvMainWindowBase,
22 private Ui::vvMainWindow
29 void LoadImages(std::vector<std::string> filenames, LoadedImageType type);
30 void AddImage(vvImage::Pointer image,std::string filename);
31 void AddImage(vvSlicerManager * m);
32 void AddField(QString file,int index);
33 void AddOverlayImage(int index, QString filename);
34 ///Adds a mesh to a SlicerManager, with optional warping by vector field
35 void AddContour(int image_index, vvMesh::Pointer contour, bool propagation);
36 ///This is used to show an image when opened or computed
39 virtual void UpdateCurrentSlicer();
40 //vvMainWindowToolInfo * GetInfoForTool();
41 // void AddRunningTool(vvToolCreatorBase * tool);
44 ///Allows the user to open and select various surfaces contained in a dicom-struct file
45 void OpenDCStructContour();
46 ///Computes the MIP of the currently selected image and displays it
48 ///Computes the midposition image of a 4D sequence with a VF and displays it
49 void ComputeMidPosition();
51 ///Slot triggered by the dynamically-generated recent file menu actions
52 void OpenRecentImage();
53 void OpenImageWithTime();
55 void MergeImagesWithTime();
57 ///Open a vtkPolyData surface mesh and display it over the current image
58 void OpenVTKContour();
60 void CurrentImageChanged(std::string id);
61 void ImageInfoChanged();
62 void ShowHelpDialog();
63 void ShowDocumentation();
64 void ComputeDeformableRegistration();
66 void ChangeViewMode();
67 void DisplayChanged(QTreeWidgetItem *item, int column);
68 void CloseImage(QTreeWidgetItem* item, int column);
69 void ReloadImage(QTreeWidgetItem* item, int column);
70 void MousePositionChanged(int visibility, double x, double y, double z, double X, double Y, double Z , double value);
71 void VectorChanged(int visibility, double x, double y, double z, double value);
72 void OverlayChanged(int visibility, double valueOver, double valueRef);
73 void FusionChanged(int visibility, double value);
74 void ResampleCurrentImage();
75 void SegmentationOnCurrentImage();
76 void SurfaceViewerLaunch();
78 void WindowsChanged(int window, int view, int slice);
79 void WindowLevelChanged(double window, double level,int preset, int colormap);
80 void UpdateSlice(int slicer, int slice);
81 void UpdateTSlice(int slicer, int slice);
82 void UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax);
83 void WindowLevelEdited();
84 void UpdateColorMap();
85 void UpdateWindowLevel();
86 void SwitchWindowLevel();
87 void UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps);
88 void AddLink(QString image1,QString image2);
89 void RemoveLink(QString image1,QString image2);
91 ///Generic method called when any one of the horizontal sliders is moved
92 void HorizontalSliderMoved(int value,int column, int slicer_index);
93 void NOHorizontalSliderMoved();
94 void NEHorizontalSliderMoved();
95 void SOHorizontalSliderMoved();
96 void SEHorizontalSliderMoved();
98 void NOVerticalSliderChanged();
99 void NEVerticalSliderChanged();
100 void SOVerticalSliderChanged();
101 void SEVerticalSliderChanged();
103 void SaveNEScreenshot();
104 void SaveNOScreenshot();
105 void SaveSEScreenshot();
106 void SaveSOScreenshot();
108 void ShowContextMenu(QPoint point);
114 void SelectOverlayImage();
115 void AddFusionImage();
117 void SetVFProperty(int subsampling,int scale,int lut);
118 void SetOverlayProperty(int color);
119 void SetFusionProperty(int opacity,int colormap,double window,double level);
124 void ChangeFrameRate(int rate) {
127 void UpdateRenderWindows();
130 // void SlicerManagersHasChanged();
135 // std::vector<vvSlicerManager*> mSlicerManagers;
136 vvHelpDialog *help_dialog;
137 vvDocumentation *documentation;
138 vvDicomSeriesSelector *dicomSeriesSelector;
140 QString mInputPathName;
146 ///Adds a vector field to slicer manager index
147 void WarpImage(vvSlicerManager* selected_slicer,int reference_phase);
148 void AddFieldEntry(QString filename,int index,bool from_disk);
149 void AddField(vvImage::Pointer vf,QString file,int index);
151 ///Sets the render window and LUT for the last SlicerManager
153 void DisplaySliders(int slicer, int window);
154 QString GetSizeInBytes(unsigned long size);
155 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
156 QString GetVectorIntAsString(std::vector<int> vectorInt);
157 int GetSlicerIndexFromItem(QTreeWidgetItem* item);
158 void SaveScreenshot(vtkImageData* image);
161 //QMenu *AddSubImageMenu;
162 std::vector<QAction*> contextActions;
163 std::vector<QSlider*> horizontalSliders;
164 std::vector<QSlider*> verticalSliders;
167 // vvMainWindowToolInfo * mCurrentToolInfo;
168 // std::vector<vvToolCreatorBase*> mListOfRunningTool;
170 static vvMainWindow * mSingleton;
173 #include "vvMainWindow.txx"