Sufficient files for MRIQC group level analysis

Hello Everyone, I have run MRIQC individual analysis on a group of subjects which had several different task based fmri scans. I want to do a group level analysis on each specific type of task scan individually. Which folders/files do i need to include in the input location to do so?

I hope this is clear enough. If not please don’t hesitate to ask for more information/clarification.

Hi @Arcadeus,

I believe that given a BIDS-compliant dataset, MRIQC will automatically generate separate group reports for each task it encounters based on the BIDS file naming conventions (i.e., knowing that it should produce separate group reports for task-rest and task-stroop), just as it knows to produce separate individual reports for different modalities, tasks, and/or sessions.

If you only want to run the group report on certain tasks, you can filter the input dataset by specific task by using --task-id (see

mriqc [--task-id [TASK_ID [TASK_ID ...]]]

Thanks for the prompt answer… I will definitely give that a go!

Please report any missing information on the documentation:

The information is there, Im just such a newb that i dont know how to use it 8*(

Sorry, I am just getting used to linux (Ubuntu) syntax. If i just wanted to run the task-rest files, would the switch used be --task-rest?

I think the argument will look something like:

mriqc --task-id task-rest

based on what you mentioned earlier. If you post the full file name of a resting state file we can confirm this.

Thanks for your help. Its greatly appreciated!

the filename looks like sub-rejtrm125_task-rest_bold.nii.gz

however there are also some subjects that we did more than one run on and those look like sub-rejtrm125_task-rest_run-01_bold.nii.gz and sub-rejtrm125_task-rest_run-02_bold.nii.gz etc…

the --task-id task-rest should filter just on task name, collecting all runs for a given task if present. If you run into any issues let us know.

Hello again, I found one source of error. Strangely, when specifying my output path, if i used:

I would get this error:

Traceback (most recent call last):
File “/usr/local/miniconda/bin/mriqc”, line 11, in
load_entry_point(‘mriqc==0.14.2’, ‘console_scripts’, ‘mriqc’)()
File “/usr/local/miniconda/lib/python3.6/site-packages/mriqc/bin/”, line 291, in main
raise Exception(“No data found. No group level reports were generated.”)
Exception: No data found. No group level reports were generated.

However if ran the same output line without the REST:

it runs the standard group reports fine…without the target-id flag.

Im going to route it to a different output (not wanting to overwrite the previous work I did) and try the target-id flag out. Hopefully it will work then.

Wish me luck!

so when I run this:

sudo docker run --cpus 7.0 -m=20G -it --rm -v /mnt/7056E0E656E0AE52/Trajectories_Data/MB_HP_REGTRJ/REGTRJ_Main:/data:ro -v /mnt/7056E0E656E0AE52/Trajectories_Data/MRIQC_rest_group/:/out poldracklab/mriqc:latest /data /out group --target-id task-rest --no-sub

which runs perfectly without the task-id flag, I get this error:

mriqc: error: unrecognized arguments: --target-id task-rest

Hi @Arcadeus

Looking at your command and comparing it to the mriqc command line documentation it appears that there is no option for --target-id which is why you are getting the error. As @rwblair mentioned may you try using --task-id task-rest instead of target--id?

Sorry my mistake! Thanks for catching that. I hastily modified the command line in order to post it… you are of course correct… the flag is --task-id

when i do use the proper command line:

sudo docker run --cpus 7.0 -m=20G -it --rm -v /mnt/7056E0E656E0AE52/Trajectories_Data/MB_HP_REGTRJ/REGTRJ_Main:/data:ro -v /mnt/7056E0E656E0AE52/Trajectories_Data/MRIQC_rest_group/:/out poldracklab/mriqc:latest /data /out group --task-id task-rest --no-sub

I also tried – task-id task_rest following the `mriqc [–task-id [TASK_ID [TASK_ID …]]]’ convention.

In both instances I found these files in the output folder:


looking at the group_bold.html file, I still see a mix of all the bold tasks i.e. the flag didn’t seem to work…

When you are running MRIQC, I believe it will print out the filters identified. What does your readout say? It would be interesting to test dropping the task from task-rest and just passing rest. From the documentation this could be a valid argument

The readout is:
2019-03-19 21:15:14,492 mriqc:IMPORTANT
Running MRIQC version 0.14.2:
* BIDS dataset path: /data.
* Output folder: /out.
* Analysis levels: group.
for both of these runs replacing --task-id task-rest with:
–task-id rest
–task-id rest_bold

It is still generating the same files as above with the group_bold.html reporting on all the func tasks together.

I really cant fully convey my appreciation for your time and effort in trying to resolve this.

Thank you for your patience as we work through this.

So if that is the full readout the filters are not picking up the option. A potential workaround could be to make a separate directory of all your rest scans and run MRIQC on just that so it will only make a report out of your rest scans because those are the only ones in there. This can be a quick fix as the root cause is explored further

Great. I will give that a try.

Continuing the discussion from Sufficient files for MRIQC group level analysis:

Hi - is there any update on if the --task-id flag is now working/or if there is a better work-around then creating a new folder? I would like to be able to run group analyses on each specific task that I collect, but have no easy was to do this other than creating different folders.