From 924fc680b21a6ef9c46a9b495fd0ed875dedcc8b Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 29 Jun 2023 14:46:47 +0100 Subject: [PATCH 1/2] mrview: fix handling of colour mapping for track scalar files Fixes #2662 --- src/gui/mrview/displayable.h | 8 ++++- .../tool/tractography/track_scalar_file.cpp | 5 ++-- .../mrview/tool/tractography/tractogram.cpp | 8 +++-- src/gui/mrview/tool/tractography/tractogram.h | 3 -- .../mrview/tool/tractography/tractography.cpp | 29 +++++++------------ 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/gui/mrview/displayable.h b/src/gui/mrview/displayable.h index 2c65d1dff9..309f626442 100644 --- a/src/gui/mrview/displayable.h +++ b/src/gui/mrview/displayable.h @@ -138,10 +138,16 @@ namespace MR flags_ = cmap; } - void set_colour (std::array &c) { + void set_colour (const std::array &c) { colour = c; } + void set_colour (const QColor &c) { + colour[0] = c.red(); + colour[1] = c.green(); + colour[2] = c.blue(); + } + void set_use_discard_lower (bool yesno) { if (!discard_lower_enabled()) return; set_bit (DiscardLower, yesno); diff --git a/src/gui/mrview/tool/tractography/track_scalar_file.cpp b/src/gui/mrview/tool/tractography/track_scalar_file.cpp index dad1f5a948..7ceb216d62 100644 --- a/src/gui/mrview/tool/tractography/track_scalar_file.cpp +++ b/src/gui/mrview/tool/tractography/track_scalar_file.cpp @@ -159,7 +159,8 @@ namespace MR window().colourbar_renderer.render (tractogram.colourmap, tractogram.scale_inverted(), min_value, max_value, - tractogram.scaling_min(), tractogram.display_range, tractogram.colour); + tractogram.scaling_min(), tractogram.display_range, + { tractogram.colour[0]/255.0f, tractogram.colour[1]/255.0f, tractogram.colour[2]/255.0f }); } @@ -446,7 +447,7 @@ namespace MR window().updateGL(); } } - + void TrackScalarFileOptions::set_colourmap (int colourmap_index) { if (tractogram) { diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 5749e542a7..54fe44c22e 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -67,6 +67,7 @@ namespace MR "uniform float slab_width;\n" "uniform float offset, scale;\n" "uniform float scale_x, scale_y;\n" + "uniform vec3 colourmap_colour;\n" "out vec3 v_tangent;\n" "out vec2 v_end;\n"; @@ -220,7 +221,7 @@ namespace MR std::string source = "uniform float lower, upper;\n" - "uniform vec3 const_colour;\n" + "uniform vec3 colourmap_colour;\n" "uniform mat4 MV;\n" "out vec3 colour;\n"; @@ -282,7 +283,7 @@ namespace MR : " colour = v_colour;\n"; break; case TrackColourType::Manual: - source += " colour = const_colour;\n"; + source += " colour = colourmap_colour;\n"; } if (use_lighting && (using_geom || using_points)) { @@ -429,7 +430,8 @@ namespace MR } if (color_type == TrackColourType::Manual) - gl::Uniform3fv (gl::GetUniformLocation (track_shader, "const_colour"), 1, colour.data()); + gl::Uniform3f (gl::GetUniformLocation (track_shader, "colourmap_colour"), + colour[0]/255.0, colour[1]/255.0, colour[2]/255.0); if (color_type == TrackColourType::ScalarFile) { gl::Uniform1f (gl::GetUniformLocation (track_shader, "offset"), display_midpoint - 0.5f * display_range); diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 40e9610ca0..ba83dddabb 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -69,8 +69,6 @@ namespace MR TrackThresholdType get_threshold_type() const { return threshold_type; } TrackGeometryType get_geometry_type() const { return geometry_type; } - void set_colour (float c[3]) { colour = { c[0], c[1], c[2] }; } - float get_threshold_rate() const { switch (threshold_type) { case TrackThresholdType::None: return NaN; @@ -90,7 +88,6 @@ namespace MR bool scalarfile_by_direction; bool show_colour_bar; bool should_update_stride; - Eigen::Array3f colour; float original_fov; float line_thickness; std::string intensity_scalar_filename; diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index e5d1e2bdde..64170b9be3 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -564,11 +564,12 @@ namespace MR colour[2] = rng(); } while (colour[0] < 0.5 && colour[1] < 0.5 && colour[2] < 0.5); tractogram->set_color_type (TrackColourType::Manual); - tractogram->set_colour (colour); + QColor c (colour[0]*255.0f, colour[1]*255.0f, colour[2]*255.0f); + tractogram->set_colour (c); if (tractogram->get_threshold_type() == TrackThresholdType::UseColourFile) tractogram->set_threshold_type (TrackThresholdType::None); if (!i) - colour_button->setColor (QColor (colour[0]*255.0f, colour[1]*255.0f, colour[2]*255.0f)); + colour_button->setColor (c); } colour_combobox->blockSignals (true); colour_combobox->setCurrentIndex (2); @@ -584,13 +585,12 @@ namespace MR { QColor color; color = QColorDialog::getColor(Qt::red, this, "Select Color", QColorDialog::DontUseNativeDialog); - float colour[] = {float(color.redF()), float(color.greenF()), float(color.blueF())}; if (color.isValid()) { QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); for (int i = 0; i < indices.size(); ++i) { Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[i]); tractogram->set_color_type (TrackColourType::Manual); - tractogram->set_colour (colour); + tractogram->set_colour (color); if (tractogram->get_threshold_type() == TrackThresholdType::UseColourFile) tractogram->set_threshold_type (TrackThresholdType::None); } @@ -599,7 +599,7 @@ namespace MR colour_combobox->clearError(); colour_combobox->blockSignals (false); colour_button->setEnabled (true); - colour_button->setColor (QColor (colour[0]*255.0f, colour[1]*255.0f, colour[2]*255.0f)); + colour_button->setColor (color); update_scalar_options(); } window().updateGL(); @@ -668,9 +668,8 @@ namespace MR const QColor color = colour_button->color(); if (color.isValid()) { QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); - float c[3] = { color.red()/255.0f, color.green()/255.0f, color.blue()/255.0f }; for (int i = 0; i < indices.size(); ++i) - tractogram_list_model->get_tractogram (indices[i])->set_colour (c); + tractogram_list_model->get_tractogram (indices[i])->set_colour (color); colour_combobox->blockSignals (true); colour_combobox->setCurrentIndex (3); // In case it was on random colour_combobox->clearError(); @@ -717,7 +716,7 @@ namespace MR const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); TrackColourType color_type = first_tractogram->get_color_type(); - Eigen::Array3f color = first_tractogram->colour; + QColor color (first_tractogram->colour[0], first_tractogram->colour[1], first_tractogram->colour[2]); TrackGeometryType geom_type = first_tractogram->get_geometry_type(); bool color_type_consistent = true, geometry_type_consistent = true; float mean_thickness = first_tractogram->line_thickness; @@ -743,7 +742,7 @@ namespace MR case TrackColourType::Manual: colour_combobox->setCurrentIndex (3); colour_button->setEnabled (true); - colour_button->setColor (QColor (color[0]*255.0f, color[1]*255.0f, color[2]*255.0f)); + colour_button->setColor (color); break; case TrackColourType::ScalarFile: colour_combobox->setCurrentIndex (4); @@ -988,16 +987,10 @@ namespace MR const float max_value = std::max ({ values[0], values[1], values[2] }); if (std::min ({ values[0], values[1], values[2] }) < 0.0 || max_value > 255) throw Exception ("values provided to -tractogram.colour must be either between 0.0 and 1.0, or between 0 and 255"); - const float multiplier = max_value <= 1.0 ? 1.0 : 1.0/255.0; + const float multiplier = max_value <= 1.0 ? 255.0 : 1.0; //input need to be a float * - float colour_input[3] = { - multiplier * float (values[0]), - multiplier * float (values[1]), - multiplier * float (values[2]) - }; - - QColor colour (int(values[0]*255.0), int(values[1]*255.0), int(values[2]*255.0)); + QColor colour (multiplier*values[0], multiplier*values[1], multiplier*values[2]); QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); @@ -1008,7 +1001,7 @@ namespace MR // set the color tractogram->set_color_type (TrackColourType::Manual); - tractogram->set_colour (colour_input); + tractogram->set_colour (colour); // update_color_type_gui colour_combobox->setCurrentIndex (3); From ad39dc8f0c3ecfaede4bc92488d22d0a7827c173 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 29 Jun 2023 15:38:03 +0100 Subject: [PATCH 2/2] mrview: remove unnecessary functionality in colourmap_menu.h/cpp --- src/gui/mrview/colourmap_button.cpp | 16 ++-- src/gui/mrview/colourmap_button.h | 18 +++-- src/gui/mrview/colourmap_menu.cpp | 67 ----------------- src/gui/mrview/colourmap_menu.h | 49 ------------- src/gui/mrview/tool/overlay.cpp | 2 +- .../tool/tractography/track_scalar_file.cpp | 73 +++++-------------- .../tool/tractography/track_scalar_file.h | 22 +++--- 7 files changed, 52 insertions(+), 195 deletions(-) delete mode 100644 src/gui/mrview/colourmap_menu.cpp delete mode 100644 src/gui/mrview/colourmap_menu.h diff --git a/src/gui/mrview/colourmap_button.cpp b/src/gui/mrview/colourmap_button.cpp index 14988cf309..55f76ede94 100644 --- a/src/gui/mrview/colourmap_button.cpp +++ b/src/gui/mrview/colourmap_button.cpp @@ -118,10 +118,10 @@ void ColourMapButton::init_special_colour_menu_items(bool create_shortcuts) void ColourMapButton::init_customise_state_menu_items() { - auto show_colour_bar = colourmap_menu->addAction(tr("Show colour bar"), this, SLOT(show_colour_bar_slot(bool))); - show_colour_bar->setCheckable(true); - show_colour_bar->setChecked(true); - addAction(show_colour_bar); + show_colour_bar_action = colourmap_menu->addAction(tr("Show colour bar"), this, SLOT(show_colour_bar_slot(bool))); + show_colour_bar_action->setCheckable(true); + show_colour_bar_action->setChecked(true); + addAction(show_colour_bar_action); invert_scale_action = colourmap_menu->addAction(tr("Invert"), this, SLOT(invert_colourmap_slot(bool))); invert_scale_action->setCheckable(true); @@ -163,12 +163,18 @@ void ColourMapButton::set_colourmap_index(size_t index) } } -void ColourMapButton::set_scale_inverted(bool yesno) +void ColourMapButton::set_scale_inverted (bool yesno) { assert (invert_scale_action != nullptr); invert_scale_action->setChecked (yesno); } +void ColourMapButton::set_show_colourbar (bool yesno) +{ + assert (invert_scale_action != nullptr); + show_colour_bar_action->setChecked (yesno); +} + void ColourMapButton::set_fixed_colour() { diff --git a/src/gui/mrview/colourmap_button.h b/src/gui/mrview/colourmap_button.h index 871654e72d..057fe82273 100644 --- a/src/gui/mrview/colourmap_button.h +++ b/src/gui/mrview/colourmap_button.h @@ -34,11 +34,11 @@ class ColourMapButton; class ColourMapButtonObserver { NOMEMALIGN public: - virtual void selected_colourmap(size_t, const ColourMapButton&) {} - virtual void selected_custom_colour(const QColor&, const ColourMapButton&) {} - virtual void toggle_show_colour_bar(bool, const ColourMapButton&) {} - virtual void toggle_invert_colourmap(bool, const ColourMapButton&) {} - virtual void reset_colourmap(const ColourMapButton&) {} + virtual void selected_colourmap (size_t, const ColourMapButton&) {} + virtual void selected_custom_colour (const QColor&, const ColourMapButton&) {} + virtual void toggle_show_colour_bar (bool, const ColourMapButton&) {} + virtual void toggle_invert_colourmap (bool, const ColourMapButton&) {} + virtual void reset_colourmap (const ColourMapButton&) {} }; @@ -46,12 +46,13 @@ class ColourMapButton : public QToolButton { MEMALIGN(ColourMapButton) Q_OBJECT public: - ColourMapButton(QWidget* parent, ColourMapButtonObserver& obs, + ColourMapButton (QWidget* parent, ColourMapButtonObserver& obs, bool use_shortcuts = false, bool use_special_colourmaps = true, bool use_customise_state_items = true); - void set_colourmap_index(size_t index); - void set_scale_inverted(bool yesno); + void set_colourmap_index (size_t index); + void set_scale_inverted (bool yesno); + void set_show_colourbar (bool yesno); void set_fixed_colour(); vector colourmap_actions; void open_menu (const QPoint& p) { colourmap_menu->exec (p); } @@ -71,6 +72,7 @@ class ColourMapButton : public QToolButton QMenu* colourmap_menu; QAction* custom_colour_action; QAction* invert_scale_action; + QAction* show_colour_bar_action; size_t fixed_colour_index; diff --git a/src/gui/mrview/colourmap_menu.cpp b/src/gui/mrview/colourmap_menu.cpp deleted file mode 100644 index 814d4b8ce0..0000000000 --- a/src/gui/mrview/colourmap_menu.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Covered Software is provided under this License on an "as is" - * basis, without warranty of any kind, either expressed, implied, or - * statutory, including, without limitation, warranties that the - * Covered Software is free of defects, merchantable, fit for a - * particular purpose or non-infringing. - * See the Mozilla Public License v. 2.0 for more details. - * - * For more details, see http://www.mrtrix.org/. - */ - -#include "gui/gui.h" -#include "gui/mrview/colourmap_menu.h" - -namespace MR -{ - namespace GUI - { - namespace MRView - { - - - - void create_colourmap_menu (QWidget* parent, QActionGroup*& group, - QMenu* menu, QAction** & actions, - bool create_shortcuts, bool use_special) - { - group = new QActionGroup (parent); - group->setExclusive (true); - actions = new QAction* [ColourMap::num()]; - bool in_scalar_section = true; - - for (size_t n = 0; ColourMap::maps[n].name; ++n) { - if (ColourMap::maps[n].special && !use_special) - continue; - QAction* action = new QAction (ColourMap::maps[n].name, parent); - action->setCheckable (true); - group->addAction (action); - - if (ColourMap::maps[n].special && in_scalar_section) { - menu->addSeparator(); - in_scalar_section = false; - } - - menu->addAction (action); - parent->addAction (action); - - if (create_shortcuts) - action->setShortcut (qstr ("Ctrl+" + str (n+1))); - - actions[n] = action; - } - - actions[0]->setChecked (true); - } - - - - } - } -} - diff --git a/src/gui/mrview/colourmap_menu.h b/src/gui/mrview/colourmap_menu.h deleted file mode 100644 index 3fe4d16b34..0000000000 --- a/src/gui/mrview/colourmap_menu.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Covered Software is provided under this License on an "as is" - * basis, without warranty of any kind, either expressed, implied, or - * statutory, including, without limitation, warranties that the - * Covered Software is free of defects, merchantable, fit for a - * particular purpose or non-infringing. - * See the Mozilla Public License v. 2.0 for more details. - * - * For more details, see http://www.mrtrix.org/. - */ - -#ifndef __gui_mrview_colourmap_menu_h__ -#define __gui_mrview_colourmap_menu_h__ - -#include "colourmap.h" -#include "gui/opengl/gl.h" - -namespace MR -{ - namespace GUI - { - namespace MRView - { - - - - void create_colourmap_menu (QWidget* parent, - QActionGroup*& group, - QMenu* menu, - QAction** & actions, - bool create_shortcuts = false, - bool use_special = true); - - - - } - } -} - -#endif - - - - diff --git a/src/gui/mrview/tool/overlay.cpp b/src/gui/mrview/tool/overlay.cpp index dfcfe137bd..dc07de40d9 100644 --- a/src/gui/mrview/tool/overlay.cpp +++ b/src/gui/mrview/tool/overlay.cpp @@ -631,7 +631,7 @@ namespace MR if (colourmap_index == -2) colourmap_index = overlay->colourmap; else - colourmap_index = -1; + colourmap_index = -1; } num_inverted += overlay->scale_inverted(); rate += overlay->scaling_rate(); diff --git a/src/gui/mrview/tool/tractography/track_scalar_file.cpp b/src/gui/mrview/tool/tractography/track_scalar_file.cpp index 7ceb216d62..701ca0c108 100644 --- a/src/gui/mrview/tool/tractography/track_scalar_file.cpp +++ b/src/gui/mrview/tool/tractography/track_scalar_file.cpp @@ -17,7 +17,6 @@ #include "gui/mrview/tool/tractography/track_scalar_file.h" #include "gui/dialog/file.h" -#include "gui/mrview/colourmap_menu.h" #include "gui/mrview/tool/tractography/tractogram.h" @@ -52,34 +51,7 @@ namespace MR connect (intensity_file_button, SIGNAL (clicked()), this, SLOT (open_intensity_track_scalar_file_slot ())); hlayout->addWidget (intensity_file_button); - // Colourmap menu: - colourmap_menu = new QMenu (tr ("Colourmap menu"), this); - - MRView::create_colourmap_menu (this, colourmap_group, colourmap_menu, colourmap_actions, false, false); - connect (colourmap_group, SIGNAL (triggered (QAction*)), this, SLOT (select_colourmap_slot())); - colourmap_actions[1]->setChecked (true); - - colourmap_menu->addSeparator(); - - show_colour_bar = colourmap_menu->addAction (tr ("Show colour bar"), this, SLOT (show_colour_bar_slot())); - show_colour_bar->setCheckable (true); - show_colour_bar->setChecked (true); - addAction (show_colour_bar); - - invert_scale = colourmap_menu->addAction (tr ("Invert"), this, SLOT (invert_colourmap_slot())); - invert_scale->setCheckable (true); - addAction (invert_scale); - - colourmap_menu->addSeparator(); - - QAction* reset_intensity = colourmap_menu->addAction (tr ("Reset intensity"), this, SLOT (reset_intensity_slot())); - addAction (reset_intensity); - - colourmap_button = new QToolButton (this); - colourmap_button->setToolTip (tr ("Colourmap menu")); - colourmap_button->setIcon (QIcon (":/colourmap.svg")); - colourmap_button->setPopupMode (QToolButton::InstantPopup); - colourmap_button->setMenu (colourmap_menu); + colourmap_button = new ColourMapButton(this, *this, false, false, true); hlayout->addWidget (colourmap_button); vlayout->addLayout (hlayout); @@ -181,10 +153,10 @@ namespace MR min_entry->setValue (tractogram->scaling_min()); max_entry->setValue (tractogram->scaling_max()); - colourmap_menu->setEnabled (true); - colourmap_actions[tractogram->colourmap]->setChecked (true); - show_colour_bar->setChecked (tractogram->show_colour_bar); - invert_scale->setChecked (tractogram->scale_inverted()); + colourmap_button->setEnabled (true); + colourmap_button->set_colourmap_index(tractogram->colourmap); + colourmap_button->set_scale_inverted (tractogram->scale_inverted()); + colourmap_button->set_show_colourbar (tractogram->show_colour_bar); assert (tractogram->intensity_scalar_filename.length()); intensity_file_button->setText (qstr (shorten (Path::basename (tractogram->intensity_scalar_filename), 35, 0))); @@ -260,28 +232,30 @@ namespace MR return scalar_file.size(); } - void TrackScalarFileOptions::show_colour_bar_slot () + void TrackScalarFileOptions::toggle_show_colour_bar(bool show_colour_bar, const ColourMapButton&) { if (tractogram) { - tractogram->show_colour_bar = show_colour_bar->isChecked(); + tractogram->show_colour_bar = show_colour_bar; window().updateGL(); } } - void TrackScalarFileOptions::select_colourmap_slot () + void TrackScalarFileOptions::selected_colourmap (size_t cmap, const ColourMapButton&) { if (tractogram) { - QAction* action = colourmap_group->checkedAction(); - size_t n = 0; - while (action != colourmap_actions[n]) - ++n; - tractogram->colourmap = n; + tractogram->colourmap = cmap; window().updateGL(); } } - + void TrackScalarFileOptions::selected_custom_colour (const QColor& c, const ColourMapButton&) + { + if (tractogram) { + tractogram->set_colour (c); + window().updateGL(); + } + } void TrackScalarFileOptions::set_threshold(GUI::MRView::Tool::TrackThresholdType dataSource, default_type min, default_type max)//TrackThresholdType dataSource { @@ -430,7 +404,7 @@ namespace MR } - void TrackScalarFileOptions::reset_intensity_slot () + void TrackScalarFileOptions::reset_colourmap (const ColourMapButton&) { if (tractogram) { tractogram->reset_windowing(); @@ -440,19 +414,10 @@ namespace MR } - void TrackScalarFileOptions::invert_colourmap_slot () - { - if (tractogram) { - tractogram->set_invert_scale (invert_scale->isChecked()); - window().updateGL(); - } - } - - void TrackScalarFileOptions::set_colourmap (int colourmap_index) + void TrackScalarFileOptions::toggle_invert_colourmap (bool invert, const ColourMapButton&) { if (tractogram) { - tractogram->colourmap = colourmap_index; - update_UI(); + tractogram->set_invert_scale (invert); window().updateGL(); } } diff --git a/src/gui/mrview/tool/tractography/track_scalar_file.h b/src/gui/mrview/tool/tractography/track_scalar_file.h index 1dae8dba89..698716213f 100644 --- a/src/gui/mrview/tool/tractography/track_scalar_file.h +++ b/src/gui/mrview/tool/tractography/track_scalar_file.h @@ -18,6 +18,7 @@ #define __gui_mrtrix_tools_tractography_scalar_file_options_h__ #include "gui/mrview/adjust_button.h" +#include "gui/mrview/colourmap_button.h" #include "gui/mrview/displayable.h" #include "gui/mrview/tool/base.h" #include "gui/mrview/tool/tractography/tractogram_enums.h" @@ -36,7 +37,7 @@ namespace MR class Tractogram; class Tractography; - class TrackScalarFileOptions : public QGroupBox, public DisplayableVisitor + class TrackScalarFileOptions : public QGroupBox, public ColourMapButtonObserver, public DisplayableVisitor { MEMALIGN(TrackScalarFileOptions) Q_OBJECT @@ -51,7 +52,13 @@ namespace MR void update_UI(); void set_scaling(default_type min, default_type max); void set_threshold(GUI::MRView::Tool::TrackThresholdType dataSource, default_type min, default_type max); - void set_colourmap (int colourmap_index); + void set_colourmap (int colourmap_index) { colourmap_button->set_colourmap_index (colourmap_index); } + + void selected_colourmap (size_t, const ColourMapButton&) override; + void selected_custom_colour (const QColor&, const ColourMapButton&) override; + void toggle_show_colour_bar (bool, const ColourMapButton&) override; + void toggle_invert_colourmap (bool, const ColourMapButton&) override; + void reset_colourmap (const ColourMapButton&) override; public slots: bool open_intensity_track_scalar_file_slot (); @@ -59,17 +66,13 @@ namespace MR private slots: - void show_colour_bar_slot(); - void select_colourmap_slot (); void on_set_scaling_slot (); bool threshold_scalar_file_slot (int); void threshold_lower_changed (int unused); void threshold_upper_changed (int unused); void threshold_lower_value_changed (); void threshold_upper_value_changed (); - void invert_colourmap_slot (); - void reset_intensity_slot (); - + protected: Tractography* tool; @@ -78,10 +81,7 @@ namespace MR QGroupBox *colour_groupbox; QAction *show_colour_bar; QAction *invert_scale; - QMenu *colourmap_menu; - QAction **colourmap_actions; - QActionGroup *colourmap_group; - QToolButton *colourmap_button; + ColourMapButton* colourmap_button; QPushButton *intensity_file_button; AdjustButton *max_entry, *min_entry; QComboBox *threshold_file_combobox;