From 02516a2d25ed4c323491a9e313579f641367c6fc Mon Sep 17 00:00:00 2001 From: Jim Pollaro Date: Mon, 31 Aug 2026 09:59:00 -0500 Subject: [PATCH 1/3] add option that whites out scale over/under scale --- +nla/+gfx/+plots/MatrixPlot.m | 4 ++-- +nla/+net/+result/NetworkResultPlotParameter.m | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/+nla/+gfx/+plots/MatrixPlot.m b/+nla/+gfx/+plots/MatrixPlot.m index a43b8ee2..4ca44314 100644 --- a/+nla/+gfx/+plots/MatrixPlot.m +++ b/+nla/+gfx/+plots/MatrixPlot.m @@ -261,13 +261,13 @@ function applyScale(obj, ~, ~, upper_limit_box, lower_limit_box, old_scale, new_ if new_scale == "nla.gfx.ProbPlotMethod.DEFAULT" if ~isequal(color_map, false) - new_color_map = NetworkResultPlotParameter.getColormap(discrete_colors, obj.upper_limit, color_map); + new_color_map = NetworkResultPlotParameter.getColormap(discrete_colors, obj.upper_limit, color_map, obj.app_plot); else new_color_map = obj.color_map; end obj.plot_scale = new_scale; elseif new_scale == "nla.gfx.ProbPlotMethod.LOG" - new_color_map = NetworkResultPlotParameter.getLogColormap(discrete_colors, obj.matrix, obj.upper_limit, color_map); + new_color_map = NetworkResultPlotParameter.getLogColormap(discrete_colors, obj.matrix, obj.upper_limit, color_map, obj.app_plot); obj.plot_scale = new_scale; else color_map_name = str2func(lower(color_map)); diff --git a/+nla/+net/+result/NetworkResultPlotParameter.m b/+nla/+net/+result/NetworkResultPlotParameter.m index f07fb17d..a9c78a9c 100644 --- a/+nla/+net/+result/NetworkResultPlotParameter.m +++ b/+nla/+net/+result/NetworkResultPlotParameter.m @@ -225,7 +225,7 @@ function brainFigureButtonCallback(network1, network2) end methods(Static) - function color_map = getLogColormap(default_discrete_colors, probabilities_input, p_value_max, color_map) + function color_map = getLogColormap(default_discrete_colors, probabilities_input, p_value_max, color_map, white_out) log_minimum = log10(min(nonzeros(probabilities_input.v))); log_minimum = max([-40, log_minimum]); @@ -240,13 +240,15 @@ function brainFigureButtonCallback(network1, network2) if p_value_max ~= 0 color_map = flip(color_map_base(ceil(logspace(log_minimum, 0, default_discrete_colors) .*... default_discrete_colors), :)); - color_map = [color_map; default_color_map]; + if white_out + color_map = [color_map; default_color_map]; + end else color_map = default_color_map; end end - function color_map = getColormap(default_discrete_colors, p_value_max, color_map) + function color_map = getColormap(default_discrete_colors, p_value_max, color_map, white_out) color_map_base = parula(default_discrete_colors); if nargin > 2 color_map_name = str2func(lower(color_map)); @@ -258,7 +260,9 @@ function brainFigureButtonCallback(network1, network2) color_map = default_color_map; else color_map = flip(color_map_base); - color_map = [color_map; default_color_map]; + if white_out + color_map = [color_map; default_color_map]; + end end end end From d7096fa36bb1c9a2700bc35b6d84906c0786ec80 Mon Sep 17 00:00:00 2001 From: Jim Pollaro Date: Mon, 31 Aug 2026 10:15:21 -0500 Subject: [PATCH 2/3] fix all get color map values --- +nla/+net/+result/NetworkResultPlotParameter.m | 4 ++-- +nla/+qualityControl/checkNormalityWithKS.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/+nla/+net/+result/NetworkResultPlotParameter.m b/+nla/+net/+result/NetworkResultPlotParameter.m index a9c78a9c..5a9487dc 100644 --- a/+nla/+net/+result/NetworkResultPlotParameter.m +++ b/+nla/+net/+result/NetworkResultPlotParameter.m @@ -97,7 +97,7 @@ significance_type = "nla.gfx.SigType.INCREASING"; otherwise color_map = nla.net.result.NetworkResultPlotParameter.getColormap(obj.default_discrete_colors,... - p_value_max); + p_value_max, true); end else ranking_statistic = obj.network_test_results.ranking_statistic; @@ -111,7 +111,7 @@ % color_map significance_type = "nla.gfx.SigType.DECREASING"; color_map = nla.net.result.NetworkResultPlotParameter.getColormap(obj.default_discrete_colors,... - p_value_plot_max); + p_value_plot_max, true); end % callback function for brain image. diff --git a/+nla/+qualityControl/checkNormalityWithKS.m b/+nla/+qualityControl/checkNormalityWithKS.m index 3bb8eacb..57000f44 100644 --- a/+nla/+qualityControl/checkNormalityWithKS.m +++ b/+nla/+qualityControl/checkNormalityWithKS.m @@ -60,7 +60,7 @@ function qcKSOutput(ks_result_p_value, edge_test_options, remove_index) [~, p_value_max] = network_test_options.fdr_correction.correct(network_atlas, edge_test_options, ks_result_p_value); color_map = nla.net.result.NetworkResultPlotParameter.getColormap(default_discrete_colors,... - p_value_max); + p_value_max, true); fig = nla.gfx.createFigure(); % Also remember to move this in read the docs From fe637be07580278ae9cc5f3c27fb83d24fc33100 Mon Sep 17 00:00:00 2001 From: Jim Pollaro Date: Mon, 31 Aug 2026 10:16:04 -0500 Subject: [PATCH 3/3] fix getlogcolormap inputs --- +nla/+net/+result/NetworkResultPlotParameter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/+nla/+net/+result/NetworkResultPlotParameter.m b/+nla/+net/+result/NetworkResultPlotParameter.m index 5a9487dc..000ab2fc 100644 --- a/+nla/+net/+result/NetworkResultPlotParameter.m +++ b/+nla/+net/+result/NetworkResultPlotParameter.m @@ -81,7 +81,7 @@ switch obj.updated_test_options.prob_plot_method case "LOG" color_map = nla.net.result.NetworkResultPlotParameter.getLogColormap(obj.default_discrete_colors,... - statistic_input, p_value_max); + statistic_input, p_value_max, true); % Here we take a -log10 and change the maximum value to show on the plot case "NEGATIVE_LOG_10" color_map = parula(obj.default_discrete_colors);