mriqc icon indicating copy to clipboard operation
mriqc copied to clipboard

Feature request: filter input dataset by other ids

Open seanhatton opened this issue 7 years ago • 3 comments

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

seanhatton avatar Nov 02 '18 19:11 seanhatton

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.

stale[bot] avatar Feb 10 '19 19:02 stale[bot]

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_mrqc https://github.com/poldracklab/mriqc/blob/f6c7066fd0dcf7cf41ac77cad1bf3c5254f3bb6d/mriqc/bin/mriqc_run.py#L213

  • In init_mrqc options should be pass explicitly to collect_bids_data https://github.com/poldracklab/mriqc/blob/f6c7066fd0dcf7cf41ac77cad1bf3c5254f3bb6d/mriqc/bin/mriqc_run.py#L401-L408

  • In collect_bids_data we 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 ?

naveau avatar Jan 07 '20 08:01 naveau

Wondering if supporting the bids_filter_file.json like fmriprep does would be possible for this ?

Remi-Gau avatar Mar 14 '22 17:03 Remi-Gau

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.

RebeccaAHayes avatar Oct 05 '23 13:10 RebeccaAHayes

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?

effigies avatar Oct 05 '23 13:10 effigies

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?

bcmcpher avatar Oct 06 '23 19:10 bcmcpher

Sorry, missed your response. My guess is that was copied in from fMRIPrep at some point, but not fully transitioned. So kind of.

effigies avatar Nov 14 '23 16:11 effigies