Skip to content

Commit

Permalink
update part-ma tag
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieStLaurent committed Jan 17, 2025
1 parent 17bf80d commit 6bb10bd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/glmsingle/GLMsingle_cleanmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
out_path = f"{args.things_dir}/glmsingle"

sub_list = ['01', '02', '03', '06']
suffix = '_space-T1w_desc-preproc_part-mag_bold.nii.gz'
suffix = '_part-mag_space-T1w_desc-preproc_bold.nii.gz'

for sub_num in sub_list:
mask_path = f'{out_path}/sub-{sub_num}/glmsingle/input'
Expand Down
12 changes: 6 additions & 6 deletions code/glmsingle/GLMsingle_preprocBOLD.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def compile_maskedBOLD_hdf5(data_path, out_path, sub_num, mni=False):
Generate a mask from the union of brain voxels across sessions and runs
'''
if mni:
mask_suffix = '_space-MNI152NLin2009cAsym_desc-brain_part-mag_mask.nii.gz'
mspace = 'T1w'
else:
mask_suffix = '_space-T1w_desc-brain_part-mag_mask.nii.gz'
mask_suffix = '_part-mag_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz'
mspace = 'MNI'
else:
mask_suffix = '_part-mag_space-T1w_desc-brain_mask.nii.gz'
mspace = 'T1w'

mask_list = sorted(
glob.glob(f'{data_path}/sub-{sub_num}/ses-*/func/*{mask_suffix}')
Expand All @@ -73,9 +73,9 @@ def compile_maskedBOLD_hdf5(data_path, out_path, sub_num, mni=False):
Time is in TR (1.49s)
'''
if mni:
suffix = '_space-MNI152NLin2009cAsym_desc-preproc_part-mag_bold.nii.gz'
suffix = '_part-mag_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz'
else:
suffix = '_space-T1w_desc-preproc_part-mag_bold.nii.gz'
suffix = '_part-mag_space-T1w_desc-preproc_bold.nii.gz'

bold_files = sorted(
glob.glob(f'{data_path}/sub-{sub_num}/ses-*/func/*{suffix}')
Expand Down
4 changes: 2 additions & 2 deletions code/glmsingle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ python GLMsingle_preprocBOLD.py --data_dir="${DATADIR}" --out_dir="${OUTDIR}" --

**Input**:
- All of a subject's ``*_bold.nii.gz`` files, for all sessions (~36) and runs (6 per session)
(e.g., ``sub-03_ses-10_task-things_run-1_space-T1w_desc-preproc_part-mag_bold.nii.gz``).
(e.g., ``sub-03_ses-10_task-things_run-1_part-mag_space-T1w_desc-preproc_bold.nii.gz``).
Note that the script can process scans in MNI or T1w space (default is T1w; use default).

**Output**:
Expand Down Expand Up @@ -145,7 +145,7 @@ python GLMsingle_cleanmask.py --things_dir="${DATADIR}"

**Input**:
- All 4 subject's ``*bold.nii.gz`` files, for all sessions (~36) and runs (6 per session) \
(e.g., ``sub-03_ses-10_task-things_run-1_space-T1w_desc-preproc_part-mag_bold.nii.gz``)
(e.g., ``sub-03_ses-10_task-things_run-1_part-mag_space-T1w_desc-preproc_bold.nii.gz``)
- ``sub-{sub_num}_task-things_space-T1w_label-brain_desc-union_mask.nii``, the
functional mask generated from the union of the functional masks of every run in Step 2.

Expand Down
2 changes: 1 addition & 1 deletion code/qc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python compile_headmotion.py --data_dir="${DATADIR}" --out_dir="${OUTDIR}" --sub

*Input*:

- A subject's ``desc-confounds`` files outputed by fmriprep for each run. E.g., ``sub-06_ses-30_task-things_run-5_desc-confounds_part-mag_timeseries.tsv``
- A subject's ``desc-confounds`` files outputed by fmriprep for each run. E.g., ``sub-06_ses-30_task-things_run-5_part-mag_desc-confounds_timeseries.tsv``

*Output*:

Expand Down
4 changes: 2 additions & 2 deletions code/qc/compile_headmotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_arguments():
required=True,
type=str,
help='absolute path to root dataset directory that contains '
'desc-confounds_part-mag_timeseries.tsv files',
'_part-mag_desc-confounds_timeseries.tsv files',
)
parser.add_argument(
'--out_dir',
Expand All @@ -45,7 +45,7 @@ def extract_motion(
extract head motion metrics and concatenate in dataframe.
Export as .tsv
'''
suffix = '_desc-confounds_part-mag_timeseries.tsv'
suffix = '_part-mag_desc-confounds_timeseries.tsv'
confound_files = sorted(glob.glob(
f"{data_path}/sub-{sub_num}/ses-*/func/*{suffix}"))

Expand Down

0 comments on commit 6bb10bd

Please sign in to comment.