-
Notifications
You must be signed in to change notification settings - Fork 1
Home
How to Process MRI Images:
- Beginner's Guide to Command Line Interface
- More about the Command Line Interface
- NITRC, a source for neuroimaging software and data.
-
Before you begin
- Computer setup and Applications
- Preprocessing and processing images
- MRI File Formats
- Download example test-retest multi-modal dataset
- Alternative option for test-retest MRI data
- More public datasets
- Convert DICOM to NIfTI
- BIDS and dcm2bids: Structuring your data sets
- Correct intensity nonuniformities (bias field)
- Resample images to isotropic voxel size 1
- Brain Extraction and Tissue Segmentation
- Hippocampus Segmentation
Generally neuroimaging computing is done on Linux or macOS. You may need to be logged in as root to install many of these programs, depending on the permissions of the directory on which you are installing. The following are specifics about operating systems I currently use to run neuroimaging analyses:
In order to have access to root user you have to directly enable the option, for instructions refer to this page here. You can also install a number of tools using the command line with superuser access: sudo
. If you are on a university or company managed computer, it's a good idea to talk with your IT administrator before installing any software (if you have administrator access).
Before installing any neuroimaging software, there are some tools you should make sure are on your computer first.
You should install the XCode Command Line Tools before beginning any of these other tasks. Probably the easiest way to install these tools is to run the following command
git --version
If you don't have the command line tools installed it will prompt you to install them (requires admin access). You can also install XCode if you wish. I often use it when I'm writing scripts but there are many other options. The version of XCode will vary, depending on your OS version. Read more about XCode.
If you ran the command listed above, you have git installed. You can also visit this link for more instructions, including for other operating systems.
While you can use TextEdit that's built into macOS, it has limitations because it is a pure text editor. It is fast and lightweight though so I use it for most of my quick work. Many people use Vim but it has a steep learning curve and is not user-friendly. I don't recommend it to novices.
One cross-platform option is Atom. Installation instructions for the Mac are here. While this has more features than you'll need for simple Bash scripting (we'll cover that later), it gives you a solid platform to work on.
There are many other options so explore a little to see which editor fits you and your needs. To find options perform a web search for code editor
.
Pip is a package manager for Python.
On macOS you can install it like this in Terminal
easy_install pip
Or, you might need to run it with administrator privileges
sudo easy_install pip
We will use this to install some neuroimaging software.
Homebrew is a general package manager for the command line in macOS. It allows some software to be easily installed and updated (it's essentially a command line version of the App Store).
Install it like this by pasting and running this in Terminal
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
With the Windows Subsystem for Linux activated and Ubuntu installed you can use many common MRI applications. If you are using Windows it may be easier to log in as the Administrator for all of these downloads. If you are using a managed computer, you will likely need your IT administrator to install any software.
Some imaging programs (MANGO, dcm2nii, mricron, and some functions of ANTs) can be installed onto Windows easily but you will quickly find barriers between programs. The neuroimaging community likes to run things on Linux or macOS (although SPM runs well on Windows so many people who do only fMRI research use Windows). If you are interested in having these programs on your own computer I suggest a free installation of Linux. Ubuntu, Mint, Debian, CentOS, and others work well. Ubuntu is quite easy to use and learn. If you aren't fully committed to using just Linux you can run it in a Virtual Machine or partition your drive to dual boot, which allows you to run Linux or Windows upon restarting your computer each time. NeuroDebian is a VM that can be installed and run without too much difficulty. I won't reproduce the installation instructions here.
Another option mentioned previously is with Windows 10 and the Windows Subsystem for Linux. Follow those instructions to get this useful tool installed. Once you enable the WSL, you can easily install your Linux distribution of choice. There are some limitations to the WSL relative to a "pure" installation of Linux but it gives access to a number of the tools previously unusable in Windows. Windows Subsystem for Linux Documentation