Minimal correct script for sct_run_batch

Hi there,

I’m currently trying to set up a registration pipeline with sct_run_batch and sct_register_multimodal. I have a small piece of the bash script written already and would like to test it before writing the rest. However, whenever I call sct_run_batch -jobs 1 -path-data <path> -path-output "./" -script <script.sh>, all jobs finish/fail instantly. The ./log/ folder is full of ‘err.script_sub_<…>.log’ files, but each of these individual files is completely empty, i.e. no error is returned.

I have tried various inputs for script.sh, the simplest of which was simply

#!/bin/bash
SUBJECT=$1
echo "Hello world!"

which I expect to simply return “Hello world!” in the log file of each subject. I assume I’m doing something wrong in the script, because using this script from the spine-generic repo on my dataset seems to work as intended. What is the minimal functional script required as input to sct_run_batch?

Thanks!
Leander

Hi @Leander,

Thank you for reporting this issue. I can reproduce it and I have opened a ticket. We will work on it with high priority.

@Leander can you please try if this PR solves your problem?

@jcohenadad The PR works great, thanks for the quick fix.

To have ‘an answer’ to this topic: a simple echo suffices as a script.sh; however, you need to ensure that you have execute permissions for this script.

1 Like