Closed fgfmds closed 5 years ago
Which version are you using? Until 0.2.7 the filename needs to go in the "t1" variable, which will be read by the script. In the current R package at v0.5.0 you can try something like LINDA::linda_predict(filename), or load the library first and then call the function.
I haven't tested the call from Rscript though, you need to find the right way to call it yourself. And btw, please share the correct command if you find it, so I can place it in the readme or wiki.
On Wed, Dec 5, 2018, 7:34 PM fgfmds <notifications@github.com wrote:
I noticed that there is an option in the script to run from the command line. If i try:
Rscript linda_predict.R /path/to/file/filename.nii
I get an error about an unexpected "/".
What am i doing wrong?
Thank you.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dorianps/LINDA/issues/20, or mute the thread https://github.com/notifications/unsubscribe-auth/AIqafewfdB-fWLOitrWoRQzhyqiq4D8Wks5u2GYYgaJpZM4ZFluz .
I have been experimenting with versions 0.2.6 and 0.2.7. I was able to run 0.2.6 from the command line successfully after making a few small modifications to the script.
Here are the changes I made:
Comment out the following lines:
Add the following line:
args = commandArgs(TRUE)
Modify the argument length test section as follows:
if (length(args) < 2) { stop("At least two arguments must be supplied: path to T1 file and path to template", call.=FALSE) } else if (length(args)>=2) { t1 = args[1] scriptdir = args[2] }
Once the changes above are in place, I was able to run the script with the following command:
Rscript /path/to/script/0.2.6/linda_predict.R /path/to/T1/file/filename.nii /path/to/template/dir/
I hope people find this helpful, and thank you again for all your help.
Thank you. Note that we also created a full package with v0.5.0 which would behave like any other R package. But if v0.2.6 is doing the job for you, that's fine, the output should be the same.
The truth is we started testing with LINDA when you were still at version 0.2.6. So we've invested some time and effort into getting things to work under that version. We will probably go to v0.5.0 at some point. Thanks again!
I noticed that there is an option in the script to run from the command line. If i try:
Rscript linda_predict.R /path/to/file/filename.nii
I get an error about an unexpected "/".
What am i doing wrong?
Thank you.