New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce use of display_viewer_syntax
in four scripts using hardcoded fsleyes
commands
#3895
Enforce use of display_viewer_syntax
in four scripts using hardcoded fsleyes
commands
#3895
Conversation
This one isn't an exact 1:1 translation, as before, the old command simply put `fname_mask` without any colormap/opacity information. The default FSLeyes settings, though, are grayscale ('gray') and opaque ('1.0'), so specifying these values will produce identical results in the viewer.
…mand This one isn't an exact 1:1 translation, as before, the old command simply put `arguments.i` without any colormap/opacity information. The default FSLeyes settings, though, are grayscale ('gray') and opaque ('1.0'), so specifying these values will produce identical results in the viewer. Additionally, because `fname_out_lst` has variable length, we also set variable-length colormap and opacity lists, too.
This one is very straightforward, with no colormaps/opacities needed.
sct_resample expected a `.nii` file, but sct_smooth_spinalcord generated a `.nii.gz` file, so update the internal commands
…hardcoded command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, including figuring out the missing grayscale and opacity parameters.
We might want to reflect on whether or not these isct_ scripts are worth maintaining. If they are, we should fix them up and turn them into a properly formatted + tested sct_ scripts. If they aren't, then we should move them to dev/.))
Good question, this is worth discussing at the next dev meeting. In particular, your bugfix of the isct_convert_binary_to_trilinear
means that this script has been completely broken for quite some time, so I can't imagine it gets much use.
Out of scope for this PR: I'm a bit surprised that sct_smooth_spinalcord
produces a .nii.gz
even when the input is a plain .nii
file. Is this intended? My impression from the existence of Image.add_suffix()
is that we usually try to match input and output formats. As a further aside, Image.add_suffix()
uses an almost-but-not-quite-identical implementation of utils.sys.extract_fname()
, which puzzles me.
Description
Most SCT scripts use a function called
display_viewer_syntax
at the end of processing. This function searches for the presence of image viewing software likefsleyes
oritksnap
, then outputs commands that let the user open output files in those viewers.However, some scripts still hardcode a command for
fsleyes
/fslview
. So, this PR replaces those commands withdisplay_viewer_syntax
.Linked issues
Fixes #3883.