xcp_d.ingression.hcpya module

Functions for converting HCP-YA-format data to fMRIPrep format.

These functions are specifically designed to work with HCP-YA data downloaded around Feb 2023. Because HCP-YA doesn’t really version their processing pipeline and derivatives, we have to pin to download periods.

xcp_d.ingression.hcpya.convert_hcp2bids(in_dir, out_dir, participant_ids=None)[source]

Convert HCP derivatives to BIDS-compliant derivatives.

Parameters:
  • in_dir (str) – Path to HCP 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.

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 instead of the individual transforms available in the DCAN derivatives.

xcp_d.ingression.hcpya.convert_hcp_to_bids_single_subject(in_dir, out_dir, sub_ent)[source]

Convert HCP derivatives to BIDS-compliant derivatives for a single subject.

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

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

  • sub_ent (str) – Subject identifier, with “sub-” prefix.

Notes

Since the T1w is in standard space already, we use identity transforms instead of the individual transforms available in the DCAN derivatives.

sub-<sub_id>
    └── files
        └── MNINonLinear
            ├── Results
            │   ├── *_<TASK_ID><RUN_ID>_<DIR_ID>
            │   │   ├── SBRef_dc.nii.gz
            │   │   ├── *_<TASK_ID><RUN_ID>_<DIR_ID>.nii.gz
            │   │   ├── *_<TASK_ID><RUN_ID>_<DIR_ID>_Atlas_MSMAll.dtseries.nii
            │   │   ├── Movement_Regressors.txt
            │   │   ├── Movement_AbsoluteRMS.txt
            │   │   └── brainmask_fs.2.0.nii.gz
            ├── fsaverage_LR32k
            │   ├── L.pial.32k_fs_LR.surf.gii
            │   ├── R.pial.32k_fs_LR.surf.gii
            │   ├── L.white.32k_fs_LR.surf.gii
            │   ├── R.white.32k_fs_LR.surf.gii
            │   ├── <sub_id>.L.thickness.32k_fs_LR.shape.gii
            │   ├── <sub_id>.R.thickness.32k_fs_LR.shape.gii
            │   ├── <sub_id>.L.corrThickness.32k_fs_LR.shape.gii
            │   ├── <sub_id>.R.corrThickness.32k_fs_LR.shape.gii
            │   ├── <sub_id>.L.curvature.32k_fs_LR.shape.gii
            │   ├── <sub_id>.R.curvature.32k_fs_LR.shape.gii
            │   ├── <sub_id>.L.sulc.32k_fs_LR.shape.gii
            │   ├── <sub_id>.R.sulc.32k_fs_LR.shape.gii
            │   ├── <sub_id>.L.MyelinMap.32k_fs_LR.func.gii
            │   ├── <sub_id>.R.MyelinMap.32k_fs_LR.func.gii
            │   ├── <sub_id>.L.SmoothedMyelinMap.32k_fs_LR.func.gii
            │   └── <sub_id>.R.SmoothedMyelinMap.32k_fs_LR.func.gii
            ├── T1w.nii.gz
            ├── aparc+aseg.nii.gz
            ├── brainmask_fs.nii.gz
            └── ribbon.nii.gz