Skip to content

Commit

Permalink
Merge pull request #890 from EmmaRenauld/robustify_coloring
Browse files Browse the repository at this point in the history
Robustify the coloring
  • Loading branch information
arnaudbore authored Feb 6, 2024
2 parents 21ee7e4 + 17d7a10 commit 5dcf990
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion scripts/scil_tractogram_assign_custom_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ def main():
data = np.clip(data, np.quantile(data, 0.05),
np.quantile(data, 0.95))
elif args.use_dpp:
data = np.squeeze(sft.data_per_point[args.use_dpp]._data)
tmp = [np.squeeze(sft.data_per_point[args.use_dpp][s]) for s in
range(len(sft))]
data = np.hstack(tmp)
elif args.load_dps:
data = np.squeeze(load_matrix_in_any_format(args.load_dps))
if len(data) != len(sft):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def test_help_option(script_runner):
ret = script_runner.run('scil_assign_custom_color_to_tractogram.py',
ret = script_runner.run('scil_tractogram_assign_custom_color.py',
'--help')
assert ret.success

Expand All @@ -24,7 +24,7 @@ def test_execution_tractometry(script_runner):
'IFGWM.trk')
in_anat = os.path.join(get_home(), 'tractometry',
'IFGWM_labels_map.nii.gz')
ret = script_runner.run('scil_assign_custom_color_to_tractogram.py',
ret = script_runner.run('scil_tractogram_assign_custom_color.py',
in_bundle, 'colored.trk', '--from_anatomy',
in_anat)
assert ret.success
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def test_help_option(script_runner):
ret = script_runner.run('scil_assign_uniform_color_to_tractograms.py',
ret = script_runner.run('scil_tractogram_assign_uniform_color.py',
'--help')
assert ret.success

Expand All @@ -22,7 +22,7 @@ def test_execution_tractometry(script_runner):
os.chdir(os.path.expanduser(tmp_dir.name))
in_bundle = os.path.join(get_home(), 'tractometry',
'IFGWM.trk')
ret = script_runner.run('scil_assign_uniform_color_to_tractograms.py',
ret = script_runner.run('scil_tractogram_assign_uniform_color.py',
in_bundle, '--fill_color', '0x000000',
'--out_tractogram', 'colored.trk')
assert ret.success

0 comments on commit 5dcf990

Please sign in to comment.