From dcf455898b0ee33712d9c22cc656c4d045842797 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Fri, 31 Oct 2025 10:09:38 -0400 Subject: [PATCH 1/2] Adding option in custom-color for coverage --- src/scilpy/cli/scil_tractogram_assign_custom_color.py | 5 +++-- src/scilpy/cli/tests/test_tractogram_assign_custom_color.py | 3 ++- src/scilpy/viz/color.py | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/scilpy/cli/scil_tractogram_assign_custom_color.py b/src/scilpy/cli/scil_tractogram_assign_custom_color.py index 78ecefc09..e4e86f048 100755 --- a/src/scilpy/cli/scil_tractogram_assign_custom_color.py +++ b/src/scilpy/cli/scil_tractogram_assign_custom_color.py @@ -119,8 +119,9 @@ def _build_arg_parser(): 'approximation. Default if set is 4.') g2.add_argument('--colormap', default='jet', help='Select the colormap for colored trk (dps/dpp) ' - '[%(default)s].\nUse two Matplotlib named color separeted ' - 'by a - to create your own colormap.') + '[%(default)s].\nYou may also two Matplotlib named colors ' + 'separeted by a - to create your own colormap. ' + 'Ex: red-blue.') g2.add_argument('--clip_outliers', action='store_true', help="If set, we will clip the outliers (first and last " "5%% quantile). Strongly suggested if your data " diff --git a/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py index 66cdb82f4..c52ad4b04 100644 --- a/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py @@ -38,7 +38,8 @@ def test_execution_along_profile(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_assign_custom_color', - in_bundle, 'colored2.trk', '--along_profile']) + in_bundle, 'colored2.trk', '--along_profile', + '--colormap', 'red-blue']) assert ret.success diff --git a/src/scilpy/viz/color.py b/src/scilpy/viz/color.py index a76159b25..9a4b4ac11 100644 --- a/src/scilpy/viz/color.py +++ b/src/scilpy/viz/color.py @@ -87,8 +87,9 @@ def get_lookup_table(name): Parameters ---------- name : str - Name of the lookup table (colormap) or a list of named colors - (separated by a -) to form a lookup table (colormap) from. + Name of the lookup table (colormap), ex, jet, or: + Two named colors separated by a -, ex, red-blue, to form a lookup + table (colormap) from. Returns ------- From ff84034737c5fc4aa74a43b322691802ef0bfc7e Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Fri, 31 Oct 2025 12:26:36 -0400 Subject: [PATCH 2/2] Fix typo --- src/scilpy/cli/scil_tractogram_assign_custom_color.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scilpy/cli/scil_tractogram_assign_custom_color.py b/src/scilpy/cli/scil_tractogram_assign_custom_color.py index e4e86f048..a754d7fa2 100755 --- a/src/scilpy/cli/scil_tractogram_assign_custom_color.py +++ b/src/scilpy/cli/scil_tractogram_assign_custom_color.py @@ -119,8 +119,8 @@ def _build_arg_parser(): 'approximation. Default if set is 4.') g2.add_argument('--colormap', default='jet', help='Select the colormap for colored trk (dps/dpp) ' - '[%(default)s].\nYou may also two Matplotlib named colors ' - 'separeted by a - to create your own colormap. ' + '[%(default)s].\nYou may also use two Matplotlib named ' + 'colors separated by a "- to\n create your own colormap. ' 'Ex: red-blue.') g2.add_argument('--clip_outliers', action='store_true', help="If set, we will clip the outliers (first and last "