qsiprep.utils.ingress module

Utilities to handle data from other preprocessing pipelines

qsiprep.utils.ingress.collect_ukb_participants(ukb_layout, participant_label)[source]

Collect all valid UKB participants.

Parameters:
  • ukb_layout (list of dict) – A list of dictionaries containing the subject ID, session ID, path to the ukb directory, and the path to the fake dwi file.

  • participant_label (list of str) – A list of participant labels to search for.

Returns:

participants – A list of participant labels.

Return type:

list of str

qsiprep.utils.ingress.create_ukb_layout(ukb_dir, participant_label=None)[source]

Find all valid ukb directories under ukb_dir.

Parameters:
  • ukb_dir (pathlib.Path) – The path to the ukb directory.

  • participant_label (list of str) – A list of participant labels to search for.

Returns:

ukb_layout – A list of dictionaries containing the subject ID, session ID, path to the ukb directory, and the path to the fake dwi file.

Return type:

list of dict

qsiprep.utils.ingress.find_ukb_directory(ukb_directory_list, subject_id)[source]

Find a UKB directory for a given subject ID.

Parameters:
  • ukb_directory_list (list of pathlib.Path) – A list of ukb directories to search.

  • subject_id (str) – The subject ID to search for.

Returns:

ukb_directory – The path to the ukb directory.

Return type:

pathlib.Path

qsiprep.utils.ingress.missing_from_ukb_directory(ukb_subject_dir)[source]

Check for missing files in a ukb subject directory.

Parameters:

ukb_subject_dir (pathlib.Path) – The path to the ukb subject directory.

Returns:

missing_files – A list of missing files.

Return type:

list of str

qsiprep.utils.ingress.ukb_dirname_to_bids(ukb_dir)[source]

Convert a UKB directory name to a BIDS subject ID.

Parameters:

ukb_dir (pathlib.Path) – The path to the ukb directory.

Returns:

bids_subject_id – The BIDS subject ID and session ID, combined in a string.

Return type:

str