Please note: It is strongly recommended to check your data for artifacts especially if it affects the first b0 image. Since in DIFFPREP processing, the corrections are performed using b0 as the template, it is important that this volume is artifact free. TORTOISE by default uses the first b0 but in command line you have an option to specify the b0 volume you would like to use in the correction. If your first b0 has interleave slice motion artifact, please delete the volume before processing through DIFFPREP and the software will use the next available b0 in the series unless another b0 volume is specified using --b0_id tag.

Syntax to run the DIFFPREP command and various tags are shown here. These options also come up when you type DIFFPREP in your terminal from inside the bin folder.

Note: If TORTOISE is added to your path using the above instructions for the different OS listed, you can run the various executables listed in the upcoming sections by just typing them in the terminal. If TORTOISE is not added to your path, then you will have to go to the folder where the executables exist and run with a ./ before running command of interest.

The various options listed are incorporated in the default settings. If you wish you change any of these settings listed below, please modify them in the reg_settings, that is present in your DIFF_PREP_WORK folder. Remember, if you specify any tag in the command line, it will supersede the options specified in the reg settings file. Please doublecheck the command by going into the following location and opening the text file, after DIFFPREP is run: /….proc/logs/log_main.txt.

If you are unhappy with the processing result, just copy the command in the log_main.txt from the first run and add additional tags to it from the help file below. 

Please note: rerunning a command without -o tag will overwrite the previously written files in a *_proc folder. 


DIFFPREP screenshot-1DIFFPREP screenshot-2qc screenshot

Note: If you have AFNI installed on your computer, by default an output by name QC will be generated in your *_proc folder. Please refer to the section 11 DIFFPREP input and output quality check for more information on the outputs generated in the QC folder. You can turn off this feature by using the tag - -do_qc 0 and the QC folder will not be generated.

Registration settings file will be provided in the TORTOISE folder under the name ‘example registration settings.dmc’ which is set with default settings or to which you can add other options that would be consistently used across all subjects. If you would like to overwrite the registration settings, then the options given in the command line takes higher priority over what is in the settings file. A log of the command run will be saved in the log folder for future reference. This is further explained in the ‘outputs of DIFFPREP section’.

  1. Note:

    Please create a DIFF_PREP_WORK folder in your home directory and copy the example registration settings.dmc file in to the folder. The software expects the settings file to be in the DIFF_PREP_WORK folder.
  2. Note:

    If you are processing human data, you are not required to provide a registration settings file and the software will process the data with preset options. The options used in processing such datasets will be written in the proc folder as .dmc. The output resolution will be in the native resolution of the image.
  3. Note:

    You may modify the registration settings file before processing to suit your study. The options are explained in the registration settings.dmc (can open with any text editor) and the same file can be used for the entire study.
  4. Note:

    You may use ‘will_be_drbuddied 1’ option to turn on this tag. This will run the only the motion and eddy distortion correction in DIFFPREP. You may then refer to section on DRBUDDI for further steps in generating EPI corrected data. Also refer the section on DIFFPREP outputs to see what outputs will be generated in the proc folder if the will_be_drbuddied option is turned on.
  5. Note:

    It is essential to look at your bmtxt files for both up and down data to make sure they match. The signs on all columns and rows in the up_bmtxt should match to the corresponding rows and columns in the down_bmtxt file. Please refer to DRBUDDI section for information on outputs if these two bmtxts do not match.

7.1. Registration steps during DIFFPREP

The screenshot will show you an example of the processing steps that occur when running DIFFPREP.

The example shown here is for a dataset run with the following settings: gibbs ringing correction-on, denoising-on, no EPI disortion correction.

Inked DIFFPREP processing example 2 LI

Note:  If there are processing issues, error messages are displayed in the terminal. Most commonly the errors are related to syntax issues, input data format (.nii or .list) if command specifically requires one or the other or absence of certain libraries to run the commands. If despite checking for these above scenarios, the error persists, please post your question on the forum under the topic of discussion with the command used and the error generated. 

Please refer the home page citations section to cite TORTOISE-DIFFPREP.