mriqc.utils package

Submodules

mriqc.utils.misc module

Helper functions

mriqc.utils.misc.bids_scan_file_walker(dataset='.', include_types=None, warn_no_files=False)[source]

Traverse a BIDS dataset and provide a generator interface to the imaging files contained within.

Author:@chrisfilo

https://github.com/preprocessed-connectomes-project/quality-assessment-protocol/blob/master/scripts/qap_bids_data_sublist_generator.py

Parameters:
  • dataset (str) – path to the BIDS dataset folder.
  • include_types (list(str)) – a list of the scan types (i.e. subfolder names) to include in the results. Can be any combination of “func”, “anat”, “fmap”, “dwi”.
  • warn_no_files (bool) – issue a warning if no imaging files are found for a subject or a session.
Returns:

a list containing, for each .nii or .nii.gz file found, the BIDS identifying tokens and their values. If a file doesn’t have an identifying token its key will be None.

mriqc.utils.misc.gather_bids_data(dataset_folder, subject_inclusion=None, scan_type=None)[source]

Extract data from BIDS root folder

mriqc.utils.misc.reorder_csv(csv_file, out_file=None)[source]

Put subject, session and scan in front of csv file

Parameters:
  • csv_file (str) – the input csv file
  • out_file (str) – if provided, a new csv file is created
Returns:

the path to the file with the columns reordered

Module contents

Module utils.misc contains utilities