At around line 29, try changing the code to
df = [size(Nf.dat),1,1]; % Dimensions of data
dg = [size(Ng.dat),1,1]; % Dimensions of data
The reason for the crash is that when the algorithm asks the size of a
variable, MATLAB gives a vector of length equal to the number of dimensions.
Usually, the data are 4D but yours were only 3D, so the 'df' variable
contained only three elements and the code didn't know that the 4th (5th, 6th
etc) dimensions should be 1.
This will be fixed in the next updates.
All the best,
On Tuesday 26 May 2009 07:02, Darren Gitelman wrote:
> I am having difficulty using the "normalize to MNI space" function of
> The steps I've taken are as follows
> 1) Import seg_sn.mat files
> 2) Create template: I used just the rc1 files.
> 3) Normalise to MNI space- Selected c1Template6. Selected the flow
> fields and selected the rc1 images.
> It produces this error
> Running 'Normalise to MNI Space'
> ** Affine registering "c1Template_6" with MNI space **
> Failed 'Normalise to MNI Space'
> Attempted to access df(4); index out of bounds because numel(df)=3.
> In file "/usr/local/imsw/SPM/spm8/toolbox/DARTEL/spm_klaff.m" (v3053),
> function "spm_klaff" at line 32.
> In file "/usr/local/imsw/SPM/spm8/toolbox/DARTEL/spm_dartel_norm_fun.m"
> (v3032), function "spm_dartel_norm_fun" at line 94.
> The following modules did not run:
> Failed: Normalise to MNI Space
> Darren Gitelman