Back to the main page.

Bug 3255 - align_ctf2spm does not support spm12

Reported 2017-02-17 00:50:00 +0100
Modified 2019-08-10 12:42:07 +0200
Product: FieldTrip
Component: external
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Arjen Stolk
Depends on: 3228
See also:

Arjen Stolk - 2017-02-17 00:50:00 +0100

Because there is no template in the mini spm12 version. I have copied over the spm8 template. Also added another spm function (spm_check_version.m), and adjusted align_ctf2_spm.m to accomodate the spm8 template. So it runs now. However, ideally we use the spm12 template instead of the spm8 template. In order to use an spm12 template, we need to know which file it is going to be. SPM12 has a folder called 'canonical'. Potential candidates include the files of single_subj_T1.nii, avg152T1.nii, and avg305T1.nii. There is also the folder 'toolbox', with subfolder 'OldNorm' including the file of T1.nii. Does anyone know which file we need?

Robert Oostenveld - 2017-02-17 09:05:56 +0100

Agreed: we have to find out which spm12 template to use. single_subj_T1 is definitely not it. canonical/avg152 is reasonably crisp, avg305 is more blurry, but OldNorm/T1 is even more blurry. I suspect the last one to have been convolved with a smoothing kernel. The T1 also covers the top of the head better. ... the spm12 OldNorm/T1 is the same as the spm8/templates/T1. I asked a room mate (spm8 user). Together we think that in spm12 the wish is to move to Dartel rather than the old (but still supported) normalization method. I think Bruno (CC) would know. How about including it (and only that file) as fieldtrip/external/spm12/toolbox/OldNorm/T1.nii and point to that location in ft_volumenormalise line 137.

Robert Oostenveld - 2017-02-17 09:07:02 +0100

(In reply to Robert Oostenveld from comment #1) i.e. my idea is that our mini-spm12 should retain the exact structure of spm12, but simply comprise a subset.

Arjen Stolk - 2017-02-17 17:44:33 +0100

Agreed, and thanks for the swift response. Will do as suggested and adjust my PR.

Arjen Stolk - 2017-02-18 03:20:38 +0100

References to the spm12 template have been updated/added, in align_ctf2spm and ft_volumenormalise. However, this does not imply that both functions now fully support spm12. Namely, both ft_volumenormalise and align_ctf2spm (with opt=2) call 'spm_normalise', a function that is not present in spm12. Similarly, 'spm_affreg' is not present but called by align_ctf2spm with opt=1. This issue is related to the DARTEL implementation, which is currently under construction. As soon DARTEL (spm12) is implemented in ft_volumenormalise, align_ctf2spm needs to be updated accordingly.

Robert Oostenveld - 2017-02-20 09:09:59 +0100

I have merged into the master. The correct template is now selected by default, and an informative error is given that spm12 is not yet supported.

Arjen Stolk - 2017-02-20 20:14:28 +0100


Robert Oostenveld - 2019-08-10 12:35:52 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on

Robert Oostenveld - 2019-08-10 12:42:07 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on