Functional derivatives don’t appear in the func folder

Hello everyone,
I encountered an unexpected issue after running fmripost-aroma. The functional derivative images such as *.aggrDenoised_bold.nii.gz , *.nonaggrDenoised_bold.nii.gz , and *.orthaggrDenoised_bold.nii.gz were not stored in the func folder under each subject’s directory.

├── dataset_description.json
├── logs
│   ├── CITATION.bib
│   ├── CITATION.html
│   ├── CITATION.md
│   └── CITATION.tex
├── sub-01
│   ├── figures
│   │   ├── sub-01_task-rest_desc-about_bold.html
│   │   ├── sub-01_task-rest_desc-aroma_bold.svg
│   │   ├── sub-01_task-rest_desc-metrics_bold.svg
│   │   ├── sub-01_task-rest_desc-normalization_bold.svg
│   │   ├── sub-01_task-rest_desc-summary_bold.html
│   │   ├── sub-01_task-rest_space-MNI152NLin6Asym_desc-aroma_bold.svg
│   │   ├── sub-01_task-rest_space-MNI152NLin6Asym_desc-metrics_bold.svg
│   │   ├── sub-01_task-rest_space-MNI152NLin6Asym_res-02_desc-about_bold.html
│   │   ├── sub-01_task-rest_space-MNI152NLin6Asym_res-02_desc-normalization_bold.svg
│   │   └── sub-01_task-rest_space-MNI152NLin6Asym_res-02_desc-summary_bold.html
│   ├── func
│   │   ├── sub-01_task-rest_desc-aroma_metrics.json
│   │   ├── sub-01_task-rest_desc-aroma_metrics.tsv
│   │   ├── sub-01_task-rest_desc-aroma_timeseries.tsv
│   │   ├── sub-01_task-rest_desc-melodic_components.nii.gz
│   │   ├── sub-01_task-rest_res-2_desc-melodic_mixing.tsv
│   │   ├── sub-01_task-rest_space-MNI152NLin6Asym_res-02_desc-melodic_components.nii.gz
│   │   └── sub-01_task-rest_space-MNI152NLin6Asym_res-2_desc-melodic_mixing.tsv
│   └── log
│       ├── 20250322-172031_594c8693-ecfc-48aa-9a25-591d7f4885da
│       │   └── fmripost_aroma.toml
│       └── 20250322-174752_bcfca69d-48ea-4d30-b831-bdda0dea8ddb
│           └── fmripost_aroma.toml
├── sub-01.html

Command used (and if a helper script was used, a link to the helper script or the command generated):

Below is the shell script for running fmripost-aroma:

docker run --rm -it \
-v /media/dyyang/WD6TB/fmriprep_work/image:/data \
-v /media/dyyang/WD6TB/fmriprep_work/aroma:/out \
-v /media/dyyang/WD6TB/fmriprep_work/prep:/prep \
nipreps/fmripost-aroma \
/data /out participant \
--derivatives fmriprep=/prep \
--participant-label 01

I have assigned right template in the output space, below is shell script for running fmriprep:

#!/bin/bash

bids_root_dir=/media/dyyang/WD6TB/fmriprep_work/image
bids_output=/media/dyyang/WD6TB/fmriprep_work/prep
fs_license=/media/dyyang/WD6TB/fmriprep_work/license.txt
subjlist=("01" "02")

for subj in ${subjlist[@]}; do
    fmriprep-docker $bids_root_dir $bids_output participant \
    --participant-label $subj \
    --output-spaces MNI152NLin6Asym:res-02 \
    --fs-license-file $fs_license
done

Version:

fMRIPost-AROMA version 0.0.10
fmriprep 24.1.1

Environment (Docker, Singularity / Apptainer, custom installation):

Ubuntu 22.04.5 LTS
Docker version 27.5.1

Relevant log outputs (up to 20 lines):

[environment]
cpu_count = 20
exec_env = "singularity"
free_mem = 55.8
overcommit_policy = "heuristic"
overcommit_limit = "50%"
nipype_version = "1.9.2"
templateflow_version = "24.2.2"
version = "0.0.10"

