Hi Hwee Ling,
Try replacing:
tmp1{1} = spm_select('List',folData{ses},'^fA^*.*img');
with:
tmp1{1} = cellstr(spm_select('List',folData{ses},'^fA.*img'));
I can't guarantee that it will work, but it should be a step in the right
direction.
All the best,
-John
On Thursday 25 October 2007 11:50, HweeLing Lee wrote:
> Hi,
>
> I received an error message while running the script.
>
> Script:
> jobs{1}.spatial{1}.realignunwarp.eoptions.quality =
> defaults.realign.estimate.quality ;
> jobs{1}.spatial{1}.realignunwarp.eoptions.fwhm = 5 ;
> jobs{1}.spatial{1}.realignunwarp.eoptions.rtm = 1 ;
> jobs{1}.spatial{1}.realignunwarp.eoptions.einterp =
> defaults.realign.estimate.interp ;
> jobs{1}.spatial{1}.realignunwarp.eoptions.ewrap = [0 0 0] ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.basfcn =
> defaults.unwarp.estimate.basfcn ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.regorder =
> defaults.unwarp.estimate.regorder ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.lambda =
> defaults.unwarp.estimate.regwgt ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.jm =
> defaults.unwarp.estimate.jm ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.fot = [4 5] ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.sot = [] ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.uwfwhm =
> defaults.unwarp.estimate.fwhm ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.rem =
> defaults.unwarp.estimate.rem ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.noi =
> defaults.unwarp.estimate.noi ;
> jobs{1}.spatial{1}.realignunwarp.uweoptions.expround =
> defaults.unwarp.estimate.expround ;
> jobs{1}.spatial{1}.realignunwarp.uwroptions.uwwhich = [2 1] ;
> jobs{1}.spatial{1}.realignunwarp.uwroptions.rinterp =
> defaults.realign.write.interp ;
> jobs{1}.spatial{1}.realignunwarp.uwroptions.wrap = [0 0 0] ;
> jobs{1}.spatial{1}.realignunwarp.uwroptions.mask =
> defaults.realign.write.mask ;
> % load of images
> for ses=1:nses
> tmp1 = [] ;
> tmp2 = [] ;
> tmp1{1} = spm_select('List',folData{ses},'^fA^*.*img');
> if isempty(tmp1{1}) % try lower case names for files
> tmp1{1} = spm_select('List',folData{ses},'^fA^*.*img');
> end
> for ttt=1:size(tmp1{1},1)
> tmp2{1}(ttt,:) = fullfile(folData{ses}, tmp1{1}(ttt,:));
> end
> jobs{1}.spatial{1}.realignunwarp.data(ses).scans = (tmp2{1}) ;
> jobs{1}.spatial{1}.realignunwarp.data(ses).pmscan = {''} ;
> end
> disp(sprintf('##### realigning (coregestring)........ and unwarping
> (and reslicing)........'))
> spm_jobman('run' , jobs) ;
> clear jobs ;
>
> error message:
> ###############################################################
> preprocessing of subject number 1.........
> ###############################################################
> D:\fMRI_Data\AVI01\AVI01_S02\session1
> D:\fMRI_Data\AVI01\AVI01_S02\session2
> D:\fMRI_Data\AVI01\AVI01_S02\session3
> D:\fMRI_Data\AVI01\AVI01_S02\session4
> ??? Cell contents reference from a non-cell array object.
>
> Error in ==> preproc at 82
> jobs{1}.spatial{1}.realignunwarp.data(ses).scans = (tmp2{1}) ;
>
> Would appreciate if someone to point out the error of the script.
>
> Many thanks.
|