Modifying bb_file_manager.py to capture input files - McIntosh-Lab/tvb-ukbb GitHub Wiki
Adding additional capture patterns for subjects' filenames in the pipeline is relatively straightforward. We will be using the main
branch to show how to make changes specific to your dataset.
In bb_pipeline_tools/bb_file_manager.py
, find this block of code:
patterns_actions = [
[["*.[^log]"], capitalize_and_clean],
[["dicom", "DICOM"], move_to, "delete/"],
[["*T1*.nii.gz", "*MPRAGE*.nii.gz", "*IR-FSPGR*.nii.gz"], manage_struct, "T1"],
[["T2*FLAIR*.nii.gz", "*FLAIR*.nii.gz"], manage_struct, "T2"],
[
[
"*FMRI*RESTING*.nii.gz",
"MB8*RESTING*.nii.gz",
"*TASK*REST*.nii.gz",
"*task*rest*.nii.gz",
"*epi_rest*.nii.gz",
"*rsfMRI*.nii.gz",
"*fcMRI*.nii.gz",
],
manage_fMRI,
"rfMRI",
],
[
[
"*fmri*task*.nii.gz",
"*FMRI*TASK*.nii.gz",
"MB8*TASK*.nii.gz",
"*epi_movie*.nii.gz",
"*epi_smt*.nii.gz",
],
manage_fMRI,
"tfMRI",
],
[["SWI*nii.gz"], manage_SWI],
[["DIFF_*", "MB3_*", "*dwi*.*", "*DWI*.*"], manage_DWI],
You'll notice that each modality has a list of file patterns associated with it. For example, by adding epi_aud*.nii.gz
to the fMRI file pattern block, we can capture any files that match this pattern, e.g. epi_aud_sub123456.nii.gz
. This works for all modalities.
Note: for diffusion, make sure your .bval
and .bvec
files have the same filename as your .nii.gz
so they are correctly associated with one another.