Transforming from native BOLD space into T1w space

Hello,

I ran fmriprep on some multi-echo fmri data. I then used this script to collect echo-wise files in the working directory to run tedana for denoising. I was able to run tedana, and now I’m trying to transform desc-optcomDenoised_bold.nii.gz into T1w space so that I can run ciftify.

I used the following script to transform desc-optcomDenoised_bold.nii.gz into MNI space.

maindir=fmriprep/sub-$1/ses-$2

tedanaOutput=${maindir}/func/desc-optcomDenoised_bold.nii.gz

tedanaOutputMNI=${maindir}/func/sub-$1_ses-$2_task-rest_space-MNI152NLin2009cAsym_res-2_desc-MEICAmdl_bold.nii.gz

reference=$HOME/.cache/templateflow/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz

scan2T1w=${maindir}/func/sub-$1_ses-$2_task-rest_*scanner_to-T1w_mode-image_xfm.txt

T1w2MNI=${maindir}/anat/sub-$1_ses-$2_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5

antsApplyTransforms --dimensionality 3 \\
	--input-image-type 3 \\
	--input ${tedanaOutput} \\
	--default-value 0 \\
	--float 1 \\
	--interpolation LanczosWindowedSinc \\
	--output ${tedanaOutputMNI} \\
	--reference-image ${reference} \\
	--transform ${T1w2MNI} \\
	--transform ${scan2T1w} \\
	--verbose 1

However, how could I transform desc-optcomDenoised_bold.nii.gz into T1w space? Would I just change the reference image to the preprocessed T1w image and remove the "–transform ${T1w2MNI} line? Like below? I ran the commands below but the file was very big (>8GB).

maindir=fmriprep/sub-$1/ses-$2

tedanaOutput=${maindir}/func/desc-optcomDenoised_bold.nii.gz

tedanaOutputT1w=${maindir}/func/sub-$1_ses-$2_task-rest_space-T1w_desc-MEICAmdl_bold.nii.gz

referenceT1w=${maindir}/anat/sub-$1_ses-$2_desc-preproc_T1w.nii.gz

scan2T1w=${maindir}/func/sub-$1_ses-$2_task-rest_*scanner_to-T1w_mode-image_xfm.txt

antsApplyTransforms --dimensionality 3 \\
	--input-image-type 3 \\
	--input ${tedanaOutput} \\
	--default-value 0 \\
	--float 1 \\
	--interpolation LanczosWindowedSinc \\
	--output ${tedanaOutputT1w} \\
	--reference-image ${referenceT1w} \\
	--transform ${scan2T1w} \\
	--verbose 1

Any help or thoughts would be appreciated. Thanks!

I am not incredibly familiar with ants, but having played with it a little bit - that does seem to be the right idea.

My only concern is that ${referenceT1w} - I think that also determines the voxels spacing (though I could be wrong). What is the resolution of the original MNI reference? Is it a downsampled version of an MNI space image? Just thinking that you may want to try and match the goal of the original transform - which I’m assuming is a MNI space, OptCom image, with voxel spacing like the original BOLD input.

Either way, it seems like the commands are right - just apply the single xfm, rather than both - and use the T1w image as the reference. How does it look if you try it?