Basic usage
Checklist
Section titled “Checklist”Before running the pipeline, make sure you have completed the following:
-
Prerequisites installed?
Verify that
nextflowand eitherdockerorapptainerare installed and working. See the installation guide for detailed instructions. -
BIDS data validated?
Your data must be organized in BIDS format with the
participants.tsvfile containing the age column. See the inputs guide for details. -
FreeSurfer license available?
-
Know which analysis you want to run?
Decide which profiles you need based on your research goals. See the Understanding the profiles guide.
-
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.
A simple example
Section titled “A simple example”If you’re new to the pipeline, start with this basic command for diffusion MRI preprocessing and tractography:
nextflow run scilus/sf-pediatric -r 0.3.0 \ --input /absolute/path/to/your/BIDS_directory \ --outdir /absolute/path/to/results \ -profile docker,tracking \ -resumeRequired parameters
Section titled “Required parameters”Every pipeline run needs at least these three parameters:
-
--input- Path to your BIDS directoryYour data must follow BIDS format with a
participants.tsvfile containing anagecolumn. -
--outdir- Where to save resultsResults 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) -
-profile- Which profiles to runTerminal window # Always include a container system (docker/apptainer) + processing profiles-profile docker,tracking-profile apptainer,tracking,segmentation,connectomicsSee the profiles guide for detailed information on choosing profiles.
Important optional parameters
Section titled “Important optional parameters”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.
Specify alternative optional parameters
Section titled “Specify alternative optional parameters”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.
How to use a params.yml file
Section titled “How to use a params.yml file”-
Create a
params.yamlfileTo create your file, you can use any text editor you like. Using the
nanotext editor, simply callnano params.ymlin 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 previousinputandoutdirparameters that we previously supplied in the example above. Your resultingparams.ymlwould look something like this:params.yml input: '/path/to/BIDS/'outdir: '/path/to/results/'Once filled, save your file (for the
nanotext editor, useCtrl + Oto write your file thenCtrl + Xto exit the text editor). -
Run the pipeline with the new
params.ymlfileTerminal window nextflow run scilus/sf-pediatric -r 0.3.0 \-profile docker,tracking \-params-file params.yaml \-resumeThis will launch the pipeline exactly as we did before, but we can now further customize our parameters supplied to
sf-pediatric.
Shell selection for DTI and fODF models
Section titled “Shell selection for DTI and fODF models”How to specify shells:
Section titled “How to specify shells:”Reusing our created params.yml file, we can simply add new lines to modify our shell selection for the DTI and fODF fitting.
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:
# 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 \ -resumeFor more details, see --dti_shells and --fodf_shells parameters.
Selecting specific subjects to process
Section titled “Selecting specific subjects to process”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:
input: '/path/to/BIDS/'outdir: '/path/to/results/'participant_label: - sub-01 - sub-02Then, launch the pipeline with the usual command as shown before:
# Process only sub-01 and sub-02nextflow run scilus/sf-pediatric -r 0.3.0 \ -profile docker,tracking \ -params-file params.yaml \ -resumeUnderstanding pipeline outputs
Section titled “Understanding pipeline outputs”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.