Skip to content
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

viewer syntax at the end does not provide correct output file name #4478

Closed
jcohenadad opened this issue May 14, 2024 · 1 comment · Fixed by #4480
Closed

viewer syntax at the end does not provide correct output file name #4478

jcohenadad opened this issue May 14, 2024 · 1 comment · Fixed by #4480
Assignees
Labels
bug category: fixes an error in the code sct_apply_transfo context:
Milestone

Comments

@jcohenadad
Copy link
Member

while working on #4477 I noticed that the output syntax of sct_apply_transfo is missing the output file name:

julien-macbook:~/temp/Lydia/results_20240430_225215/data_processed/sub-BB277/anat $ sct_apply_transfo -i sub-BB277_T2_straight.nii.gz -d sub-BB277_T2.nii.gz -w warp_straight2curve.nii.gz 

--
Spinal Cord Toolbox (git-master-4e3b9ebbbd6672169a8bdfd9c5fde4b81716eaa7)

sct_apply_transfo -i sub-BB277_T2_straight.nii.gz -d sub-BB277_T2.nii.gz -w warp_straight2curve.nii.gz
--


Parse list of warping fields...

Get dimensions of data...
  63 x 89 x 318 x 1

Apply transformation...

Apply transformation and resample to destination space...
/Users/julien/code/spinalcordtoolbox/bin/isct_antsApplyTransforms -d 3 -i sub-BB277_T2_straight.nii.gz -o sub-BB277_T2_straight_reg.nii.gz -t warp_straight2curve.nii.gz -r sub-BB277_T2.nii.gz -n 'BSpline[3]' # in /Users/julien/temp/Lydia/results_20240430_225215/data_processed/sub-BB277/anat
Copy affine matrix from destination space to make sure qform/sform are the same.

Done! To view results, type:
fsleyes sub-BB277_T2.nii.gz . &

Notice the last line. I would expect to see this instead:

fsleyes sub-BB277_T2.nii.gz sub-BB277_T2_straight_reg.nii.gz &
@jcohenadad jcohenadad added bug category: fixes an error in the code sct_apply_transfo context: labels May 14, 2024
@joshuacwnewton joshuacwnewton self-assigned this May 14, 2024
@joshuacwnewton
Copy link
Member

Thanks for catching this! I'll fix this ASAP.

@joshuacwnewton joshuacwnewton added this to the 6.4 milestone May 14, 2024
mguaypaq pushed a commit that referenced this issue May 15, 2024
… `-o` is not passed (#4480)

The fallback filename (`{fname_in}_reg`) was only set inside the context
of the `Transform` class. Meaning, if `-o` wasn't passed, then the
`fsleyes` command would display a blank filename. So, I moved setting
`fname_out` to before we call `Transform`, which is more in line with
our API/CLI separation conventions anyway.

(Side note: I notice that our variable naming conventions are all over
the place for this module (`fname`, `file`, `filename`, etc.). Maybe
that's worth tidying up in this PR, too?)

Fixes #4478.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: fixes an error in the code sct_apply_transfo context:
Projects
None yet
2 participants