CUBIC freesurfer recon-all check pipeline

Posted: April 13, 2011 in HOW-TO's

Following is the protocol according to which we will be looking at the freesurfer recon-all results.

Step 1:
Turn computer on 😉

Step 2:
We have 5 groups of scans, with 10 subjects each. All the scans have been reconstructed already, and are one the USB HD we will be giving you.
First we will be copying each subject into the subjects directory so that tkmedit and tksurfer can find them.

Step 2a:
Where is my $SUBJECTS_DIR?

Go to the command prompt: (Terminal for Mac and Linux)

Type in:


This should show something like:


This does not have to match the above, you just need to have it identified. Otherwise, re-setup your freesurfer environment variables.

MAC users: Try typing: >>open $SUBJECTS_DIR)

Linux users: Open the above directory in your file browser.

Drag and drop each subject into your $SUBJECTS_DIRECTORY. If some files are called the same, you will have to rename them! It is important that you drag and drop each subject individually into the subjects directory so that none are contained inside another file folder.

So when you type:


…you should get a list of the individual subject names!

Step 3
>>tkmedit (insert subject name here) orig.mgz (lh.orig) rh.orig -aparc+aseg

…or (See comment below…)

>>tkmedit (insert subject name here) orig.mgz -surfs -aparc+aseg

(Onthou: Moenie die hakkies intik nie!)

Tip: When you type CTRL-G, the atlas will disappear, making the red and green lines more visible.

The green line is where the white matter ends and the green line is where the CSF begins and the grey matter ends.

Tip: CTRL B is for the contrast settings

Try sticking to one set on contrast values for your screen.

Now look through each scan, using the arrow keys, for about 2 seconds per slice. Remember, when in doubt, try changing to axial/coronal views. Most times freesurfer will do it correctly in anatomically normal scans. Even if you find a big error, make a note and look through the other subjects if it reoccurs.

When we meet again, we will decide together what we except as correct or incorrect. To oriantate yourself, take a look at the standard subject “bert” that comes with freesurfer. This subject is correctly reconstructed.

Step 4

Finally we will look at the surface, if it is smooth, and does not have holes or spikes in it. These surfaces must be smooth.
>> tksurfer bert lh inflated
>> tksurfer bert rh inflated

Thanks again everyone for your valued efforts! Watch this page for updates!

Here are a few links to the relevant freesurfer info. Please have a look at the validation studies as it gives a goo indication what freesurfer can and cannot do!

Official Freesurfer beginner’s Guide
Documentation (Scroll down)
Official Freesurfer tutorial
Freesurfer Mailing list


  1. Coenraad says:


  2. Annerine says:

    Coenraad, die trane behoort darem minder te wees vir die res van ons na gister se breinsessie!

  3. JP says:

    A way to view both hemisphere’s segmentations at the same time (for the hardcore crowd):

    Use this instead:
    tkmedit (subject name) orig.mgz -surfs

    Its nice…

  4. JP says:

    Also if you want to view both hemisphere cortical and subcortical segmentations, here is the master code:

    (warning-excessive use of this command might lead to nausea and/or colour blindness :-))

    tkmedit (subject name) orig.mgz -surfs -aparc+aseg

  5. Coenraad says:

    Lol! Thanks JP! Koning!

    Ek voel soos die rot in die emmer. 😛

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s