We are trying to calculate mean and SD over all the spatial (vertex) points included in a single functionally defined ROI/label.
Bottom line, the biggest problem is that we do not know which tool to use to read all timepoints/frames of the hemodynamic waveforms (of all the vertex points included in the label, one at a time) into matlab.
For details, please see below.
Problem 1: We tried to use mri_label_vals but this gives only one value per vertex point. However this is a FS-FAST FIR analysis with a time window of 16 frames/TRs (of which two are prestimulus) so we should get 16 values for each vertex point in order to draw a BOLD time course. So we need a reader that will produce the functional stat values for all the time points, separately for all vertices included in the ROI.
Problem 2: We would need to subtract the mean prestimulus baseline values from all 16 time points in order to set a (mean) zero baseline. This is necessary to decrease the voxel-to-next-voxel variability that is large in fMRI data. This of course has to be done before calculating the mean and SD values over the ROI. We did use mkcontrast-sess -rmprestim - does this result in that the baseline is already subtracted in the values (for each vertex point separately)?
There are typically about 600 single vertex points in a label so saving them manually one by one as ASCII and then combining them is not feasible.
As a separate but complicating issue, we have 6 simple contrasts (condition N minus REST, with names such as A-REST, V-REST, etc) and 2 slightly more complicated contrasts (condition 1 plus condition 2 minus condition 3). Loading and overlaying the ROI mean +- SD curves for each contrast separately increases the work load 6-fold. We have multiple subjects in six different conditions, each with multiple ROIs, and 6 simple contrasts, leading to thousands of BOLD waveforms - any practical application should automatically load all 6 contrast HDR waveforms and overlay them in a single window (exactly as sliceview-sess, tkmedit, and tksurfer do when you load time course - except that in these programs the time courses are displayed for only a single voxel at a time).
Any suggestions how this could be achieved?
Example data/analysis can be found in
/space/cognito/5/users/raij/avml_fmri/avml12_session_BRISI07_ISI1TR_BERT
There are two analyses here - here we are interested in the FIR analysis: ISI1TR_BERT_ERFIRsm6pf5tpefsub
... and the variables are setenv SUBJECT avml12 setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/
Any advice would be greatly appreciated!
Tommi
--- Tommi Raij, M.D., Ph.D. MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging Bldg 149, 13th St Charlestown, MA 02129
You can do this a couple of ways. First, if your label is defined on the subjects' anatomicals, you can run func2roi-sess. This will give you a mask in the functional space in the roidef subdir. Alternatively, you can use mri_label2vol to generate the mask. Once you have the mask, you can load it into matlab:
mask = MRIread('mask.bhdr'); indmask = find(mask.vol == 1);
% Read in the FIR HDR: for slice = 0:nslices-1 hfile = sprintf('h_%03d.bfloat',slice); beta(:,:,:,slice+1) = fast_ldsxabfile('hfile); end
beta = permute(beta,[1 2 4 3]); % beta is now a 4D volume with the FIRs for all conditions in the 4th dim. % You'll have to tease them appart
% To extract the ones for your mask: beta = fast_vol2mat(beta);
betamask = beta(:,indmask);
You now have a matrix that you can do anything you want with
Tommi Raij wrote:
We are trying to calculate mean and SD over all the spatial (vertex) points included in a single functionally defined ROI/label.
Bottom line, the biggest problem is that we do not know which tool to use to read all timepoints/frames of the hemodynamic waveforms (of all the vertex points included in the label, one at a time) into matlab.
For details, please see below.
Problem 1: We tried to use mri_label_vals but this gives only one value per vertex point. However this is a FS-FAST FIR analysis with a time window of 16 frames/TRs (of which two are prestimulus) so we should get 16 values for each vertex point in order to draw a BOLD time course. So we need a reader that will produce the functional stat values for all the time points, separately for all vertices included in the ROI.
Problem 2: We would need to subtract the mean prestimulus baseline values from all 16 time points in order to set a (mean) zero baseline. This is necessary to decrease the voxel-to-next-voxel variability that is large in fMRI data. This of course has to be done before calculating the mean and SD values over the ROI. We did use mkcontrast-sess -rmprestim - does this result in that the baseline is already subtracted in the values (for each vertex point separately)?
There are typically about 600 single vertex points in a label so saving them manually one by one as ASCII and then combining them is not feasible.
As a separate but complicating issue, we have 6 simple contrasts (condition N minus REST, with names such as A-REST, V-REST, etc) and 2 slightly more complicated contrasts (condition 1 plus condition 2 minus condition 3). Loading and overlaying the ROI mean +- SD curves for each contrast separately increases the work load 6-fold. We have multiple subjects in six different conditions, each with multiple ROIs, and 6 simple contrasts, leading to thousands of BOLD waveforms - any practical application should automatically load all 6 contrast HDR waveforms and overlay them in a single window (exactly as sliceview-sess, tkmedit, and tksurfer do when you load time course - except that in these programs the time courses are displayed for only a single voxel at a time).
Any suggestions how this could be achieved?
Example data/analysis can be found in
/space/cognito/5/users/raij/avml_fmri/avml12_session_BRISI07_ISI1TR_BERT
There are two analyses here - here we are interested in the FIR analysis: ISI1TR_BERT_ERFIRsm6pf5tpefsub
... and the variables are setenv SUBJECT avml12 setenv SUBJECTS_DIR /space/cognito/5/users/raij/subjects_mri/
Any advice would be greatly appreciated!
Tommi
Tommi Raij, M.D., Ph.D. MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging Bldg 149, 13th St Charlestown, MA 02129
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu