qsirecon.utils.bids module
- exception qsirecon.utils.bids.BIDSError(message, bids_root)[source]
Bases:
ValueError
- exception qsirecon.utils.bids.BIDSWarning[source]
Bases:
RuntimeWarning
- qsirecon.utils.bids.clean_datasinks(workflow: Workflow, qsirecon_suffix: str | None) Workflow[source]
Overwrite the base_directory of Datasinks.
- qsirecon.utils.bids.collect_anatomical_data(*, layout, subject_id, session_id, needs_t1w_transform, infant_mode=False, bids_filters=None)[source]
Gather any high-res anatomical data (images, transforms, segmentations) to use in recon workflows.
This function searches through input data to see what anatomical data is available. The anatomical data may be in a freesurfer directory.
- Parameters:
- Returns:
Notes
We’ll probably want to allow/collect multiple output space transforms in the future.
- qsirecon.utils.bids.collect_participants(bids_dir, participant_label=None, strict=False, bids_validate=True)[source]
List the participants under the BIDS root and checks that participants designated with the participant_label argument exist in that folder.
Returns the list of participants to be finally processed.
Requesting all subjects in a BIDS directory root:
>>> collect_participants('ds114') ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10']
Requesting two subjects, given their IDs:
>>> collect_participants('ds114', participant_label=['02', '04']) ['02', '04']
Requesting two subjects, given their IDs (works with ‘sub-’ prefixes):
>>> collect_participants('ds114', participant_label=['sub-02', 'sub-04']) ['02', '04']
Requesting two subjects, but one does not exist:
>>> collect_participants('ds114', participant_label=['02', '14']) ['02']
>>> collect_participants('ds114', participant_label=['02', '14'], ... strict=True) Traceback (most recent call last): qsirecon.utils.bids.BIDSError: ...
- qsirecon.utils.bids.get_entity(filename, entity)[source]
Extract a given entity from a BIDS filename via string manipulation.
- qsirecon.utils.bids.get_iterable_dwis_and_anats(layout)[source]
Look through the BIDS Layout for DWIs and their corresponding anats.
- qsirecon.utils.bids.write_atlas_dataset_description(atlas_dir)[source]
Write dataset_description.json file for Atlas derivatives.
- Parameters:
atlas_dir (
str) – Path to the output QSIRecon Atlases dataset.