Skip to content

Basic usage

Before running the pipeline, make sure you have completed the following:

  1. Prerequisites installed?

    Verify that nextflow and either docker or apptainer are installed and working. See the installation guide for detailed instructions.

  2. BIDS data validated?

    Your data must be organized in BIDS format with the participants.tsv file containing the age column. See the inputs guide for details.

  3. FreeSurfer license available?

  4. Know which analysis you want to run?

    Decide which profiles you need based on your research goals. See the Understanding the profiles guide.

  5. Will you have access to the internet during processing?

    Internet access is not required to run the pipeline. However, by default, the pipeline will download some dependencies during execution. If you plan on running it on a machine without internet access (e.g., an HPC cluster), head over to the running with no internet access section.

If you’re new to the pipeline, start with this basic command for diffusion MRI preprocessing and tractography:

Terminal window
nextflow run scilus/sf-pediatric -r 0.3.0 \
--input /absolute/path/to/your/BIDS_directory \
--outdir /absolute/path/to/results \
-profile docker,tracking \
-resume

Every pipeline run needs at least these three parameters:

  1. --input - Path to your BIDS directory

    Your data must follow BIDS format with a participants.tsv file containing an age column.

  2. --outdir - Where to save results

    Results can be large (several GB per subject), so choose a location with sufficient space. We recommend naming the output directory with the version number (e.g., --outdir /path/to/results/sf-pediatric-v0.3.0)

  3. -profile - Which profiles to run

    Terminal window
    # Always include a container system (docker/apptainer) + processing profiles
    -profile docker,tracking
    -profile apptainer,tracking,segmentation,connectomics

    See the profiles guide for detailed information on choosing profiles.

While most parameters are optional, it is highly recommended that you ensure they are appropriate for your data and analysis type. You can view an exhaustive list in the parameters section.

Since recent nextflow versions (≥ 26.04.0), all parameters should be supplied using a params.yaml file. This section will detail how to define and supply those parameters using this file format followed by a few common use cases.

  1. Create a params.yaml file

    To create your file, you can use any text editor you like. Using the nano text editor, simply call nano params.yml in the command-line. It will open up a text editor that you can fill up with your desired parameters. As an example, we will fill this file with the previous input and outdir parameters that we previously supplied in the example above. Your resulting params.yml would look something like this:

    params.yml
    input: '/path/to/BIDS/'
    outdir: '/path/to/results/'

    Once filled, save your file (for the nano text editor, use Ctrl + O to write your file then Ctrl + X to exit the text editor).

  2. Run the pipeline with the new params.yml file

    Terminal window
    nextflow run scilus/sf-pediatric -r 0.3.0 \
    -profile docker,tracking \
    -params-file params.yaml \
    -resume

    This will launch the pipeline exactly as we did before, but we can now further customize our parameters supplied to sf-pediatric.

Reusing our created params.yml file, we can simply add new lines to modify our shell selection for the DTI and fODF fitting.

params.yml
input: '/path/to/BIDS/'
outdir: '/path/to/results/'
dti_shells: "0 1500"
fodf_shells: "0 1500 3000"

You can now launch the pipeline exactly as before:

Terminal window
# For HCP-like protocol (b-values: 1500 and 3000)
nextflow run scilus/sf-pediatric -r 0.3.0 \
-profile docker,tracking \
-params-file params.yaml \
-resume

For more details, see --dti_shells and --fodf_shells parameters.

Sometimes, you might want to process only a subset of subjects from your complete BIDS dataset. This is entirely possible using the --participant_label parameter. To select your subject of interest, simply fill the params.yml file with the subject ID you want to process:

params.yml
input: '/path/to/BIDS/'
outdir: '/path/to/results/'
participant_label:
- sub-01
- sub-02

Then, launch the pipeline with the usual command as shown before:

Terminal window
# Process only sub-01 and sub-02
nextflow run scilus/sf-pediatric -r 0.3.0 \
-profile docker,tracking \
-params-file params.yaml \
-resume

The pipeline will create the following structure in your current working directory (assuming your --outdir is located in this directory):

  • Directorywork/ # Temporary files (can be deleted after successful run)
  • Directorysf-pediatric-v0.3.0/ # Your results (specified by —outdir)
    • dataset_description.json
    • participants.tsv
    • Directorymultiqc/ # Quality control reports
    • Directorysub-01/
      • Directoryses-01/
        • Directoryanat/ # Anatomical images (T1w/T2w processing)
        • Directorydwi/ # Diffusion images and tractography
        • Directoryfigures/ # QC visualizations
        • Directorymultiqc/ # Subject-specific QC
        • Directoryxfm/ # Image transformations
  • .nextflow.log # Log file (check this if errors occur)
  • Directory.nextflow/ # Nextflow cache (enables -resume)

For a detailed description of each output file, see the outputs guide.