Hello,

I am having an issue with imcalc that I cannot quite see where I'm going wrong. 

I want to create image-by-image difference images across my timeseries. I have tried to use the function 'diff(X)' but I keep getting the error '"diff(X)" produced incompatible image.' All the images are from the same timeseries from the same subject.

For reference, here is the batch I've been using.

Any help appreciated!
Bob

matlabbatch{1}.spm.util.imcalc.input = {'myimgs'

                                        };

%%

matlabbatch{1}.spm.util.imcalc.output = 'output';

matlabbatch{1}.spm.util.imcalc.outdir = {'mydir'};

matlabbatch{1}.spm.util.imcalc.expression = 'diff(X)';

matlabbatch{1}.spm.util.imcalc.var = struct('name', {}, 'value', {});

matlabbatch{1}.spm.util.imcalc.options.dmtx = 1;

matlabbatch{1}.spm.util.imcalc.options.mask = 0;

matlabbatch{1}.spm.util.imcalc.options.interp = 1;

matlabbatch{1}.spm.util.imcalc.options.dtype = 4;