fMRI Tips, Tutorials, Code, Examples

MatLab and Excel

I usually write MatLab scripts to parse the behavior data collected in a fMRI or NIRS experiment. It’s powerful and flexible. But as I have to do an Excel version recently, I found Excel has a great advantage — it’s easy to share wi
Xu Cui
21 sec read

Advantage and Disadvantage of NIRS over fMRI

Advantages cheaper portable (smaller) safe natural settings (e.g. real human interactions instead of computer presentation) high temporal resolution (10Hz) less sensitive to head motion clinically friendly less environment noise long time recording c
Xu Cui
18 sec read

Using matlab to control LPT port

Download the following 4 files: porttalk.sys, copy to C:\WINDOWS\system32\drivers lptread.m lptread.mexw32 lptwrite.mexw32 Copy the last three files to a directory where your matlab can access. Your LPT port number is probably 0x378 (or 888). Assume
Xu Cui
28 sec read

Retinotopy analysis with MrVista

This protocol is based on Rory Sayres‘ teaching. Download and install MrVista svn checkout If you already downloaded an older version, use svn update
Xu Cui
5 min read

fMRI: how to do ROI analysis

ROI stands for region of interest. The region is predefined usually from glm contrast. For example, you find visual cortex is activated when a flash is presented through glm analysis, you may then do more analysis on this particular region. ROI analy
Xu Cui
42 sec read

recon-all of freesurfer

recon-all is a batch program and runs >30 steps.  It easily takes 30 hours to finish one subject. Use tkmedit CON14 T1.mgz and tksurfer CON14 lh inflated to visualize images. More about visualization with freesurfer. Note: commands are in green. T
Xu Cui
10 min read

retinotopy with freesurfer

Retinotopy analysis consists two parts, one on high resolution structural images (segmentation, inflation, cut, etc), the other on functional images. structural Before you start, you need to put the structural i
Xu Cui
2 min read

brain images: convert between different formats

For single file to single file conversion, you usually use mri_convert of freesurfer. For example mri_convert x.img y.nii Other options would be LONI Debabeler or MRICro. Here are some special cases: multiple 3D ANALYZE to a single 4D Nifti: mri_conc
Xu Cui
1 min read

fslmerge: convert 3D ANALYZE to Nifti

/fs/quarry/cuixu/fsl/fslmerge -t f I_???.* On my computer, it doesn’t convert to .nii file; but to a single img/hdr pair. This method won’t be used. Instead, I use freesurfer’s mri_concat now. See here.
Xu Cui
8 sec read