#!/bin/bash # REST (just put to T1w space) # set vars sub="111001" task="rest" run="1" template_name="T1w" # load modules module load ants # NEED TO SET IF STATEMENTS FOR TASK VS. REST # loop subs echo $sub # set paths fmriprep_dir=/blue/ebner/share/AOL_MRI/fmriprep/sub-${sub} tedana_dir=/blue/ebner/share/AOL_MRI/tedana_aic/tedana_aic_${task}/sub-${sub}_tedana # Result of denoising the scanner-space multi-echo data with tedana file_to_warp="${tedana_dir}/sub-${sub}_desc-optcomDenoised_bold.nii.gz" # Name of the standard-space denoised data file to be written out out_file="${tedana_dir}/sub-${sub}_space-${template_name}_desc-optcomDenoised_bold.nii.gz" # An existing T1w-space reference T1w_space_file="${fmriprep_dir}/func/sub-${sub}_task-${task}_space-${template_name}_boldref.nii.gz" # Transforms xform_native_to_t1w="${fmriprep_dir}/func/sub-${sub}_task-${task}_from-scanner_to-T1w_mode-image_xfm.txt" #xform_t1w_to_std="${fmriprep_dir}/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5" # run transform antsApplyTransforms \ --input-image-type 3 \ --input ${file_to_warp} \ --reference-image ${T1w_space_file} \ --output ${out_file} \ --interpolation LanczosWindowedSinc \ --transform ${xform_native_to_t1w} #${xform_t1w_to_std} # information about arguments # input-image-type : input image type 3=time-series # input : input file to warp (denoised timeseries - medn) # reference : template image # output : name of output file # interpolation : several opts this is the one used by Taylor Salo (tedana developer) # transform : the transforms calculated by fmriprep or antsRegistration - can be multiple (e.g., scanner space to T1w, then T1w to template). For rest, can keep in native (will get normalized to fsaverage surf). For task, want to normalize to young-old N100 template from https://zenodo.org/record/3575255. I did not ask fmriprep to calculate those template transforms so need to do that first.