The way I do this is right click on the spm results page (graphic window) after you have hit volume button. Then I extract table. This puts it into the matlab variable "ans"
if you then at the matlab prompt type
myResults = ans;
then the results are transfered to myResults
then use this code to write to a text file: usage spmResults2TD(myResults,1,'Filename')
%+----------------------------------------
%|
%| Robert C. Welsh
%| University of Michigan
%| Department of Radiology
%|
%| Dec 20, 2000
%|
%| A program to dump the results structure from SPM into a file for
%| the talairch daemon.
%|
%| function spmResults2TD(resultsStruct,radOrNeuro,...
%| fileName)
%|
%| resultsStruct should be the right click extraction
%| from the stats page in the results section of spm
%|
%|
%| radOrNeuro - +1 = neuro (native), -1 = rad (flipped).
%|
%| fileName - if present write to that file, else
%| write to the screen.
%|
%|
%+----------------------------------------
function spmResults2TD(resultsStruct,radOrNeuro,...
fileName)
fidOut = 1;
if nargin>2
fidOut = fopen(fileName,'wt');
if fidOut < 0
fidOut = 1;
end
end
nlines = size(resultsStruct.dat,1);
clusterN = 0;
newCluster = 0;
for iline = 1:nlines
if iline>1
fprintf(fidOut,'%s',char(13));
end
newCluster = 0;
if size(resultsStruct.dat{iline,4},1) > 0
clusterN = clusterN + 1;
curClusterN = clusterN;
curClusterS = resultsStruct.dat{iline,4};
newCluster = 1;
end
fprintf(fidOut,'%d %d %d',...
floor(radOrNeuro*resultsStruct.dat{iline,10}(1)+.5),...
floor(resultsStruct.dat{iline,10}(2)+.5),...
floor(resultsStruct.dat{iline,10}(3)+.5));
end
if fidOut > 2
fclose(fidOut);
end
%
% All Done.
%
>>> "Harenski, Keith" <[log in to unmask]> 04/11/01 10:34AM >>>
Hello all -
>We would like to copy the tabulated results from our stat printouts to
>Excel. More specifically, we wish to copy and paste the t and p values,
>x-y-z coordinates, etc.. for further analysis. Does anybody have an idea
>how to do this (e.g. at the Matlab command level)?
Thanks... Keith
|