Dear Gabriel,
What about something like this?
V = spm_vol('PET.nii');
sf = spm_global(V);
V.pinfo(1:2,:) = V.pinfo(1:2,:) * 100 / sf;
spm_create_vol(V);
You could also compute the scale factor differently, using e.g.
spm_summarise.
Best regards,
Guillaume.
On 11/04/18 17:56, gabriel robert wrote:
> Dear Guillaume and list,
>
> Thanks for your prompt reply,
>
> Sorry for being unclear, actually I'd like to scale an image to its
> global value (ie whole brain mean value) and not a fix factor. Besides,
> we'd like to subtract two images (pre-post surgery) before running the
> 2nd level.
>
> Therefore, if any one could help us with a snipet of code which computes
> the global for each volume and then scale each voxel by the global, we
> would be very grateful
>
> Thanks,
>
> Best wishes,
>
> Gabriel
>
> 2018-04-11 18:33 GMT+02:00 Guillaume Flandin <[log in to unmask]
> <mailto:[log in to unmask]>>:
>
> Dear Gabriel,
>
> If you just want to apply a scale factor to an image, you can change its
> header information:
> V = spm_vol('PET.nii');
> V.pinfo(1:2,:) = V.pinfo(1:2,:) * 42;
> spm_create_vol(V);
>
> In the context of a GLM, you can use the proportional scaling option in
> second level models.
>
> Best regards,
> Guillaume.
>
>
> On 11/04/18 10:17, gabriel robert wrote:
> > Dear SPM experts,
> >
> > We are looking for a code to scale PET images to the global value
> (whole
> > brain glucose metabolism) that could run on Matlab.
> >
> > We could not find it in the archives,
> >
> > If any one could help us....
> >
> > Best wishes,
> >
> > Gabriel
>
> --
> Guillaume Flandin, PhD
> Wellcome Trust Centre for Neuroimaging
> University College London
> 12 Queen Square
> London WC1N 3BG
>
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|