Hi Wim,
> I decided to experiment with DARTEL. At the import stage I would like
> to re-use the segmentations I created using the VBM5 toolbox, which
> are somewhat nicer than those created at the DARTEL import stage (see
> attached picture, lower image is DARTEL output). The latter is partly
> because I included a 3d T2 weighted image to automatically generated a
> brain mask in my setup. What would be the easiest way to do this?
The following piece of code (along with the attached file) will apply the
required rigid-body transforms to the images, creating r_*.nii files that
DARTEL can work with. These should all be approximately aligned with each
other. Note that the headers of these files contain two different affine
transform matrices. The main one ensures that the rigidly aligned images
appear to be rigidly aligned, whereas the other encodes a mapping that
theoretically enables the images to be put back into alignment with the
originals.
mat = spm_select(1,'_seg_sn\.mat','Select the segmentation parameters');
P=spm_select(Inf,'image','Select the nice image segments');
odir = '.';
bb = NaN*ones(2,3);
vx = 1.5;
import_for_dartel(mat,P,odir,bb,vx)
It may be an idea to script it all by:
mat = spm_select(Inf,'_seg_sn\.mat','Select the segmentation parameters');
K=3;
P=cell(1,K);
for k=1:K,
P{k}=spm_select(size(mat,1),'image','Select the nice image segments');
end
odir = '.';
bb = NaN*ones(2,3);
vx = 1.5;
for i=1:size(mat,1),
PP = '';
for k=1:3, PP = strvcat(PP,P{k}(i,:)); end
import_for_dartel(mat(i,:),PP,odir,bb,vx)
end
>
> Also as I have quite ok CSF segmentions, would DARTEL benefit from
> including them (in principle)?
It could, providing they are equally nice for all subjects.
All the best,
-John
|