Sunday, July 8, 2012

FSL Tutorial: Part 1 (of many)



I recently started testing out FSL to see if it has any advantages over other fMRI analysis packages, and decided to document everything on Youtube as I go along. The concepts are the same as any other package (AFNI, SPM, etc), but the terminology is slightly different, and driving it from the command line is not as intuitive as you would think. Plus, they use a ton of acronyms for everything, which, to be honest, kind of pisses me off; I don't like it when they try to be cute and funny like that. The quotes and sonnets generated by AFNI after exiting the program, however, are sophisticated and endearing. One of my favorites: "Each goodbye makes the next hello closer!"

In any case, here is the first, introductory tutorial I made about FSL. I realized from searching around on Youtube that hardly any fMRI analysis tutorial videos exist, and that this is a market that sorely needs to be filled. A series of walkthroughs and online lessons using actual data, in my opinion, would be far more useful at illustrating the fundamentals of fMRI data analysis than only having manuals (although those are extremely important as well, and I would recommend that anyone getting started in the field read them so that they can needlessly suffer as I did).

I will attempt to upload more on a regular basis, and start to get some coherent lesson plan going which allows the beginner to get off the ground and understand what the hell is going on. True story: It took me at least three years to fully comprehend what a beta weight was. Three years. I'm not going to blame it all on Smirnoff Ice, but it certainly didn't help.

Note: I suggest hitting fullscreen mode and viewing at a higher resolution (360p or 480p) in order to better see the text in the terminal window.

Also, the example data for these tutorials can be found here.




