4 min read

FreeSurfer: recon-all outputs

Welcome back, everybody. It’s been a while. These following months I won’t be very active because, and quoting the mags, “hard times are coming my way”. Meaning, thesis’ defence.

In the last entry, you’ve more or less instructed on how to launch the recon-all command on your own images. Similarly, I assume that since a million years passed since the last post, this step had probably come to an end (I hope a good one).

Ok then, so what’s next? We have to look up for each subject’s log file to make sure that the recon-all process ended without errors. To do so, you normally should enter each subject’s folder and… ok, that’s a lot of work. Remember those weird list with your subjects’ name that I have asked you to do in the previous entry?

for i in `cat list.txt`; do tail -n1 $i/scripts/recon-all.log; done

The previous loop will print in your terminal every subject’s last line of this “recon-all.log” file. Here, you should see something like the following message:

recon-all -s <yoursubject1> finished without error at Mon Mar 26 18:20:06 EDT 2018
recon-all -s <yoursubject2> finished without error at Mon Mar 26 20:25:09 EDT 2018
recon-all -s <yoursubject3> finished without error at Mon Mar 27 00:04:01 EDT 2018
recon-all -s <yoursubject4> finished without error at Mon Mar 27 02:43:20 EDT 2018
...

Hurray. If you happen to find someone whose recon-all ended because of an error, then you’ll have to play detectives for that particular case. Remember to carefully read the log file and to not be afraid of using the FreeSurfer’s forum. Heads up. Please, google first the error before hitting the panic buttom.

That said. It is very unlikely that recon-all abruptly finishes because of major errors. However, we cannot rule out the possibility of other problems. Now you’ll have to go through the pain of eyeballing each of your subjects images (sorry, no magic tricks this time) to see whether minor errors were committed.

But what minor errors are? Mainly, skull-stripping and segmentation failures. Hold your horses though as I’m not covering these two in this entry. What I’ll do instead is tell you (1) how to open your images, (2) how to navigate through slices to check if everything is good, and (3) instruct you in what is likely to be mistaken as an error but it is not.

  • Open your images
tkmedit <yoursubject> brainmask.mgz -aux T1.mgz -surfs

This will load your already preprocessed image (“brainmask.mgz”), your raw image (“T1.mgz”“) and the surface files (red ribbon = grey matter, yellow ribbon = white matter).

You should see something like the following:

I hereby formally present you my brain.

  • Navigation

The combination of CTRL and N will set you in navigation mode. This means that you can scroll back and forth with the mouse or by simply pressing your up and down keyboard arrows. When pressing CTRL and S you will enter in select voxel mode, this is, you can click to move the crosshair wherever you want.

Pressing S, C or H will change the view, respectively, to the sagittal, the coronal or the horizontal/axial plane.

If you press CTRL and 1 and CTRL and 2 you will alternate between the principal (i.e., “brainmask.mgz”) and the auxiliar image (i.e., “T1.mgz”).

  • Quality check

Try not to spend a lot of time on this step. My rule of thumb here is moving along the coronal view starting from the forehead and ending by the nape a couple of times. This should not take you more than 30 seconds. The whole point here is to not waste time on getting obsessed on details that to the untrained eye might wrongly seem like an error.

Rather than telling you what an error is, I will show you examples of what is not.

Is this an error? No, it is not. Crossing pial-surface in the medial wall is fairly common, but it’s not an error. If you see crossing of pial and white-matter surfaces, now THAT’S an error.

And this? Nope. Whatever is not being included within the red or white-ribbon is not considered for statistics. Yes, there’s some skull remaining but, FS is not considering it as part of the pial surface, so not an error.

Wait. This one has to be an error, right? No, this one neither is. You might think that part of the hippocampus-amygdala complex is not included as part of the pial surface, but this is not an error. The pial surface exclusively refers to cortical regions. Subcortical structures are not surface but volume-based segmented. We’re not looking volume segmentation here. If so, you might want to include in the tkmedit command the flag “-aseg”.

If still sceptical on this matter, please visit these slides made by the FreeSurfer team. Also, don’t hesitate in visiting the official troubleshooting wiki.

That’s all. See you in the next post on fixing bad skull-stripping.