User Tools

Site Tools


Using fScan with FreeSurfer data

The commands on this page are described as they would be used on Golgi at BIAC. They also work on some Linux systems (Davinci and Hawking) and could be installed on others as needed.


  • In order to view FreeSurfer data using fScan you must first run the “freesurf2fscan” command to convert surface data files to a more readable format, and to add BXH file headers to all FreeSurfer data files. This is a one-time operation for each reconstructed brain. Freesurf2fscan assumes that you have a ~/.tcshrc file that correctly defines the SUBJECTS_DIR string to point to wherever you have your FreeSurfer “subjects” directory. The syntax for running freesurf2fscan is simply:
freesurf2fscan SubjName 
  • The “SubjName” argument should match the SubjectName you specified when you ran the FreeSurfer reconstruction program.
  • Freesurf2fscan creates a new subdirectory named “fscan” within your “freesurfer/subjects/subjname” directory. The files in that directory are reformatted copies of some of the surface files in the “surf” subdirectory that FreeSurfer created. In making the surface copies, fScan also generates a low resolution second version of each surface data set to help speed up interactive display rendering. (This low resolution view currently has a bug on Golgi, so don't be alarmed if your coarse fast surface images seem to be missing a large part of the brain.)
  • Freesurf2fscan also adds BXH format header files to the image data files in FreeSurfer's “mri” subdirectory. In this case the data files themselves are not modified at all, but the header files provide alignment, color-codeing, and glossary information that makes it easier for fScan to display the images.
  • Finally, freesurf2fscan creates a workspace definition file called “subject.wdf” in your subject's main directory (e.g. $SUBJECTS_DIR/subjname), which is an XML file that points to most of the different data sets for that brain.

Viewing with fScan

  • To display FreeSurfer subject data with fScan, you should have your SUBJECTS_DIR environment variable set in your current command shell. If you ran the commands above, you presumably have defined SUBJECTS_DIR in your “~/.tcshrc” file, so if you are running “tcsh” you should be all set. If you are running the default “bash” command shell, you can either switch to tcsh simply by entering the “tcsh command, as:
  • Alternatively, you can define the SUBJECTS_DIR variable in the “bash” shell by adding the following line to your file ”~/.bashrc“ (creating the file if it doesn't already exist):
export SUBJECTS_DIR=/data/users/yourname/freesurfer/subjects
  • If you want to see a list of surface subject directories, you could try the command:
fscan2 %%
  • To display your subject's data with fScan, use the following command:
fscan2 subject.wdf%subjname -D 
  • “Subjname” is the name you gave that subject. The '%' tells fScan to lookup “subjname” in the SUBJECTS_DIR heirarchy. The ”-D“ means display images. If you are connected to Golgi via a Windows SSH client (e.g. F-Secure) make sure you also have XWin-32 running on your Windows computer in order to see fScan's X display.
  • Note that you should be using the “fscan2” version of fScan on Golgi. For now, “fscan” still refers to version 1, which is almost obsolete and will not recognize the ”.WDF“ file format.
  • FScan should display a menu of data sets. Click on any data set name to display it. A Taskbar menu will appear with the data to help you navigate. (More detailed instructions will follow.)
jvs/fscan/fscanfreesurf.txt · Last modified: 2014/08/04 16:03 (external edit)