00 - Overview

Overview about how to get from DICOM files from the Scanner to your GLM Analysis
MRI
DICOM
BIDS
Preprocessing
Analysis
Author

MG

Published

28 Jul 2025

Modified

28 Jul 2025

1 General

This page gives an overview and brief information about the necessary steps to get from your raw DICOM files to an Analysis. You can find more detailed information by navigating to the sub-pages by clicking on the caption of the respective point.

2 Get your data

There are two ways how you get your data:

  1. Regular scanning time:

  2. Scanning with Natalia or piloting with Thomas

    • we have the raw DICOM files
    • conversion to niftis has to be done (see here)
    • defacing has to be done (see here)
Warning

IMPORTANT: Load the DICOM files to the server and delete them from any external/local device (USB-Stick, local storage of your computer, etc.) as soon as possible!!!

3 DICOM-Files

  • the raw files from the scanner are DICOM-Files
  • in general, we primarily use .nii.gz/.nii (NIFTI) files for the subsequent steps

\(\to\) before we can continue, we need to convert DICOM- to .nii.gz files

WarningDELETE DICOMS FROM YOUR OWN DEVICES AS SOON AS POSSIBLE

Load the DICOM files to the server and delete them from any external/local device (USB-Stick, local storage of your computer, etc.) as soon as possible!!!

4 DICOM to nifti

There are multiple options to convert DICOM to .nii.gz files:

  1. Newest approach (recommended): use the BIDScoin workfolw

    # call bidscoiner module
    cd /shared/
    ml bidscoin
    
    # sort dicoms (otherwise not all the data will be discoverable by bidscoiner)
    dcm2niix -o [YOUR_SORTED_DICOM_DIR] -r y [YOUR_ORIGINAL_DICOM_DIR]
    
    # convert to bids
    # edit following the instructions on
    # https://visualneuroscience.github.io/mri/dicom-to-glm/01-dicom-to-bids.html#sec-bidscoiner
    bidsmapper [YOUR_SORTED_DICOM_DIR] [YOUR_BIDS_DIR]
    
    # convert
    bidscoiner [YOUR_SORTED_DICOM_DIR] [YOUR_BIDS_DIR] 
  2. Older approach: using a script from Adam that can be found here (or here: /shared/website/dcm2bids_adam.sh). All steps are also described in a separate page

  3. Older bidscoin approach: use the BIDScoin workflow implemented in /shared/website/dcm2bids_coiner.sh. All steps are also described in a separate page

all approaches should result in .nii.gz files in BIDS format

5 Check the “IntendedFor” entry of the fmap’s JSON file

  • “tells” fmriPrep where to apply distortion correction

  • depending on the fMRIprep version you plan to use, the field has to look slightly different!

  • to avoid unnecessary problems and delays, it doesn´t harm to always check this field before running fMRIprep!

6 Distribute the T1w files to participants?

  • if you promised participants that they will get their T1w images, you should make sure that they really get them
  • this should be done before defacing
  • You should delete the “non-defaced” files either after you distributed them to the respective participants, or after your study ended

7 Defacing your data

  • defaced data is necessary to safely run fMRIprep
  • Save faced T1w-files to give to your participants (if you got the data during regular scanning times, there should be a faced directory, but you should still make sure, that you have the faced T1w files if you need them for your participants!)
  • NEVER share data (e.g. on open Neuro) that was not defaced before!
  • Defacing is done with pydeface (Docker; Version 2.0.2)

8 (Remove denoising scan from your data)

  • if a denoising sequence was used, but you don´t use denoising data, you might have to remove the last volume of each scan before continuing

9 fmriprep

  • one of many BIDS-Apps (that require a BIDS-valid Dataset)
  • combines various anatomical and functional preprocessing steps within one tool
  • necessary, time intense process

10 Probabilistic Retinotopic Mapping

  • might be necessary to specifically test potential effects in specific visual areas (e.g. V1, V2, etc.)
  • provides retinotopy information (visual areas, eccentricity, etc.) even in the absence of dedicated retinotopy runs

11 first-level Analysis

  • in the first level GLM you process the data of individual subjects
  • for each subject, you define/estimate a model that can explain your data
  • you define meaningful contrasts (e.g. your experimental conditions)
  • you account for potential confounds

12 Group-Level ROI Analysis

  • in the group-level ROI analysis, you extract relevevant (for your research questions/hypothesis) information from your first level GLM
  • you should save this information in a format that allows you to later run your statistical analysis (e.g. as a .csv file)

13 Statistical Analysis

  • with your extracted data (that are saved in a .csv file), you can now run your statistical analysis
Back to top