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