Hi AS,
P is a list of file names, either a character array or a cell array of strings. If you're doing one subject by hand use:
P = spm_select(Inf,'image');
which will open a file dialogue and save the image files you select as variable P.
If you have preprocessed the data, make sure you select only one set of image, with the same prefix.
Once you've done that, typing calc_tsnr(P); should give you an image 'tsnr.nii' in the same directory. You will probably need to mask the TSNR image with a brain mask, since voxels outside the brain can have very low SD and appear to have high TSNR. You can do that using the attached script (just type 'brainmask' then select 'tsnr.nii'). It multiplies the image by the canonical SPM brain mask by default.
Paul
On Wed, 1 May 2013 13:04:46 +0100, A a <[log in to unmask]> wrote:
>Hi Paul,
>
>I really appreciate your help. If you do not mind I have a couple of basic
>questions, I am a matlab beginner. So I think what I need is the first
>script, for individual, as this is what I have, a single session for one
>subject. What I need to modify is the P in the script. So should I add all
>the volumes ( the function data together as you get from the scanner ) ?
>The only problem that I faced is loading the image in a correct way. I used
>load_nifti but what I get is a structure file that contains hdr img ..etc.
>Should I load this one as P? Also when you mentioned modifying the script
>you mean to identify P in :
>
>% What is P?
>if isstruct(P)
>
>When i reach to this command it says no enough argument..
>
> Where is the functional data in SPM.mat if it is easier to be used ?
>
>Thanks, and sorry about these basic questions
>
>
>On Wed, May 1, 2013 at 12:19 PM, Paul Wright <[log in to unmask]> wrote:
>
>> Hi AS, I've been using TSNR myself recently. As you say, it's simply mean
>> / SD over the images in a time series. This can be calculated at each voxel
>> for each subject and session and then combined to give a "coverage map" for
>> the group. The individual or group maps can be used as an alternative to
>> implicit masking to set the spatial limits of your analysis. I'm attaching
>> two Matlab files that calculate TSNR. The function calc_tsnr.m makes
>> individual TSNR images, either from a list of image files or from the files
>> for each session specified by an SPM.mat file. The second script
>> calculate_tsnr_script.m batches the process for a set of subjects. In this
>> case it searches for images based on prefix, using all matching images in
>> the directory. You'll need to modify it for your experiment. You could also
>> adapt it so it uses an SPM.mat file. I hope these help. These are my
>> personal scripts, not published, so are provided as is. Use at your own
>> risk and check results are sensible etc. Best wishes, Paul Wright On Wed, 1
>> May 2013 11:40:25 +0100, AS T.N ** wrote: >Hello, > >I know such a
>> question may not be posted here but I know there are lots of fMRI experts.
>> > >I need to calculate the Temporal SNR for my fmrI data series. I found a
>> nice paper the explains it ( Murphy et al 2007). I did that by taking the
>> whole mean of the signal from the data and divide it by its std. I am sure
>> that I missing something and there are accurate way to do it. Can someone
>> please tell me or guide me to how I do it correctly in a practical terms?
>> Can SPM help me here ? > >Thanks > >AS
>
|