Batchmode without GUI

Optionally you can use ‘cg_vbm_batch.sh’ to call the VBM5 segmentation from the unix command line without using the Matlab or SPM graphical interface. In order to use this function, you have to check the parameters in cg_vbm_batch.sh:

Name Comment
spm5=~/spm/spm5 this parameter has to be set to your spm5 directory
matlab=matlab you can use other matlab versions by changing the matlab parameter

Alternatively, you can set these parameters while calling the shell script.

Usage

cg_vbm_batch.sh filename|filepattern [-s spm5-path] [-m matlabcommand]

-m matlab command
-s spm5 directory

Only one filename or pattern is allowed. This can be either a single file or a pattern
with wildcards to process multiple files. For the latter case you have to (single) quote
the pattern. Optionally you can set the spm5 directory with the “-s” option and the
matlab command with the “-m” option.

Example

cg_vbm_batch.sh spm/spm5/canonical/single_subj_T1.nii -s ~/spm/spm5
This command will process only the single file single_subj_T1.nii. The spm5 directory
is set to ~/spm/spm5.

cg_vbm_batch.sh 'spm/spm5/canonical/*152*.nii'
Using the quotes and wildcards all files containing the term “152” will
be processed. In this case these are the files avg152PD.nii, avg152T1.nii,
and avg152T2.nii.

cg_vbm_batch.sh 'spm/spm5/canonical/*152*.nii' -m /usr/local/bin/matlab7
Using the quotes and wildcards all files containing the term “152” will
be processed. In this case these are the files avg152PD.nii, avg152T1.nii,
and avg152T2.nii. As matlab command /usr/local/bin/matlab7 will be used.

Output

segmented images according to settings in cg_vbm_defaults.m
vbm_log_$time.txt for log information