Skip to end of metadata
Go to start of metadata

Convert scanner data (DICOM) to an Analysis Format

General Overview:
To prepare your data for analysis you need to transfer the raw data from the file repository (BIOSCRIBE) to your desktop computer. In general, the raw data files you receive will not be in the format that the analysis software can read.
We use three programs to accomplish the required file conversions.

Scan Type

Raw File Format

Conversion Program















Contact Todd Richards (

Please note the following:

  • All DICOM files are now being transferred from the SLU 3T scanner to BIOSCRIBE using a software tool called "Image Catapult". If your data were transferred to BIOSCRIBE before March 7th, 2007 then the conversion programs listed above may not work correctly. In that case, contact Jeff Stevenson ( ) to determine how best to proceed.
  • MRIConvert can produce NIFTI files from B0 and DTI DICOM data – however, the files it produces are not suitable for analysis. Please be sure that you convert these scan types using the conversion programs that have been specifically designed for this purpose.

What you need before you begin:
To complete the file transfer and conversion process you will need three conversion programs If you don't have administrator access to your computer then you may not be able to install these programs. In that case, please contact your IT department for support.. These programs are free and available on line. Download and install them.

  1. MRIConvert – on the file "setup.exe" to install this program.
  2. DicomToNiftiB0Map: this program by copying the downloaded executable to the C:/Windows/System32 folder
  3. DicomToDTI this program by copying the downloaded executable to the C:/Windows/System32 folder


  • The programs listed above run on PC's only. If you are using a MAC or Linux system please contact Clark Johnson (
  • The programs for B0 and DTI conversion have been written in Phython. As we release this software we are not sure whether all needed libraries are automatically loaded as part of every Windows installation. If these programs fail to execute please contact Clark Johnson (cjohnson@u.washington). Please provide detailed summaries of error messages so that we can diagnose the problem.

How do I convert from DICOM to an analysis format:
1) Download the DICOM files from BIOSCRIBE. The documentation for this process can be found in the file "TransferDataFromBioscribe.doc" available <here> (insert link here). As you complete this process your data structure will look something like this:

2) Allocate the DICOM files into a folder structure suitable for conversion. MRIConvert automatically identifies all DICOM images within a folder and attempts to convert them. At present, MRIConvert does not correctly process B0 and DTI images. Therefore, these images must be removed from folders that MRIConvert will process. Specifically, you need three general folder structures: a) DTI_And_B0, b) Spectroscopy, and c) Structural_And_fMRI. Here's an example of what this might look like:


  • It is the structure ( not the names ) that is important
  • Multiple DTI scans must also be allocated to distinct folders. This is not necessary for multiple fMRI scans.
  • When the programs execute they will require the specification of an output folder. This screen shot also shows an example of a suitable output folder structure.

3) Use MRIConvert to process your fMRI and Structural data.
Here is a screen shot of the user interface.

Setting up the conversion process:

  • Load the structural and fMRI data. In my case I used the "Add folder" button to load the folder "../DCM_FilesFromBioscribe/Structural_And_fMRI" – Note that the interface shows the DICOM structure of the files in this folder – not the folder name that was selected using the "Add folder" button.
  • Change the output type (see: "FSL NIFTI" in the figure) to reflect the analysis software you are using. The available options are:
    • SPM Analyze
    • Meta Image
    • NIfTI
    • Analyze 7.5
    • FSL NIfTI
    • Brain Voyager
  • If you are using FSL NIfTI – click the "Options" button and enable (e.g. check) the "Save as .nii file" option.
  • Click the "Directory" button and navigate to the output file folder structure you have created (see step 2 above). Note the file naming convention that MRIConvert will use for the output files. This naming convention allows MRIConvert to process multiple fMRI and structural scans in a single folder without conflict. After conversion you can rework both the names and folder structures.
  • Click the "Convert all" button.

8) Convert the DTI and B0 files.
The usage for the DTI and B0 programs is:



Dcm2Nifti_DTI dicom_dir output_dir

  • dicom_dir is the full path to the directory with the DICOM files
  • output_dir is the full path to the output directory.
  • The output files will be DTI (float type), bvals, and bvecs

Dcm2Nifti_B0Map dicom_dir output_dir

  • dicom_dir is the full path to the directory with the DICOM files
  • output_dir is the full path to the output directory.
  • The output files will be B0-MAG and B0-PHASE

To execute these programs:

  • Open a command line interface in windows Start – Run – type "cmd" and press <enter>
  • Execute the programs by typing the program name and required parameters

Note: The output of the DTI program is always "DTI.nii.gz", bvals and bvecs. If you have several DTI scans you will have to execute the program for each scan separately. This will require a more extensive segregation of the raw DTI DICOM data. Be sure to rename the DTI output files each time you run the Dcm2Nifti_DTI program so that inherent distinctions between the various DTI scans remains obvious. In the "Step 2" screen shot, the first of several DTI scans has been converted. All three files (bvals, bvecs, DTI.nii.gz) should be renamed before the second DTI scan is converted.
9) Use an image browsing tool to verify that the images are in correct orientation.
So, for example, FSLVIEW can be used to determine whether the structural and functional data are in LAS orientation. In particular, it is often the case that structural data need to be reordered. A separate documentation file (UsingAVWSWAPDIM_ToGenerateLASImages.pdf ) <here> [resource:insert link]. It describes how to accomplish this task using "avwswapdim"

FileName: V:/AACJ/CHDD/UsingAVWSWAPDIM_ToGenerateLASImages.pdf