Print

Print


It looks like a bug in your coding.  I'd suggest taking a look at the batch
structure after you've tried to insert the filenames.  If doing something
like this, you should make sure the filenames go into
spm.spatial.coreg.estimate.ref  and spm.spatial.coreg.estimate.source
fields.

Best regards,
-John



On 29 September 2013 02:51, Victoria Klimaj <[log in to unmask]>wrote:

> Hi,
>
> I'm trying to run the coregister step on a series of subjects using a
> script modified from a Coregister batch in SPM 12b. However, I am getting
> an error every time I run it that looks like this:
>
> ------
>
> Running 'Coregister: Estimate'
>
> SPM12b: spm_coreg (v4447)                          20:38:44 - 28/09/2013
> ========================================================================
> Failed  'Coregister: Estimate'
> Operands to the || and &&amp; operators must be convertible to logical
> scalar values.
> In file "/Applications/Matlab/spm12b/spm_coreg.m" (v4447), function
> "loaduint8" at line 229.
> In file "/Applications/Matlab/spm12b/spm_coreg.m" (v4447), function
> "spm_coreg" at line 127.
> In file "/Applications/Matlab/spm12b/config/spm_run_coreg.m" (v4683),
> function "spm_run_coreg" at line 21.
>
> --------
>
> Any idea what this is? A bug, or something I'm doing wrong?
> Everything in my script evaluates when I try to evaluate it line by line,
> except for the last "spm_jobman" line.
>
> The script I'm using is below, if it helps to take a look:
>
> ------
> nrun = 155; % enter the number of runs here
> jobfile = {'/Volumes/USB_AIB/coregister_job.m'};
> jobs = repmat(jobfile, 1, nrun);
> inputs = cell(2, nrun);
> allinputRaf='Volumes/USB_AIB/saferafs/'
> allinputT1='/Volumes/USB_AIB/DICOMsT1/T1Rawunzip'
> load /Volumes/USB_AIB/Order.mat
>
> for crun = 1:nrun
>     inputs{1, crun} =
> cellstr(spm_select('FPList',[allinputRaf,'MOVr1',filesep,Order{crun,1}],'^meanraf.img*'));
> % Coregister: Estimate: Reference Image - cfg_files
>     inputs{2, crun} =
> cellstr(spm_select('FPList',[allinputT1,filesep,Order{crun,1}],'^.img*'));
> % Coregister: Estimate: Source Image - cfg_files
> end
> spm('defaults', 'FMRI');
> spm_jobman('run', jobs, inputs{:});
>
> -------
>
> And the job file is as follows:
>
> matlabbatch{1}.spm.spatial.coreg.estimate.ref = '<UNDEFINED>';
> matlabbatch{1}.spm.spatial.coreg.estimate.source = '<UNDEFINED>';
> matlabbatch{1}.spm.spatial.coreg.estimate.other = {''};
> matlabbatch{1}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi';
> matlabbatch{1}.spm.spatial.coreg.estimate.eoptions.sep = [4 2];
> matlabbatch{1}.spm.spatial.coreg.estimate.eoptions.tol = [0.02 0.02 0.02
> 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001];
> matlabbatch{1}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7];
>
> -----
>
> Any thoughts? I've tried just about everything i can in editing the script
> itself, but everything that I included in the script seems to be working
> fine.
>
> I read in an archived message here that someone had similar problem due to
> the slop being off on their images:
> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=spm;b8b202ec.1308
> Could it be something like that?
>
> Thanks!
> -Victoria
>