1 /*=========================================================================
4 Module: $RCSfile: vvMainWindow.h,v $
6 Date: $Date: 2010/01/06 13:31:57 $
7 Version: $Revision: 1.1 $
8 Author : Pierre Seroul (pierre.seroul@gmail.com)
11 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
12 CREATIS-LRMN http://www.creatis.insa-lyon.fr
14 This program is free software: you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation, version 3 of the License.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 =========================================================================*/
28 #ifndef vvMainWindow_h
29 #define vvMainWindow_h
34 #include "ui_vvMainWindow.h"
36 #include "vvConstants.h"
40 class vvSlicerManager;
42 class vvDocumentation;
43 class vtkRenderWindowInteractor;
46 class vvDicomSeriesSelector;
48 class vvMainWindow : public QMainWindow, private Ui::vvMainWindow
55 void LoadImages(std::vector<std::string> filenames, LoadedImageType type);
56 void AddImage(vvImage::Pointer image,std::string filename);
57 void AddImage(vvSlicerManager * m);
58 void AddField(QString file,int index);
59 void AddOverlayImage(int index, QString filename);
60 ///Adds a mesh to a SlicerManager, with optional warping by vector field
61 void AddContour(int image_index, vvMesh::Pointer contour, bool propagation);
62 ///This is used to show an image when opened or computed
66 ///Allows the user to open and select various surfaces contained in a dicom-struct file
67 void OpenDCStructContour();
68 ///Computes the MIP of the currently selected image and displays it
70 ///Computes the midposition image of a 4D sequence with a VF and displays it
71 void ComputeMidPosition();
73 ///Slot triggered by the dynamically-generated recent file menu actions
74 void OpenRecentImage();
75 void OpenImageWithTime();
77 void MergeImagesWithTime();
79 ///Open a vtkPolyData surface mesh and display it over the current image
80 void OpenVTKContour();
82 void CurrentImageChanged(std::string id);
83 void ImageInfoChanged();
84 void ShowHelpDialog();
85 void ShowDocumentation();
86 void ComputeDeformableRegistration();
88 void ChangeViewMode();
89 void DisplayChanged(QTreeWidgetItem *item, int column);
90 void CloseImage(QTreeWidgetItem* item, int column);
91 void ReloadImage(QTreeWidgetItem* item, int column);
92 void MousePositionChanged(int visibility, double x, double y, double z, double X, double Y, double Z , double value);
93 void VectorChanged(int visibility, double x, double y, double z, double value);
94 void OverlayChanged(int visibility, double valueOver, double valueRef);
95 void FusionChanged(int visibility, double value);
96 void ResampleCurrentImage();
97 void SegmentationOnCurrentImage();
98 void SurfaceViewerLaunch();
100 void WindowsChanged(int window, int view, int slice);
101 void WindowLevelChanged(double window, double level,int preset, int colormap);
102 void UpdateSlice(int slicer, int slice);
103 void UpdateTSlice(int slicer, int slice);
104 void UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax);
105 void WindowLevelEdited();
106 void UpdateColorMap();
107 void UpdateWindowLevel();
108 void SwitchWindowLevel();
109 void UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps);
110 void AddLink(QString image1,QString image2);
111 void RemoveLink(QString image1,QString image2);
113 ///Generic method called when any one of the horizontal sliders is moved
114 void HorizontalSliderMoved(int value,int column, int slicer_index);
115 void NOHorizontalSliderMoved();
116 void NEHorizontalSliderMoved();
117 void SOHorizontalSliderMoved();
118 void SEHorizontalSliderMoved();
120 void NOVerticalSliderChanged();
121 void NEVerticalSliderChanged();
122 void SOVerticalSliderChanged();
123 void SEVerticalSliderChanged();
125 void SaveNEScreenshot();
126 void SaveNOScreenshot();
127 void SaveSEScreenshot();
128 void SaveSOScreenshot();
130 void ShowContextMenu(QPoint point);
136 void SelectOverlayImage();
137 void AddFusionImage();
139 void SetVFProperty(int subsampling,int scale,int lut);
140 void SetOverlayProperty(int color);
141 void SetFusionProperty(int opacity,int colormap,double window,double level);
146 void ChangeFrameRate(int rate) {
150 void UpdateRenderWindows();
155 std::vector<vvSlicerManager*> mSlicerManagers;
156 vvHelpDialog *help_dialog;
157 vvDocumentation *documentation;
158 vvDicomSeriesSelector *dicomSeriesSelector;
160 QString mInputPathName;
166 ///Adds a vector field to slicer manager index
167 void WarpImage(vvSlicerManager* selected_slicer,int reference_phase);
168 void AddFieldEntry(QString filename,int index,bool from_disk);
169 void AddField(vvImage::Pointer vf,QString file,int index);
171 ///Sets the render window and LUT for the last SlicerManager
173 void DisplaySliders(int slicer, int window);
174 QString GetSizeInBytes(unsigned long size);
175 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
176 QString GetVectorIntAsString(std::vector<int> vectorInt);
177 int GetSlicerIndexFromItem(QTreeWidgetItem* item);
178 void SaveScreenshot(vtkImageData* image);
181 //QMenu *AddSubImageMenu;
182 std::vector<QAction*> contextActions;
183 std::vector<QSlider*> horizontalSliders;
184 std::vector<QSlider*> verticalSliders;