Dear Markus,
Render>Display is indeed the right way to overlay thresholded SPMs on a
surface mesh. If you have well defined blobs in the MIP but nothing on
the mesh, I can think of two potential pitfalls:
1/ your handcrafted mesh is not in the same space than your SPM (eg
single subject space vs MNI). You can adapt the following code (borrowed
from spm_eeg_inv_checkmeshes) to check the coregistration:
N = nifti(fullfile(spm('Dir'),'canonical','single_subj_T1.nii'));
pls = 0.05:0.2:0.9;
d = size(N.dat);
pls = round(pls.*d(3));
hold on
for i=1:numel(pls),
[x,y,z]=ndgrid(1:d(1),1:d(2),pls(i));
f1 = N.dat(:,:,pls(i));
M = N.mat;
x1 = M(1,1)*x+M(1,2)*y+M(1,3)*z+M(1,4);
y1 = M(2,1)*x+M(2,2)*y+M(2,3)*z+M(2,4);
z1 = M(3,1)*x+M(3,2)*y+M(3,3)*z+M(3,4);
s = surf(x1,y1,z1,f1);
set(s,'EdgeColor','none')
end
axis image off;
colormap('gray');
view(-135,45);
camlight
g = gifti(fullfile(spm('Dir'),'canonical','cortex_20484.surf.gii'));
patch('vertices',g.vertices,'faces',g.faces,'EdgeColor','b','FaceColor','b');
2/ if your blobs are too far from the vertices of the mesh, they will
not appear - currently, the projection is simply done by a trilinear
interpolation (see spm_mesh_project).
I hope this helps,
Guillaume.
Markus Gschwind wrote:
> Dear Guillaume!
>
> Thanks! That is working and very elegant!
>
> How would I overlay fMRI blob image on my own surface?
> I know that there is the Render... Display option, but I am having
> trouble to make it work with my own brain surface... I never see the
> blobs...
>
> Thanks for your precious help!
> Best, Markus
>
>
>
>
> 2009/12/14 Guillaume Flandin <[log in to unmask]
> <mailto:[log in to unmask]>>
>
> Dear Markus,
>
> I assume that you end up with a highly tessellated surface mesh so a
> quick solution is to reduce its number of vertices:
>
> P = spm_select(1,'mesh','Select mesh file');
> [p, n, e] = fileparts(P);
> v = export(gifti(P),'patch');
> v = reducepatch(v, XX); % see reducepatch help on how to set XX
> save(gifti(v),fullfile(p,['reduced_' n e]));
>
> Best regards,
> Guillaume.
>
>
> Markus Gschwind wrote:
> > Dear Experts,
> >
> > I am trying to surface_render some brains with SPM8.
> >
> > When rendering an ordinary T1.nii (1x1x1mm)
> > [segmented with DARTEL to c1_gray and c2_white, and the surface
> created
> > by i2+0.5*i1 to a gii],
> > it becomes very heavy and the graphy manipulation very slow.
> >
> > When however I try the cortex_20484_surf.gii in SPMDIR/canonical, this
> > is much lighter and practical to display.
> >
> > Is there a mean to modifiy the parameters of extracting the surface so
> > that it is lighter?
> >
> > Thanks in advance!
> > Markus
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|