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

wb_command’ is not an internal or external command, nor is it a runnable programme #12

Open
SuperLuckyKris opened this issue Dec 16, 2024 · 5 comments

Comments

@SuperLuckyKris
Copy link

coord_file = cifti_read(‘E:\Desktop\GII\two\two\sub-070_space-fsLR_den-91k_curv.dscalar.nii’);
‘wb_command’ is not an internal or external command, nor is it a runnable programme
or batch file.
Error using my_system
command failed: ‘wb_command -file-convert -cifti-version-convert E:\Desktop\GII\two\two\sub-070_space-fsLR_den-91k_curv.dscalar.nii 2
C:\Users\ASUS\AppData\Local\Temp\tp8e1c5aea_186c_45cb_a5d3_d3b0bd362e30.sub-070_space-fsLR_den-91k_curv.dscalar.nii’

Error cifti_read (line 41)
my_system([options.wbcmd ‘ -file-convert -cifti-version-convert “ filename ” 2 ’ tmpfile]).

Translated with DeepL.com (free version)

@SuperLuckyKris
Copy link
Author

Simply configure wb_command, then run
wb_command -file-convert -cifti-version-convert E:\Desktop\GII\two\two\sub-070_space-fsLR_den-91k_curv.dscalar.nii 2 E:\Desktop\GII\two\two\sub-070.dscalar.nii \two\sub-070.dscalar.nii
Then a new sub-070.dscalar.nii will be generated
It will be straightforward to use coord_file = ciftiopen(‘sub-070.dscalar.nii’);

@coalsont
Copy link
Member

If wb_command is on your shell's PATH (or you specify the full path to it with cifti_read(..., 'wbcmd', '<PATH>/wb_command'), cifti_read will automatically do the conversion for you, so you don't have to do it manually.

How did you end up with a cifti-1 file? We switched to cifti-2 before the major HCP YA releases. There also should have been a warning printed by cifti_read that the file wasn't version 2 and that it would attempt to convert it, which is not in the output you pasted...

@SuperLuckyKris
Copy link
Author

If wb_command is on your shell's PATH (or you specify the full path to it with cifti_read(..., 'wbcmd', '<PATH>/wb_command'), cifti_read will automatically do the conversion for you, so you don't have to do it manually.

How did you end up with a cifti-1 file? We switched to cifti-2 before the major HCP YA releases. There also should have been a warning printed by cifti_read that the file wasn't version 2 and that it would attempt to convert it, which is not in the output you pasted...

Here's the full message of the error
image
I have configured the wb_command environment
image

@coalsont
Copy link
Member

Open a new matlab instance and it should pick up the new PATH that has wb_command, and it should be able to load the file directly.

How did you get a cifti-1 file? Virtually everything publicly available should be cifti-2, including the default output of tools.

Not sure why this warning didn't show up in your output, did you modify the code?

warning(['cifti file "' filename '" appears to not be version 2, converting using wb_command...']);

@SuperLuckyKris
Copy link
Author

Open a new matlab instance and it should pick up the new PATH that has wb_command, and it should be able to load the file directly.

How did you get a cifti-1 file? Virtually everything publicly available should be cifti-2, including the default output of tools.

Not sure why this warning didn't show up in your output, did you modify the code?

warning(['cifti file "' filename '" appears to not be version 2, converting using wb_command...']);

This file was given to me by my mentor, the source code I tried to modify this place to system([options.wbcmd ‘ -file-convert -cifti-version-convert “ filename ” 2 ’ tmpfile]); I found that it still reported an error, so I ran the cmd command manually
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants