It looks like there is a problem writing the image data to disk. I suggest: 1) Checking disk space. 2) Checking disk quota. 3) Checking whether you have write permission for that file or directory. 4) Checking that the file system is mounted read/write. Best regards, -John On 21 April 2011 18:51, Simon Vandekar <[log in to unmask]> wrote: > Hi SPM experts, > > I am interested in including DARTEL as part of our batch processing. > Is there a main function that I can include in out batch scripts that will run the dartel create templates process? > > At the moment I am running spm_dartel_template with the required input, but I am getting this error in response and it doesn't seem to complete making the u_rc1r*.nii file: > > ??? Error using ==> mat2file > Problem writing data (1). > > Error in ==> file_array.subsasgn>subfun at 132 > mat2file(sobj,dat,va{:}); > > Error in ==> file_array.subsasgn at 73 > subfun(sobj,dat1,args{:}); > > Error in ==> nifti.subsasgn>fun at 74 > val = subsasgn(obj.dat,subs(2:end),val); > > Error in ==> nifti.subsasgn at 20 > obji = fun(obji,subs,val); > > Error in ==> nifti.subsasgn at 37 > obji = subsasgn(obji,subs(2:end),val); > > Error in ==> spm_dartel_template at 95 > NU(i).dat(:,:,:,:,:) = 0; > > > Thanks once again for your help with this one, > > Simon >