mriqc
mriqc copied to clipboard
Feature request: filter input dataset by other ids
Hi all,
Would it be possible to include additional filters for processing and report generation, such as:
--acq-id filter input dataset by acquisition id --ce-id filter input dataset by contrast enhanced id --mod-id filter input dataset by modification id
Sean Hatton University of California, San Diego
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I would be also interested in this feature. I tried to dig a little bit in the code and found different places where PR could be made :
-
Adding new options for filtering at the command line call here : https://github.com/poldracklab/mriqc/blob/f6c7066fd0dcf7cf41ac77cad1bf3c5254f3bb6d/mriqc/bin/mriqc_run.py#L65-L74
-
Then in the main function, options are forwarded to
init_mrqchttps://github.com/poldracklab/mriqc/blob/f6c7066fd0dcf7cf41ac77cad1bf3c5254f3bb6d/mriqc/bin/mriqc_run.py#L213 -
In
init_mrqcoptions should be pass explicitly tocollect_bids_datahttps://github.com/poldracklab/mriqc/blob/f6c7066fd0dcf7cf41ac77cad1bf3c5254f3bb6d/mriqc/bin/mriqc_run.py#L401-L408 -
In
collect_bids_datawe could then add options to the BIDSLayout filtering API https://github.com/poldracklab/mriqc/blob/f6c7066fd0dcf7cf41ac77cad1bf3c5254f3bb6d/mriqc/utils/bids.py#L19-L24
Does it make sense ?
Wondering if supporting the bids_filter_file.json like fmriprep does would be possible for this ?
Our lab could really use this functionality, as we are working on lowfield scans that often cause MRIQC to fail. Being able to filter with the acq- tag would be ideal.
The most flexible option is, as @Remi-Gau says, to add --bids-filter-file. @naveau identified the correct places to update.
Original PRs to implement this in fMRIPrep:
- https://github.com/nipreps/niworkflows/pull/407
- https://github.com/nipreps/fmriprep/pull/1770
Current code:
collect_data(): https://github.com/nipreps/niworkflows/blob/26bd24f8d03bdf3e55fe108f38fd1bc505eb7188/niworkflows/utils/bids.py#L150-L261- CLI parsing: https://github.com/nipreps/fmriprep/blob/a1974f706ce2250f0535b9f42af395e2fb227a82/fmriprep/cli/parser.py#L179-L190
- Passing filters to
collect_data(): https://github.com/nipreps/fmriprep/blob/a1974f706ce2250f0535b9f42af395e2fb227a82/fmriprep/workflows/base.py#L156-L162
Would you like to have a go at implementing this?
I'd be willing to make an attempt at this. I've figured out the pybids filter parsing in another project recently and having this functionality in MRIQC would be helpful in our group as well. @Remi-Gau helped me take a pass over the process and I have an idea where I'd start.
In addition to the other links, I did find this function that appears to be unused to load a filter dictionary. Was there a beginning of integrating a filter file that was just never finished?
Sorry, missed your response. My guess is that was copied in from fMRIPrep at some point, but not fully transitioned. So kind of.