xcp_d.ingression.ukbiobank module

Functions to convert preprocessed UK Biobank BOLD data to BIDS derivatives format.

xcp_d.ingression.ukbiobank.convert_ukb2bids(in_dir, out_dir, participant_ids=None, bids_filters={})[source]

Convert UK Biobank derivatives to BIDS-compliant derivatives.

Parameters:
  • in_dir (str) – Path to UK Biobank derivatives.

  • out_dir (str) – Path to the output BIDS-compliant derivatives folder.

  • participant_ids (None or list of str) – List of participant IDs to run conversion on. The participant IDs must not have the “sub-” prefix. If None, the function will search for all subjects in in_dir and convert all of them.

  • bids_filters (dict) – Filters to apply to select files to convert. The only filter that is currently supported is {“bold”: {“session”: []}}.

Returns:

participant_ids – The list of subjects whose derivatives were converted.

Return type:

list of str

Notes

Since the T1w is in standard space already, we use identity transforms.

xcp_d.ingression.ukbiobank.convert_ukb_to_bids_single_subject(in_dir, out_dir, sub_id, ses_id)[source]

Convert UK Biobank derivatives to BIDS-compliant derivatives for a single subject.

Parameters:
  • in_dir (str) – Path to the subject’s UK Biobank derivatives.

  • out_dir (str) – Path to the output fMRIPrep-style derivatives folder.

  • sub_id (str) – Subject identifier, without “sub-” prefix.

  • ses_id (str) – Session identifier, without “ses-” prefix.

Notes

The BOLD and brain mask files are in boldref space, so they must be warped to standard (MNI152NLin6Asym) space with FNIRT.

Since the T1w is in standard space already, we use identity transforms.

<sub_id>_<ses_id>_2_0
    ├── fMRI
    │   ├── rfMRI.ica
    │   │   ├── mc
    │   │   │   ├── prefiltered_func_data_mcf_abs.rms
    │   │   │   └── prefiltered_func_data_mcf.par
    │   │   ├── reg
    │   │   │   ├── example_func2standard.mat
    │   │   │   └── example_func2standard_warp.nii.gz
    │   │   ├── filtered_func_data_clean.nii.gz
    │   │   └── mask.nii.gz
    │   ├── rfMRI_SBREF.json
    │   └── rfMRI_SBREF.nii.gz
    └── T1
        └── T1_brain_to_MNI.nii.gz