{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# First-level analyses (using FSL)\n", "This notebook provides the first part (first-level analysis) of an introduction to multilevel models and how to implement them in FSL. The next notebook, `run_level_analysis.ipynb`, will continue with run-level analysis, and next week we will conclude this topic with group-level analyses. If you haven't done so already, please go throught `linux_and_the_command_line` notebook first!\n", "\n", "You actually know most about \"first-level analyses\" already, as it describes the process of modelling single-subject (single-run) timeseries data using the GLM, which we discussed at length in week 2. In this notebook, you'll learn how to use FSL for (preprocessing and) first-level analyses. Note that there are several other excellent neuroimaging software packages, such as [SPM](https://www.fil.ion.ucl.ac.uk/spm/) (Matlab-based), [AFNI](https://afni.nimh.nih.gov/), [BROCCOLI](https://github.com/wanderine/BROCCOLI), [Freesurfer](https://surfer.nmr.mgh.harvard.edu/), and [Nilearn](https://nilearn.github.io/). In fact, in week 7, there is a notebook on how to use Nilearn to fit statistical models on fMRI data.\n", "\n", "We like FSL in particular, as it's a mature and well-maintained package, free and open-source, and provides both a graphical interface and a command line interface for most of its tools.\n", "\n", "**What you'll learn**: after this lab, you'll be able to ...\n", "\n", "* visualize and inspect (f)MRI in FSLeyes;\n", "* set up a first-level model in FSL FEAT\n", "\n", "**Estimated time needed to complete**: 2-4 hours" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Import functionality\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Using FSLeyes\n", "In the previous notebook about Linux and the command line, we discussed how to use built-in Linux commands and FSL-specific commands using the command line. Now, let's focus on using a specific FSL tool called \"FSLeyes\", which is a useful program to view (f)MRI files (basically any nifti-file). We can start this graphical tool from the command line with the command: `fsleyes &`. We append the `&` to the FSLeyes command because this makes sure FSLeyes will run \"in the background\" and thus allows us to keep using the command line (if we would not use the `&`, FSLeyes would run be active \"in your terminal\", and we wouldn't be able to use that anymore). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "