17#ifndef __gui_mrview_tool_fixel_fixelimage_h__
18#define __gui_mrview_tool_fixel_fixelimage_h__
20#include <unordered_map>
50 class Shader :
public Displayable::Shader {
MEMALIGN (Shader)
53 std::string vertex_shader_source (
const Displayable&)
override;
54 std::string geometry_shader_source (
const Displayable&)
override;
55 std::string fragment_shader_source (
const Displayable&)
override;
56 virtual bool need_update (
const Displayable&)
const override;
59 bool do_crop_to_slice, bidirectional;
72 void load_image (
const std::string &
filename);
74 void reload_directions_buffer ();
76 void reload_colours_buffer ();
78 void reload_values_buffer ();
80 void reload_threshold_buffer ();
82 void set_line_length_multiplier (
float value) {
83 user_line_length_multiplier =
value;
86 float get_line_length_multiplier ()
const {
87 return user_line_length_multiplier;
90 void set_line_thickness (
float value) {
91 line_thickness =
value;
94 float get_line_thickenss ()
const {
95 return line_thickness;
98 size_t get_scale_type_index ()
const {
102 void set_scale_type_index (
size_t index)
111 size_t get_threshold_type_index ()
const {
115 void set_threshold_type_index (
size_t index)
120 lessthan = get_threshold_lower ();
121 greaterthan = get_threshold_upper ();
128 size_t get_colour_type_index ()
const {
132 void set_colour_type_index (
size_t index) {
134 fixel_val.current_min = std::isfinite (scaling_min ()) ? scaling_min () : fixel_val.current_min;
135 fixel_val.current_max = std::isfinite (scaling_max ()) ? scaling_max () : fixel_val.current_max;
147 lessthan = get_threshold_lower ();
148 greaterthan = get_threshold_upper ();
150 set_windowing (new_fixel_val.current_min, new_fixel_val.current_max);
157 float get_threshold_lower ()
const {
163 float get_unscaled_threshold_lower ()
const {
167 void set_threshold_lower (
float value) {
171 lessthan = get_threshold_lower ();
174 float get_threshold_upper ()
const {
180 float get_unscaled_threshold_upper ()
const {
184 void set_threshold_upper (
float value) {
188 greaterthan = get_threshold_upper ();
191 float get_unscaled_threshold_rate ()
const {
198 for (
size_t i = 0, N =
colour_types.size (); i < N; ++i)
206 combo_box.addItem (
qstr (value_name));
212 for (
size_t i = 1, N =
value_types.size (); i < N; ++i)
217 bool has_values ()
const {
226 return (v[0] + (v[1] << 10) + (v[2] << 20));
302 float voxel_size_length_multipler;
303 float user_line_length_multiplier;
304 float line_thickness;
virtual void render_fixel_colourbar(const Tool::BaseFixel &)
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
QString qstr(const std::string &s)