I wrote a little script for overlaying blobs over sections. This script
allows a user to overlay a filtered t-image from SnPM to a 3D section of an
image, displayed by either the "Display" or "Check Reg" button. Even though
it doesn't allow a user to "navigate" in the result page as SPM2 does, this
script produces a blob overlay image quite easily.
-Satoru
Satoru Hayasaka ==============================================
Post-Doctoral Fellow, MR Unit, UCSF / VA Medical Center
Email: shayasak_at_itsa_dot_ucsf_dot_edu Phone:(415) 221-4810 x4237
Homepage: http://www.umich.edu/~hayasaka
==============================================================
At 09:50 AM 5/3/2005 -0700, Satoru Hayasaka wrote:
>At 06:52 PM 5/2/2005 -0400, Mike Yassa wrote:
>>Is there any way in SnPM to overlay the MIP results on a T1-weighted
>>image (in the same fashion as SPM)?
>
>I still haven't figured out myself how to do this on SnPM. But if you want
>to overlay your blobs from SnPM on a T1 image, then you can do it on SPM
>(if you have run the same analysis on SPM as well). From your SnPM
>analysis, record the cluster defining threshold and the critical cluster
>size. Then in SPM "Results" session, simply enter these numbers. Unless
>you are using a pseudo t-image in SnPM, SPM and SnPM should produce an
>identical t-image. Thus you should be able to get the same blobs as SnPM
>using SPM.
>
>Hope this helps!
>-Satoru
function snpm_AddBlobs(clr)
% Adds blobs onto an spm_orthview images
% FORMAT snpm_AddBlobs(clr)
% PARAMETERS
% clr: the 3 vector containing the color that the blobs should be
%
% This program overlays blobs to a 3D section (displayed by spm_image
% or spm_check_registration). The blobs needs to be saved in SnPM
% "Results" step, by writing out a filtered T-image (SnPMt_filtered.img).
% To actually overlay the bolbs, first the background image needs to be
% displayed either by "Display" or "Check Reg" button on the SPM menu.
% Once the image is displayed, then this program can be run by
%
% snpm_AddBlobs([1 1 0]);
%
% for example. This program first prompts its user to select a filtered
% t-image.
%
%---------------------------------------------------------------------
% 6/22/2005 snpm_AddBlobs.m version 0.90beta
%-Blob color
%BlColor = [1 1 0];
BlColor = clr;
%-First, prompts the user to choose a filtered t-map
%---------------------------------------------------------------------
Tsig = spm_get(1,'*filtered*.img','Select a Filtered T-image ...');
%-Reading in the filtered t-map
%---------------------------------------------------------------------
V = spm_vol(Tsig);
MAT = V.mat;
IMAT = inv(MAT);
VOX = sqrt(diag(MAT'*MAT))';
xdim = V.dim(1);
ydim = V.dim(2);
zdim = V.dim(3);
PlDim = xdim*ydim;
[y x] = meshgrid([1:ydim],[1:xdim]');
x = repmat(x(:),zdim,1);
y = repmat(y(:),zdim,1);
z = repmat((1:zdim)',1,PlDim)';
z = z(:);
X = zeros(1,xdim*ydim*zdim);
for k = 1:zdim
tmp = spm_slice_vol(V,spm_matrix([0 0 k]),[xdim ydim],0);
X((k-1)*PlDim+1:k*PlDim) = tmp(:)';
end
clear tmp;
%-Filtering out non-significant voxels
%------------------------------------------------------------------------
Q = find(X>0);
X = X(Q); %-T-scores
XYZvox = [x(Q) y(Q) z(Q)]'; %-Locations
XYZmm = MAT*[XYZvox; ones(1,length(Q))];
XYZmm(4,:) = [];
%-Adding blobs!
%------------------------------------------------------------------------
spm_orthviews('AddColouredBlobs',1,XYZvox,X,MAT,BlColor);
|