Hi,
it also works:
matlabbatch{1}.spm.spatial.coreg.estimate.ref = {LT1};
matlabbatch{1}.spm.spatial.coreg.estimate.source = {LMEAN};
matlabbatch{1}.spm.spatial.coreg.estimate.other = deblank(num2cell(SERIE,2));
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];
where LT1 is the name of the target image, LMEAN is the source image and SERIE is the list of the other images. LT1, LMEAN and SERIE can be the output of the spm_select() command
Carles
El 15/09/2015, a les 13.52, Volkmar Glauche <[log in to unmask]> va escriure:
> Dear Lindsay, dear all,
>
> first, a short answer how to fix your scripts when this message pops up:
>
> "Input file lists to cfg_getfile('filter',...) must be a column cellstr."
>
> You must adjust your scripts so that your file lists are column cellstrings, i.e. if you display your file list variable, it should have a size of N-by-1 and file names should show up one per line. If file names show up (abbreviated or summarised) on one line, you will need to transpose your file list variable before entering it into the batch system or make sure it is created as column cellstr. In MATLAB syntax, your variable should look like this for the batch system:
>
> files = {
> 'file1'
> 'file2'
> };
>
> or when displayed after typing the variable name
>
> files =
>
> 'files1'
> 'files2'
>
> -------------------------------------
> Next, a more technical explanation:
> If you use an un-initialised MATLAB variable and start adding values like this
>
> files{1} = 'file1';
> files{2} = 'file2';
>
> or this
>
> for k = 1:N
> files{k} = sprintf('files%d', k);
> end
>
> MATLAB will create a row cellstr instead of a column cellstr. You will either need to change your scripts like this
>
> files{1,1} = 'file1';
> files{2,1} = 'file2';
>
> or this
>
> for k = 1:N
> files{k,1} = sprintf('files%d', k);
> end
>
> This will force MATLAB to create N rows with just one column instead of one row with N columns. Alternatively, you can unconditionally convert a cellstr array of arbitrary dimensions into a row cellstr with this code
>
> files = files(:);
>
> -----------------------------------------------------------------
> Finally, an explanation why this now triggers an error message:
> Since SPM uses column cellstr variables internally and in the file selectors, this is some kind of implicit default. When running a batch, problems occured when the batch system tried to concatenate a column cellstr returned by an SPM function and a row cellstr variables entered directly. Also, code within the file selector only works correctly on column cellstr inputs. Instead of running into an error or unexpected behaviour late in batch processing, spm_select/cfg_getfile now checks the validity of the inputs before any computation is started.
>
> Best,
>
> Volkmar
Aquest correu electrònic i els annexos poden contenir informació confidencial o protegida legalment i està adreçat exclusivament a la persona o entitat destinatària. Si no sou el destinatari final o la persona encarregada de rebre’l, no esteu autoritzat a llegir-lo, retenir-lo, modificar-lo, distribuir-lo, copiar-lo ni a revelar-ne el contingut. Si heu rebut aquest correu electrònic per error, us preguem que n’informeu al remitent i que elimineu del sistema el missatge i el material annex que pugui contenir. Gràcies per la vostra col·laboració.
Este correo electrónico y sus anexos pueden contener información confidencial o legalmente protegida y está exclusivamente dirigido a la persona o entidad destinataria. Si usted no es el destinatario final o la persona encargada de recibirlo, no está autorizado a leerlo, retenerlo, modificarlo, distribuirlo, copiarlo ni a revelar su contenido. Si ha recibido este mensaje electrónico por error, le rogamos que informe al remitente y elimine del sistema el mensaje y el material anexo que pueda contener. Gracias por su colaboración.
This email message and any documents attached to it may contain confidential or legally protected material and are intended solely for the use of the individual or organization to whom they are addressed. We remind you that if you are not the intended recipient of this email message or the person responsible for processing it, then you are not authorized to read, save, modify, send, copy or disclose any of its contents. If you have received this email message by mistake, we kindly ask you to inform the sender of this and to eliminate both the message and any attachments it carries from your account. Thank you for your collaboration.
|