Spatial normalisation usually begins with a 12-parameter affine
registration, but this is usually using a mean squared difference
objective function. For aligning across modality, you'll need to use
a different approach because the image contrast in a perfusion map is
very different to that of an MPRAGE.
There is a hidden option for the Coregistration, which allows it to
use 12 parameters. I generally leave the option hidden because it is
not so stable. The modified code snippet below may work (depending
whether or not matlabbatch strips off any fields it does not
recognise)...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% using standard spm coreg settings
matlabbatch{1}.spm.spatial.coreg.estwrite.ref = {files.coreg_fix};
matlabbatch{1}.spm.spatial.coreg.estwrite.source = {files.coreg_mov};
matlabbatch{1}.spm.spatial.coreg.estwrite.other = {''};
matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.cost_fun = 'nmi';
% Supply 12 starting estimate parameters
matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.params = ...
[0 0 0 0 0 0 1 1 1 0 0 0];
matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.sep = [4 2];
matlabbatch{1}.spm.spatial.coreg.estwrite.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.estwrite.eoptions.fwhm = [7 7];
matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.graphics = 0;
matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.interp = 1;
matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.wrap = [0 0 0];
matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.mask = 1;
matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.prefix = coreg_file_prefix;
inputs = cell(0,1);
evalc(['spm_jobman(' '''' 'serial' '''' ',matlabbatch,' '''' ''''
',inputs{:})']);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
If it doesn't help, you may need to do a bit of extra coding to call
spm_coreg directly (see config/spm_run_coreg.m for syntax etc) with
the eoptions.params field.
Best regards,
-John
On 10 October 2012 15:04, André Ahlgren <[log in to unmask]> wrote:
> Hi!
>
>
>
> I am currently using SPM8 (spm8_r4290) for a coregistration using the
> spm_jobman-function. Since I coregister a MR-perfusion map to a MPRAGE
> (standard nii-files), I feel that the 6 parameter linear coregistration does
> not suffice, and would therefore want to perform a 12 parameter (affine)
> registration. I have seen references to this in some various literature
> regarding SPM (I know that the first part of the normalization consists of a
> 12-degree affine coregistration), but have not been able to execute one
> myself. Can I somehow do it from a matlab-batch-script?
>
>
>
> Here is the code (sorry for the horrible use of evalc):
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> % using standard spm coreg settings
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.ref = {files.coreg_fix};
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.source = {files.coreg_mov};
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.other = {''};
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.cost_fun = 'nmi';
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.sep = [4 2];
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.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.estwrite.eoptions.fwhm = [7 7];
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.eoptions.graphics = 0;
>
>
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.interp = 1;
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.wrap = [0 0 0];
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.mask = 1;
>
> matlabbatch{1}.spm.spatial.coreg.estwrite.roptions.prefix =
> coreg_file_prefix;
>
> inputs = cell(0,1);
>
>
>
> evalc(['spm_jobman(' '''' 'serial' '''' ',matlabbatch,' '''' ''''
> ',inputs{:})']);
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
>
>
>
> With regards,
>
> André Ahlgren
>
>
>
> ___________________________________________
>
>
>
> André Ahlgren
>
> Department of Medical Radiation Physics
>
> Barngatan 2:1
>
> Lund University
>
> SE-221 85 Lund, Sweden
>
>
>
> Phone: +46 46 173132
> Mobile: +46 735 749052
>
>
|