> Does anyone have a tool for adding colored dots to SPM 99 3D renderings?
> I'm looking for something like Matthew Brett's render_cols.m function but
> which works with SPM99 (as I don't have access to SPM96 any longer).
>
> I have a list of MNI coordinates which I'd like to show on the rendered
> surface either in a single color, or ideally in colors corresponding to
> different Z-statistics (and/or conditions).
This is a bit of a hack, but suppose your co-ordinates are stored as:
xyz = [
x1 x2 x3 x4 x5
y1 y2 y3 y4 y5
z1 z2 z3 z4 z5];
xyz = [-54 36 0 ; -6 68 -4; 14 -92 -22]';
Then the spm_render.m function can be called by:
clear dat;
mat = [
2 0 0 -92
0 2 0 -128
0 0 2 -74
0 0 0 1];
imat = inv(mat);
dat.XYZ = imat(1:3,1:4)*[xyz ; ones(1,size(xyz,2))];
dat.t = ones(size(xyz,2),1);
dat.mat = mat;
dat.dim = [91 109 91];
brt = 1;
rendfile = fullfile(spm('Dir'),'rend','render_smooth_average.mat');
spm_render(dat,brt,rendfile)
It only displays stuff on the lower half of the screen though. The only way
to change this is to either change the code.
Best regards,
-John
--
Dr John Ashburner.
Functional Imaging Lab., 12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420 http://www.fil.ion.ucl.ac.uk/~john
|