Developer documentation
Version 3.0.3-105-gd3941f44
view.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __gui_mrview_tool_view_h__
18#define __gui_mrview_tool_view_h__
19
22#include "gui/mrview/spin_box.h"
24
25namespace MR
26{
27 namespace GUI
28 {
29
30 namespace MRView
31 {
32 class AdjustButton;
33
34 namespace Tool
35 {
36
37
40 public:
41 GL::vec4 plane;
42 bool active;
43 std::string name;
44 };
45
47 { MEMALIGN(View)
48 Q_OBJECT
49 public:
50 View (Dock* parent);
51
52 QPushButton *clip_on_button[3], *clip_edit_button[3], *clip_modify_button;
53
54 vector< std::pair<GL::vec4,bool> > get_active_clip_planes () const;
55 vector<GL::vec4*> get_clip_planes_to_be_edited () const;
56 bool get_cliphighlightstate () const;
57 bool get_clipintersectionmodestate () const;
58
59 void update_lightbox_mode_gui(const Mode::LightBox &mode) override;
60 void update_ortho_mode_gui (const Mode::Ortho &mode) override;
61 void deactivate () override;
62 bool slice_move_event (const ModelViewProjection& projection, float inc) override;
63 bool pan_event (const ModelViewProjection& projection) override;
64 bool panthrough_event (const ModelViewProjection& projection) override;
65 bool tilt_event (const ModelViewProjection& projection) override;
66 bool rotate_event (const ModelViewProjection& projection) override;
67
68 protected:
69 virtual void showEvent (QShowEvent* event) override;
70 virtual void closeEvent (QCloseEvent* event) override;
71
72 private slots:
73 void onImageChanged ();
74 void onImageVisibilityChanged (bool);
75 void onFocusChanged ();
76 void onVolumeIndexChanged();
77 void onFOVChanged ();
78 void onSetFocus ();
79 void onSetVoxel ();
80 void onSetVolumeIndex ();
81 void onPlaneChanged ();
82 void onSetPlane (int index);
83 void onSetScaling ();
84 void onScalingChanged ();
85 void onSetTransparency ();
86 void onSetFOV ();
87 void onCheckThreshold (bool);
88 void onModeChanged ();
89 void hide_image_slot (bool flag);
90 void copy_focus_slot ();
91 void copy_voxel_slot ();
92 void clip_planes_right_click_menu_slot (const QPoint& pos);
93 void clip_planes_selection_changed_slot ();
94 void clip_planes_toggle_shown_slot();
95 void clip_planes_toggle_highlight_slot();
96 void clip_planes_toggle_intersectionmode_slot();
97
98 void clip_planes_add_axial_slot ();
99 void clip_planes_add_sagittal_slot ();
100 void clip_planes_add_coronal_slot ();
101
102 void clip_planes_reset_axial_slot ();
103 void clip_planes_reset_sagittal_slot ();
104 void clip_planes_reset_coronal_slot ();
105
106 void clip_planes_invert_slot ();
107 void clip_planes_remove_slot ();
108 void clip_planes_clear_slot ();
109
110 void light_box_slice_inc_reset_slot ();
111 void light_box_toggle_volumes_slot (bool);
112
113 private:
114 QPushButton *hide_button;
115 QPushButton *copy_focus_button;
116 QPushButton *copy_voxel_button;
117 AdjustButton *focus_x, *focus_y, *focus_z;
118 AdjustButton *voxel_x, *voxel_y, *voxel_z;
119 AdjustButton *max_entry, *min_entry, *fov;
120 AdjustButton *transparent_intensity, *opaque_intensity;
121 AdjustButton *lower_threshold, *upper_threshold;
122 QCheckBox *lower_threshold_check_box, *upper_threshold_check_box, *clip_highlight_check_box, *clip_intersectionmode_check_box, *ortho_view_in_row_check_box;
123 QComboBox *plane_combobox;
124 QGroupBox *volume_box, *transparency_box, *threshold_box, *clip_box, *lightbox_box;
125 QSlider *opacity;
126 QMenu *clip_planes_option_menu, *clip_planes_reset_submenu;
127 QAction *clip_planes_new_axial_action, *clip_planes_new_sagittal_action, *clip_planes_new_coronal_action;
128 QAction *clip_planes_reset_axial_action, *clip_planes_reset_sagittal_action, *clip_planes_reset_coronal_action;
129 QAction *clip_planes_invert_action, *clip_planes_remove_action, *clip_planes_clear_action;
130 GridLayout *volume_index_layout;
131
132 QLabel *light_box_slice_inc_label, *light_box_volume_inc_label;
133 AdjustButton *light_box_slice_inc;
134 SpinBox *light_box_rows, *light_box_cols, *light_box_volume_inc;
135 QCheckBox *light_box_show_grid, *light_box_show_4d;
136
137 class ClipPlaneModel;
138 ClipPlaneModel* clip_planes_model;
139 QListView* clip_planes_list_view;
140
141 void connect_mode_specific_slots ();
142 void init_lightbox_gui (QLayout* parent);
143 void reset_light_box_gui_controls ();
144 void set_transparency_from_image ();
145
146 void move_clip_planes_in_out (const ModelViewProjection& projection, vector<GL::vec4*>& clip, float distance);
147 void rotate_clip_planes (vector<GL::vec4*>& clip, const Eigen::Quaternionf& rot);
148 };
149
150 }
151 }
152 }
153}
154
155#endif
156
157
158
159
160
virtual void closeEvent(QCloseEvent *event) override
virtual void showEvent(QShowEvent *event) override
Definition: base.h:24
size_t index
#define MEMALIGN(...)
Definition: types.h:185