Developer documentation
Version 3.0.3-105-gd3941f44
overlay.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_overlay_h__
18#define __gui_mrview_tool_overlay_h__
19
24#include "gui/mrview/spin_box.h"
25
26namespace MR
27{
28 namespace GUI
29 {
30 namespace MRView
31 {
32 namespace Tool
33 {
34
37 Q_OBJECT
38
39 public:
40
41 Overlay (Dock* parent);
42
43 void draw (const Projection& projection, bool is_3D, int axis, int slice) override;
44 void draw_colourbars () override;
45 int draw_tool_labels (int position, int start_line_num, const Projection&transform) const override;
46
47 void selected_colourmap(size_t index, const ColourMapButton&) override;
48 void selected_custom_colour(const QColor& colour, const ColourMapButton&) override;
49 void toggle_show_colour_bar(bool visible, const ColourMapButton&) override;
50 void toggle_invert_colourmap(bool, const ColourMapButton&) override;
51 void reset_colourmap(const ColourMapButton&) override;
52
53 size_t visible_number_colourbars () override;
54 void render_image_colourbar(const Image& image) override;
55
56 static void add_commandline_options (MR::App::OptionList& options);
57 virtual bool process_commandline_option (const MR::App::ParsedOption& opt) override;
58
59 private slots:
60 void image_open_slot ();
61 void image_close_slot ();
62 void hide_all_slot ();
63 void toggle_shown_slot (const QModelIndex&, const QModelIndex&);
64 void selection_changed_slot (const QItemSelection &, const QItemSelection &);
65 void right_click_menu_slot (const QPoint&);
66 void onSetVolumeIndex ();
67 void update_slot (int unused);
68 void values_changed ();
69 void upper_threshold_changed (int unused);
70 void lower_threshold_changed (int unused);
71 void upper_threshold_value_changed ();
72 void lower_threshold_value_changed ();
73 void opacity_changed (int unused);
74 void interpolate_changed ();
75
76 protected:
77 class Item;
78 class Model;
79 class InterpolateCheckBox : public QCheckBox
81 public:
82 InterpolateCheckBox(const QString& text, QWidget *parent = nullptr)
83 : QCheckBox(text, parent) {}
84 protected:
85 // We don't want a click to cycle to a partially checked state
86 // So explicitly specify the allowed clickable states
87 void nextCheckState () override { checkState() == Qt::Unchecked ?
88 setCheckState(Qt::Checked) : setCheckState(Qt::Unchecked);
89 }
90 };
91
92 QPushButton* hide_all_button;
94 QListView* image_list_view;
100 QGroupBox *volume_box;
102
104 void updateGL() {
105 window().get_current_mode()->update_overlays = true;
106 window().updateGL();
107 }
108
109 void add_images (vector<std::unique_ptr<MR::Header>>& list);
110 void dropEvent (QDropEvent* event) override;
111 };
112
113 }
114 }
115 }
116}
117
118#endif
119
120
121
122
a class to hold the list of option groups
Definition: app.h:139
object storing information about option parsed from command-line
Definition: app.h:286
Window & window() const
Definition: base.h:87
InterpolateCheckBox(const QString &text, QWidget *parent=nullptr)
Definition: overlay.h:82
GridLayout * volume_index_layout
Definition: overlay.h:101
void add_images(vector< std::unique_ptr< MR::Header > > &list)
QCheckBox * lower_threshold_check_box
Definition: overlay.h:97
ColourMapButton * colourmap_button
Definition: overlay.h:95
void dropEvent(QDropEvent *event) override
AdjustButton * max_value
Definition: overlay.h:96
QPushButton * hide_all_button
Definition: overlay.h:92
AdjustButton * upper_threshold
Definition: overlay.h:96
InterpolateCheckBox * interpolate_check_box
Definition: overlay.h:98
QCheckBox * upper_threshold_check_box
Definition: overlay.h:97
AdjustButton * min_value
Definition: overlay.h:96
AdjustButton * lower_threshold
Definition: overlay.h:96
Mode::Base * get_current_mode() const
Definition: window.h:111
#define NOMEMALIGN
Definition: memory.h:22
Definition: base.h:24
int axis
size_t index
#define MEMALIGN(...)
Definition: types.h:185