Usage of ANTs composite transform file when transforming from MNI to T1 space

Hello neurostars,
I have a question regarding the usage of the ANTs composite transform file (.h5)
included in the fmriprep output.
I have calculated some statistical maps on the bold_space-MNI152NLin2009cAsym
that I want to transform to participant’s T1 space.

For that I am using this command:

antsApplyTransforms -d 4 --float 0 --verbose 1 \
-i dr_stage2_subject00000_Z.nii.gz \
-o dr_stage2_subject00000_Z_T1.nii.gz \
-r sub-01_T1w_preproc.nii.gz \
-t sub-01_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 \
-n NearestNeighbor

This gives the output with the error:

Input scalar image: dr_stage2_subject00000_Z.nii.gz
Reference image: sub-01_T1w_preproc.nii.gz
Can't read initial transform sub-01_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5

I am fairly new to ANTs that’s why I want to make sure that what I am doing here is
correct. Any ideas?

Note: I used the -d (dimension) flag with the value 4 here because the statistical maps I want to transform are the 4D melodic outputs with different independent components in each volume.
Can it be that that’s why the command is not working because the original registration is computed between two 3d images (MNI and T1) ?

I guess that was really the issue.
When I split the 4D file (melodic output) with fslsplit and create separate 3D maps out of it:

fslsplit dr_stage2_subject00000_Z.nii.gz zmap -t

and then do the same computation with flag -d with value 3:

antsApplyTransforms -d 3 --float 0 --verbose 1 \
-i zmap0001.nii.gz \
-o zmap0001_inT1.nii.gz \
-r sub-01_T1w_preproc.nii.gz \
-t sub-01_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 \
-n NearestNeighbor

the command works fine. Is that the answer you think or is there a one step solution to that?

MANAGED BY INCF