Hello everybody,
we are using spm5 and an batch script to process some data. so far most
parts are working but there seems to be a problem within the attached
code segment. Sometimes files are written, sometimes not. And in every
case no warning or error ist reported. Does anybody know what could be
things to check here? Or is something missing or wrong in the attched
section? Files are existing and created by spm5 itself before it gets here.
We are working with
- Multiprocessor machine
- Debian 5.0.2 64bit,
- Matlab 7.6
- spm5 with latest update (writting nii files instead of hdr/img) By the
way can this be switched somewhere?
Best reguards,
Michael Schildt
% ---------- Normalise
-----------------------------------------------------------------------------------------------------------------
cnt = 1;
for ses =1:numel(runs)
if exist([datapath{sub} subjects{sub} filesep paths{1}
filesep runs{ses}])==7
try
[Files,Dirs] = spm_list_files([datapath{sub}
subjects{sub} filesep paths{1} filesep runs{ses}],'*.nii');
Files = [repmat([datapath{sub} subjects{sub} filesep
paths{1} filesep runs{ses} filesep],size(Files,1),1) Files];
BoundingBox = reshape(double([-79 79 -113 78 -66
95]),[2,3]);
jobs{1}.spatial{1}.normalise{1}.write.roptions.vox
= fnResolution;
jobs{1}.spatial{1}.normalise{1}.write.roptions.bb =
BoundingBox;
jobs{1}.spatial{1}.normalise{1}.write.roptions.preserve =
reshape(double([0]),[1,1]);
jobs{1}.spatial{1}.normalise{1}.write.roptions.interp =
reshape(double([1]),[1,1]);
jobs{1}.spatial{1}.normalise{1}.write.roptions.wrap
= reshape(double([0 0 0]),[1,3]);
jobs{1}.spatial{1}.normalise{1}.write.subj.matname{1} = {[datapath{sub}
subjects{sub} filesep paths{1} filesep subjects{sub}
'_meanEPI_seg_sn.mat']};
for file = 1:size(Files,1)
jobs{1}.spatial{1}.normalise{1}.write.subj.resample{cnt} = [Files(file,:)];
cnt = cnt+1;
end
end
end
end
spm_jobman('run',jobs)
cnt = 1;
jobs{1}.spatial{1}.normalise{1}.write.roptions.bb = BoundingBox;
jobs{1}.spatial{1}.normalise{1}.write.roptions.preserve =
reshape(double([0]),[1,1]);
jobs{1}.spatial{1}.normalise{1}.write.roptions.interp =
reshape(double([1]),[1,1]);
jobs{1}.spatial{1}.normalise{1}.write.roptions.wrap =
reshape(double([0 0 0]),[1,3]);
jobs{1}.spatial{1}.normalise{1}.write.subj.matname{1} =
{[datapath{sub} subjects{sub} filesep paths{1} filesep subjects{sub}
'_meanEPI_seg_sn.mat']};
jobs{1}.spatial{1}.normalise{1}.write.roptions.vox = [1 1 1];
jobs{1}.spatial{1}.normalise{1}.write.subj.resample{cnt} =
[datapath{sub} subjects{sub} filesep paths{1} filesep subjects{sub}
'_meanEPI.nii'];
if numel(structurals)>0
[source,Dirs] = spm_list_files([datapath{sub} subjects{sub}
filesep structurals{1}],'*.nii');
jobs{1}.spatial{1}.normalise{1}.write.subj.resample{cnt} =
[datapath{sub} subjects{sub} filesep structurals{1} filesep source];
end
spm_jobman('run',jobs)
|