[execution]
bids_dir = "/data"
bids_database_dir = "/tmp/work/20250322-174752_bcfca69d-48ea-4d30-b831-bdda0dea8ddb/bids_db"
bids_description_hash = "e77aff4995fa9ceb1836e6359389013cf76a894bb0feaa63ecdfe95d7118c2b4"
boilerplate_only = false
sloppy = false
debug = []
layout = "BIDS Layout: .../data | Subjects: 2 | Sessions: 0 | Runs: 0"
log_dir = "/out/logs"
log_level = 25
low_mem = false
md_only_boilerplate = false
notrack = true
track_carbon = false
country_code = "CAN"
output_dir = "/out"
aggr_ses_reports = 4
reports_only = false
run_uuid = "20250322-174752_bcfca69d-48ea-4d30-b831-bdda0dea8ddb"
participant_label = [ "01",]
templateflow_home = "/home/fmripost_aroma/.cache/templateflow"
work_dir = "/tmp/work"
write_graph = false

[workflow]
err_on_warn = false
melodic_dim = 0
ignore = [ "fieldmaps",]
slice_time_ref = 0.5
spaces = "MNI152NLin6Asym"

[nipype]
crashfile_format = "txt"
get_linked_libs = false
nprocs = 20
omp_nthreads = 8
plugin = "MultiProc"
remove_unnecessary_outputs = true
resource_monitor = false
stop_on_first_crash = false

[seeds]
master = 32888
ants = 9210
numpy = 61078

[execution.derivatives]
fmriprep = "/prep"

[execution.dataset_links]
input = "PosixPath('/data')"
templateflow = "PosixPath('/home/fmripost_aroma/.cache/templateflow')"
fmriprep = "PosixPath('/prep')"

[nipype.plugin_args]
maxtasksperchild = 1
raise_insufficient = false

Screenshots / relevant information:

Interestingly, fmripost-aroma completed without displaying any error messages. Even when I specified the fmriprep derivative folder as the output destination, the .nii files were still not stored in the designated folder.

Has anyone encountered a similar issue or can provide advice on how to resolve this? Appreciated!

David

There’s a parameter called --denoising-method:

--denoising-method
    Possible choices: aggr, nonaggr, orthaggr

    Denoising method to apply, if any.
1 Like

Thank you for your response - I didn’t realize resolving this could hinge on a single parameter!

While inspecting the outputs, I noticed that the *.nonaggrDenoised_bold.nii.gz files don’t appear smoothed. However, the method section in the HTML report states:

… Automatic removal of motion artifacts using independent component analysis (ICA-AROMA, Pruim et al. 2015) was performed on the preprocessed BOLD on MNI152NLin6Asym space time-series after removal of non-steady state volumes and spatial smoothing with a nonlinear filter that preserves underlying structure (SUSAN, Smith and Brady 1997), using a FWHM of 6.0 mm. Additionally, the component time-series classified as “noise” were collected and placed in the corresponding confounds file.

This suggests smoothing is part of the workflow, similar to the operation in the older fmriprep versions. Is my understanding correct? Thank you!

fMRIPost-AROMA denoises the original data from fMRIPrep, not the smoothed data. Once the core ICA-AROMA pipeline is run (SUSAN + MELODIC + AROMA classification), you end up with component time series classified as signal or noise. You can apply standard denoising approaches to the BOLD data in any space, resolution, etc. using those components, so it’s not necessary to denoise the smoothed data.

1 Like

Thank you for the clarification. I’d like to confirm my understanding and ask for some advice:

Am I correct in understanding that the current fmripost-aroma does not produce a ~desc-smoothAROMAnonaggr_bold.nii.gz output, which was previously generated by earlier versions of fmriprep (e.g., 23.0.2) when using the --use-aroma flag?

For further analyses, would you recommend using the denoised images such as ~.nonaggrDenoised_bold.nii.gz produced by fmripost-aroma ?

