Would it be too late to request a feature for the SPM12 release that is
equally simple as handy?
It is a log-transform of all images in a run according to
y = 100*ln(x) [+offset]
The use would be that by transforming all EPI fMRI images during
preprocessing already, the output of a regression model would
automagically be expressed as percentage signal change!
I get the impression that people currently either often forget this
step, or need to do it afterwards by dividing the estimated betas by the
baseline or mean image, which is quite cumbersome. Using a log-transform
this can be taken care of during preprocessing and then be forgotten about.
I always do it using a script, and I love it; given its generality, it
would be nice if it becomes a standard function.
Note that the ImCalc function is not very suitable. First, ImCalc
produces only one output image but cannot be run on a whole series of
images; second, all images in a series should be given the same offset,
which should be suitably scaled to make use of the dynamic range in the
(integer) representation of images.
The pseudo-code I use (for 16-bit images):
%% LOG-TRANSFORM
% specify images
files = {'file1.img', 'file2.img', ..., 'fileN.img'};
% read representative (i.e. first) image to assess scale
img = spm_read_vols(spm_vol(files{1}));
% determine mean tissue signal
level = mean(img(img > mean(img(:))/10));
% use 16-bit integer range at 0.01% signal change resolution
level = level/exp(0.0001*32768/2);
% apply transform to all images
for f = 1:length(files)
hdr = spm_vol(files{f});
img = spm_read_vols(hdr);
hdr.pinfo = [0.01; 0; 0];
hdr.fname = strcat('l', files{f});
img = 100.0*log(max(img/level, 1.0));
spm_write_vol(hdr, img);
end
I am willing to contribute an "spm_logtransform.m" function, if
necessary, although I can't oversee exactly which other functions need
to be modified to integrate this feature in the utilities and batch
functionality.
Best,
Dave
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
|