25 comments:

  1. SOOOOO happy when I found your web site and about to follow you along but unfortunately, I got "An error occurred, please try again later".

    What give?

    thanks

    ReplyDelete
    Replies
    1. Hi,

      Can you provide any more details on when the error occurred, and what error output it gives, if any?

      -Andy

      Delete
  2. how to get the fsl GUI ? I mean i have installed the fsl and thats it. I tried writing commands in the terminal but I couldn't. I am new to this. Please do let me know if you have a manual of commands or something . Thanks!

    ReplyDelete
    Replies
    1. Hi Sanket,

      If you have a path pointing to the FSL libraries (which should be done as part of a typical installation), then you should be able to launch the GUI by just typing "fsl".

      Best,

      -Andy

      Delete
  3. Given a resting state fMRI dataset and a parcellated brain volume image in DTI space, please design an algorithm to measure the functional connectivity between those parcellated brain regions.

    1) The data is already transformed to the same DTI space.
    2) The brain volume is parcellated into anatomical regions based on the HAMMER algorithm. It is based on the MNI atlas. Each brain region should be treated as a graph node.
    3) The measured connectivity should be represented as a graph edge. Create the final constructed graph of the structural connectivity map and rendering of the connectivity map
    4) the Brain regions are given in the text file with their intensities.

    I tried loading the nifty file in matlab then comparing the test data (atlas) with 150 time series after this I got at the 59th time series the given data is same to test data. Now I dont understand how to deal with the image and map the data to get the fiber connectivity ?

    I am dealing with all this stuff for the first. If you have any suggestions or ideas please help me out. Thanks!!

    ReplyDelete
    Replies
    1. Hi Sanket,

      I don't have an algorithm specifically for what you are describing - and I haven't worked that much with DTI data, although conceptually it should be similar to basic resting state analyses - but I have one question: When you say you got to the 59th time series and that the given data was the same as the test data, what does that mean exactly? And what is the test data? I need a few more details.

      Thanks,

      -Andy

      Delete
  4. Example data is at following: mypage.iu.edu/~ajahn

    ReplyDelete
    Replies
    1. Hey Nathan, thanks for pointing that out. I think I reference the link in a later post, but I will update it on this post for easier reference.


      Best,

      -Andy

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Hello! Thanks for this great blog. Do you have a tutorial for FS-FAST?

    ReplyDelete
    Replies
    1. Unfortunately, no; not yet! There may be one in the future.

      -Andy

      Delete
  7. Great Tutorials. Thank you very much Andy!

    ReplyDelete
  8. Hi,
    Great tutorials, really helpful when I needed to create ROIs.
    I recently bought a MacBook Pro with OS El Capitan, and I am having trouble installing FSL.
    After asking me for the place to install, the terminal says: Unsupported OS (apple darwin 15.6). This version of the OS has not been fully tested.
    Thanks for your help!

    ReplyDelete
    Replies
    1. Hi,

      I am having the same problem on a new MacMini with OS El Capital version 10.11.6. I tried reinstalling XQuartz, like some other forums have suggested, but I still get the error "[Warning] Unsupported OS (apple darwin 15.6). This version of the OS has not been fully tested."

      Have you or anyone else found a solution?

      Delete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Hi Andrew. Great tutorials. Really helpful, especially for someone like me who is just getting into MRI analysis. Any chance that you have gone through perfusion data analysis in SPM or FSL? It's been a real struggle with perfusion data at the moment and so would greatly appreciate your help.

    Thanks for all these insightful videos.

    Regards!

    ReplyDelete
    Replies
    1. Hi Safal,

      Unfortunately I haven't done much analysis of perfusion data (that was six years ago, and even then I wasn't sure I was doing it right). Best of luck with your search, and if I do start to learn something, I'll let you know!

      -Andy

      Delete
  11. Hi Andy,

    Thank you so much for all your hard work and all those great tutorials! I would not have done anything if it was not for your help! I am working as a post-doc on neuroimaging but I am just getting things started with fMRI analysis with no guidance (my previous work focused only on DTI analysis). I use Human Connectome Project data so I am lucky that HCP already provides the parameters for FSL analysis. Based on your tutorials I saw that this was adequate for me to obtain a good depiction of the hand motor area using the motor task fMRI datasets.

    The only problem is that I wanted to try the method described in this recent paper http://www.nature.com/articles/srep20170#f2 (the author was so kind to send me his toolbox which only works in SPM though). Do you think there is a way to use my FSL produced data in SPM for such an analysis to produce maps of inter-subject variability? Also after that would I be able to extract some ROIs from SPM for single subjects in order to combine them using a script I have with my previously used DTI ROIs to optimize the tracking of the hand motor area in the subjects or there is no point and I should use FSL based on your tutorials for ROI extraction based on the activation I got?

    Sorry about all those questions..I may be asking for a lot here but if you have any pieces of information that may be helpful or if you could provide me with any guidance I would be more than grateful.

    In any case thank you very much for your wonderful work! I appreciate it!

    Best regards,
    Magda.

    ReplyDelete
  12. Hi Andy,

    When converting dicom files into a 4d nifti (.nii), do you know how to convert over multiple runs? I'm using mri_convert but it automatically detects the run of the input file and only converts that specific run. I need to convert several runs into one nifti but I'm not sure how to override the 'run' detector, I can't seem to find a flag for this. Any ideas?

    Cheers,
    David

    ReplyDelete
    Replies
    1. Hi David,

      I don't know if you can override the "run" flag, but you can merge them after you've converted them using something like FSL's fslmerge or AFNI's 3dTcat. For example:

      fslmerge -t oneRun.nii run1.nii run2.nii run3.nii

      Best,

      -Andy

      Delete
  13. Hi Andy
    I downloaded a dmri data from ppmi-info.org. In each subject's folder there are bvals,bvects and dmri data. The problem is there is just one bval=0 in data, but with my knowledge at least there should be two volumes with zero b-values in different PE directions to do topup. How can I solve this problem?
    thanks

    ReplyDelete
  14. Hi Andrew,
    The link for downloading sample FSL data doesn't seem to work. Is there any other link I can use to download your sample data folder?
    Thanks!

    ReplyDelete
  15. Hey Andy,

    I hope you're doing well. The link for the example data does not seem to work:

    mypage.iu.edu/~ajahn

    What can be done about this? I would greatly like to follow these videos!

    ReplyDelete
  16. in FSL can you measure the activity with a ROI ?

    ReplyDelete