Given that these outputs are not smoothed, should we consider applying smoothing as a separate step in our pipeline if our analysis requires it?

Thank you!!

I’m not the right person to ask. I don’t use the denoised derivatives from fMRIPost-AROMA. I typically use the orthogonalized confounds in conjunction with other confounds from fMRIPrep in a separate denoising step (in my case, using XCP-D, which I also maintain). If you want to smooth the data, I’d recommend doing it before denoising the data, so you might want to smooth and denoise the data with separate software.

If you think other people will want smoothed, denoised data, you can open an issue requesting a new smoothing parameter in the fMRIPost-AROMA repository.

1 Like

Thank you for the insights!

I’ve attempted to replicate outputs from older fmriprep versions (with --use-aroma) using the latest fmriprep (without aroma) and fmripost-aroma separately. It seems doesn’t work. I will have a look at XCP-D as well!

XCP-D won’t reproduce what old fMRIPrep versions produced. The smoothing XCP-D does is Gaussian, while AROMA uses SUSAN. To get similar results to the old fMRIPrep, you could (1) run SUSAN on the MNI152NLin56Asym-2mm data and (2) apply non-aggressive denoising to that smoothed file, using code like Denoising Data with Components — tedana 24.0.2 documentation.

2 Likes

I’m also after smoothed + denoised output similar to the old fMRIprep. Just to clarify, fmripost-aroma is using SUSAN to smooth and then apply MELODIC + AROMA, isn’t it? I can see this at least happing in my log. So, the denoising is then just applied to un-smoothed data?

I think so. It performs SUSAN smoothing and MELODIC in the processing. The outputs such as ~.nonaggrDenoised_bold.nii.gz appear to retain unsmoothed.

[Node] Setting-up "fmripost_aroma_0_0_wf.sub_01_wf.single_run_task_rest_wf.aroma_task_rest_wf.smooth" in "/tmp/work/fmripost_aroma_0_0_wf/sub_01_wf/single_run_task_rest_wf/aroma_task_rest_wf/smooth".
250325-12:50:52,10 nipype.workflow INFO:
	 [Node] Executing "smooth" <nipype.interfaces.fsl.preprocess.SUSAN>
250325-12:50:58,493 nipype.workflow INFO:
	 [Node] Finished "conf_plot", elapsed time 8.391021s.
250325-12:50:59,577 nipype.workflow INFO:
	 [Node] Finished "epi_mni_report", elapsed time 12.694357s.
250325-12:51:00,930 nipype.workflow INFO:
	 [Node] Setting-up "fmripost_aroma_0_0_wf.sub_01_wf.single_run_task_rest_wf.func_fit_reports_wf.ds_epi_mni_report" in "/tmp/work/fmripost_aroma_0_0_wf/sub_01_wf/single_run_task_rest_wf/func_fit_reports_wf/ds_epi_mni_report".
250325-12:51:02,107 nipype.workflow INFO:
	 [Node] Executing "ds_epi_mni_report" <fmripost_aroma.interfaces.bids.DerivativesDataSink>
250325-12:51:02,116 nipype.workflow INFO:
	 [Node] Finished "ds_epi_mni_report", elapsed time 0.007448s.
250325-12:53:10,876 nipype.workflow INFO:
	 [Node] Finished "smooth", elapsed time 138.865223s.
250325-12:53:11,995 nipype.workflow INFO:
	 [Node] Setting-up "fmripost_aroma_0_0_wf.sub_01_wf.single_run_task_rest_wf.aroma_task_rest_wf.melodic" in "/tmp/work/fmripost_aroma_0_0_wf/sub_01_wf/single_run_task_rest_wf/aroma_task_rest_wf/melodic".
250325-12:53:11,996 nipype.workflow INFO:
	 [Node] Executing "melodic" <nipype.interfaces.fsl.model.MELODIC>
250325-12:55:17,935 nipype.workflow INFO:
	 [Node] Finished "melodic", elapsed time 125.938414s.