Print

Print


See responses below.


On Wed, Dec 25, 2013 at 2:06 AM, Philip Lin <[log in to unmask]> wrote:

> Hi Watson and McLaren, thanks for your responses, it helps me understand
> more.
>
> After the checking, I've found that the value read by
> spm_read_vols(SPM.xY.VY) is scaled, the scaled value is in pinfo.
>
> 1. I am curious why these voxel values should be scaled ?
>

>>> They are scaled to make the constant term in the GLM approximately 100.


> 2. How this scale be calculated ?


The scale is calculated by spm_fmri_spm_ui.m:

fprintf('%-40s: ','Mapping files')                                      %-#
VY    = spm_vol(SPM.xY.P);
fprintf('%30s\n','...done')                                             %-#

%-check internal consistency of images
%--------------------------------------------------------------------------spm_check_orientations(VY);

%-place in xY
%--------------------------------------------------------------------------
SPM.xY.VY = VY;

%-Compute Global variate
%========================================================GM    = 100;
q     = length(VY);
g     = zeros(q,1);
fprintf('%-40s: %30s','Calculating globals',' ')                        %-#

for i = 1:q    fprintf('%s%30s',repmat(sprintf('\b'),1,30),sprintf(
'%4d/%-4d',i,q))%-#
 g(i) = spm_global(VY(i));
end

fprintf('%s%30s\n',repmat(sprintf('\b'),1,30),'...done')                %-#

% scale if specified (otherwise session specific grand mean scaling)
%--------------------------------------------------------------------------

gSF   = GM./g;
if strcmpi(SPM.xGX.iGXcalc,'none')
    for i = 1:nsess
        gSF(SPM.Sess(i).row) = GM./mean(g(SPM.Sess(i).row));
    end
end

%-Apply gSF to memory-mapped scalefactors to implement scaling
%--------------------------------------------------------------------------

for i = 1:q
    SPM.xY.VY(i).pinfo(1:2,:) = SPM.xY.VY(i).pinfo(1:2,:)*gSF(i);
end

%-place global variates in global structure
%--------------------------------------------------------------------------

SPM.xGX.rg  = g;
SPM.xGX.GM  = GM;
SPM.xGX.gSF = gSF;



> Because I've tried many packages in R (nifti / fmri / AnalyzeFMRI) and
> voxel values read by these packages are unscaled. Is there any difference
> to analyze data with scaled and unscaled voxels ?
>
>  (values from spm_read_vols) = (values from R packages)*(scale number in
> pinfo)
>

As I stated before, if you use spm_read_vols(spm_vol(actual file names)),
rather than spm_read_vols on the xY structure, then you'd get the same
values as the other programs.



>
> I've tried to check spm_slice_vol.m, but it seems be complied in .mex file
> and I can't see the origin code.
>
> Thanks for your help, sincerely
>
> Philip Lin
>
> On Tue, 24 Dec 2013 13:14:35 -0600, MCLAREN, Donald <
> [log in to unmask]> wrote:
>
> >There are likely two differences:
> >(1) When you display things in SPM, the values are interpolated, turning
> >the interpolation off should fix the issue if you told the program to
> >display the same image that you loaded;
> >(2) SPM.xY.VY.pinfo is likely different from hdr.pinfo, when its created
> >from hdr=spm_vol(filename). The pinfo field contains scaling information.
> >The pinfo field is modified during the 1st level model creation to make
> the
> >mean 100. Thus, it will give you different values than the unscaled image.
> >
> >Hope this helps.
> >
> >Best Regards, Donald McLaren
> >=================
> >D.G. McLaren, Ph.D.
> >Research Fellow, Department of Neurology, Massachusetts General Hospital
> and
> >Harvard Medical School
> >Postdoctoral Research Fellow, GRECC, Bedford VA
> >Website: http://www.martinos.org/~mclaren
> >Office: (773) 406-2464
> >=====================
> >This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
> >HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
> >intended only for the use of the individual or entity named above. If the
> >reader of the e-mail is not the intended recipient or the employee or
> agent
> >responsible for delivering it to the intended recipient, you are hereby
> >notified that you are in possession of confidential and privileged
> >information. Any unauthorized use, disclosure, copying or the taking of
> any
> >action in reliance on the contents of this information is strictly
> >prohibited and may be unlawful. If you have received this e-mail
> >unintentionally, please immediately notify the sender via telephone at
> (773)
> >406-2464 or email.
> >
> >
> >On Tue, Dec 24, 2013 at 12:21 PM, Chris Watson <
> >[log in to unmask]> wrote:
> >
> >>  How are they different?
> >>
> >>  On 12/24/2013 09:40 AM, Philip Lin wrote:
> >>
> >> Hi all,
> >>
> >> I have a question about voxel values in SPM. If I read an image into
> SPM8 and use GUI (Display) to show the target image, the value for each
> voxel means intensity. If I read the same image by using
> spm_read_vols(SPM.xY.VY), the values for each voxel is apparently different
> to intensity. What's the difference between them ? What's the meaning of
> values from spm_read_vols ?
> >>
> >>
> >> Thanks if there's any help, sincerely
> >>
> >> Philip Lin
> >>
> >>
> >>
> >>
> >
>
>
>