Dear Lindsay, dear all,
first, a short answer how to fix your scripts when this message pops up:
"Input file lists to cfg_getfile('filter',...) must be a column cellstr."
You must adjust your scripts so that your file lists are column cellstrings, i.e. if you display your file list variable, it should have a size of N-by-1 and file names should show up one per line. If file names show up (abbreviated or summarised) on one line, you will need to transpose your file list variable before entering it into the batch system or make sure it is created as column cellstr. In MATLAB syntax, your variable should look like this for the batch system:
files = {
'file1'
'file2'
};
or when displayed after typing the variable name
files =
'files1'
'files2'
-------------------------------------
Next, a more technical explanation:
If you use an un-initialised MATLAB variable and start adding values like this
files{1} = 'file1';
files{2} = 'file2';
or this
for k = 1:N
files{k} = sprintf('files%d', k);
end
MATLAB will create a row cellstr instead of a column cellstr. You will either need to change your scripts like this
files{1,1} = 'file1';
files{2,1} = 'file2';
or this
for k = 1:N
files{k,1} = sprintf('files%d', k);
end
This will force MATLAB to create N rows with just one column instead of one row with N columns. Alternatively, you can unconditionally convert a cellstr array of arbitrary dimensions into a row cellstr with this code
files = files(:);
-----------------------------------------------------------------
Finally, an explanation why this now triggers an error message:
Since SPM uses column cellstr variables internally and in the file selectors, this is some kind of implicit default. When running a batch, problems occured when the batch system tried to concatenate a column cellstr returned by an SPM function and a row cellstr variables entered directly. Also, code within the file selector only works correctly on column cellstr inputs. Instead of running into an error or unexpected behaviour late in batch processing, spm_select/cfg_getfile now checks the validity of the inputs before any computation is started.
Best,
Volkmar
|