SPM96 shows voxels that are considered to be between 5mm in front of and 20mm
behind the surface that is displayed. This is the same as for the "old style"
rendering of SPM99.
To change this depth, try changing line 131 of spm_render.m from:
msk = find(xyz(3,:) < (z1+20) & xyz(3,:) > (z1-5));
to something like:
msk = find(xyz(3,:) < (z1+5) & xyz(3,:) > (z1-5));
I would rather see the rendering done on the brain of either the same
subject that the data were acquired, or on a nice smooth average brain
surface. Rendering can be done on a smooth average in SPM99, and there
is also the capability of doing the rendering on to the individual subjects
MR. The rendering in SPM96 is done onto a single subject brain, which can
be quite misleading as it is not the same subject that the data comes
from. Depths behind the surface are derived from the single subject brain,
which can cause problems as spatial normalisation is not exact. An activation
that could be on the brain surface may appear a few mm in front of or behind
the single subject brain surface.
Another option within SPM99 is to use the brain extraction feature to
identify the approximate brain surface of a segmented structural image.
This would be saved as surf_*.mat. A routine similar the one attached
can then be used to render the blobs on to this surface.
Best regards
-John
| upon request of a referee, we are reviewing a PET experiment analysed
| with SPM96. The referee requires that the images included in our paper
| using the Rendering procedure in SPM96 be modified by eliminating
| the biases implicit in the SPM96 rendering procedure itself.
| I suppose he refers to the fact that the SPM96 rendering procedure displays
| "deep" voxels on the surface of the brain.
| So, here is my question. Does anybody have a modified rendering algorithm,
| such that, either the image displays are split according to the depth of
activation
| in the brain tissue, or the thickness of brain tissue rendered on the
| surface can be interactively specified?
| Thank you a lot for any help of feedback!
function fancy_rendering(arg1)
% Does fancy rendering of intensities of one brain superimposed
% on surface of another
if nargin == 0,
initialise_rendering;
else,
if strcmp(lower(arg1),'relight'),
relight;
end;
end;
return;
function relight
ax = findobj(0,'Tag','rendering');
l = findobj(get(ax,'Children'), 'Type', 'light');
delete(l);
l = camlight(-20, 10);
return;
function initialise_rendering
FV = load(spm_get(1,'surf_*.mat','Select surface data'));
V = spm_vol(spm_get(1,'*.img','Select image'));
col = ones(size(FV.vertices))*0.8;
tmp = inv(V.mat);
xyz = (tmp(1:3,:)*[FV.vertices' ; ones(1, size(FV.vertices,1))])';
t = spm_sample_vol(V, xyz(:,1), xyz(:,2), xyz(:,3), 1);
msk = find(~finite(t) | t<0);
t(msk) = 0;
mx = max([eps max(t)]);
colour = [1 0 0];
tmp = [t*(colour(1)/mx) t*(colour(2)/mx) t*(colour(3)/mx)];
col = repmat((1-t/mx),[1 3]).*col + tmp;
fg = spm_figure('GetWin','Graphics');
spm_results_ui('Clear',fg);
ax = axes('Parent',fg,'Clipping','off','tag','rendering');
p = patch(FV, 'Parent',ax,...
'FaceColor', 'interp', 'FaceVertexCData', col,...
'EdgeColor', 'none',...
'FaceLighting', 'phong',...
'SpecularStrength' ,0.7, 'AmbientStrength', 0.1,...
'DiffuseStrength', 0.7, 'SpecularExponent', 10);
set(0,'CurrentFigure',fg);
set(fg,'CurrentAxes',ax);
l = camlight(-40, 20);
axis image off;
box on;
rotate3d off;
rotate3d on;
return;
|