Table of content
The brain imaging data structure (BIDS) is fast becoming the main standard to organize raw neuroimaging data.
Having your data in BIDS offers many downstream advantages to users: use of standardized pipelines, facilitate data sharing and reuse…
But getting your data to be BIDS compliant and using can also be source of much frustration. Especially when it is the first time you are dealing with neuroimaging data.
This workshop aims to lessen the frustration level you will experience when curating and using your data.
Content
This workshop is divided in 4 parts.
“Theory”: The BIDS data management principles
Remembering and following a rule is always easier when you understand why the rule was put in place: this first part explains some of the reasons why BIDS is structured the way it is.
Slides are available here.
BIDS conversion by hand
Using automated BIDS converters is recommended, but using them too early can turn BIDS into a black box. So doing the conversion of one small dataset by hand helps better understand “what data/information goes where”.
To do this part you can follow along the “cookbook” page.
Automated BIDS conversion
Converting large numbers files quickly becomes impractical and error prone when by hand. So learning to use a bids converters should be the next logical step.
Here are a few intro slides.
To do this part you can follow along the “bids_conversion” page.
Using BIDS apps
To wrap up it is good use BIDS applications on the dataset we have created.
To do this part you can follow along the “bids_app” page.
Notes
This workshop is mostly geared for the MRI part of BIDS but many principles of BIDS apply to all imaging modalities.
We will finish the workshop with a “ask me anything about BIDS” session where you can come with more specific questions as they relate to your use case.
Not covered
The follow issues are be covered in this workshop:
- Where to store data
- Ethical issues around data sharing (notably GDPR)
- Data version control (for example with Datalad)
Pre-requisites
- Coding experience:
none
- Prior experience with neuroimaging data:
none
- Data: feel free to bring your own dataset to work on but if you do not have data, some data is provided.
- Data type
- fMRI and resting state
- Anat
- DTI
- Physio / eyetracking
Softwares to install
Below is a list of softwares, you will need to install to follow the workshop.
If you have troubles when installing any of these, please contact me before the workshop and come to the “open-office” that will happen before the workshop` starts.
For more details and trouble shooting eventual installation problems, check the page dedicated to your operating system:
Visual studio code
Install Visual studio code as your code editor.
Python
If you have never used Python before, install it with the installer adapted to your system (32 vs 64 bit, Apple M1 vs Intel…) miniconda.
- For Windows, you should only have to run the
.exe
installer. - For MacOs, you can try to simply use the
.pkg
installer adapted for your computer. If that does not work try the method described here. - For Linux, you should use the bash installer as described here.
Dcm2niix
Install the DICOM to Nifti converter: Dcm2niix
If installing with
the correct installer for your operating system
does not work, try installing
MRIcroGL that should ship with
Dcm2niix
.
BIDScoin
Install the BIDScoin converter
If you have installed Miniconda properly, you should only need to open a Terminal (for Linux and MacOS) or an Anaconda Powershell Prompt (for Windows) and type:
pip install bidscoin
BIDScoin will need to be able to find the dcm2niix
executable that you
installed on your computer.
To test this you can run the following command in a terminal:
bidseditor .
This will ask you to open a bidsmap.yml
file, you can click cancel
to load
the default values. You can then go to the Options
tab where there is a
dcm2niix2bids - plugin
section.
The command
part of this section refers to what command bidscoin must run to
use dcm2niix
.
This should be the path to the dcm2niix
executable on your computer.
- For example on Windows:
"C:\Program Files\dcm2niix\bin\dcm2niix.exe"
- For Linux or Mac:
/usr/local/bin/dcm2niix
On Mac or Linux, you can check the path to dcm2niix
by running the following:
which dcm2niix
More details on the bidscoin documentation.
Docker
Install Docker Desktop
To check that things are properly installed, open a Terminal (for Linux and MacOS) or an Anaconda Powershell Prompt (for Windows) and type the following to make sure everything works:
docker run hello-world
A brief introductory message should then be printed to the screen.
Once you have done this, you can download the “images” of 2 bids app: be careful that they may take quite a bit of space on your hard drive (about 12 Go each), so make sure you have enough free space.
- download the latest version of the MRIQC docker image for quality control.
docker pull nipreps/mriqc:latest
- download the latest version of the fmriprep docker image for preprocessing.
docker pull nipreps/fmriprep:latest
Note that to run fmriprep, you will also need a license for Freesurfer that you can get for free here: https://surfer.nmr.mgh.harvard.edu/registration.html.
Optional: VSCode extensions
Those extensions are not needed but may help you when dealing with python code or json files in general.
ars. (The author listed for all of these extensions should be
Microsoft
.)
Python
(n.b., you will need to reload VSCode after installing this)json