How can I update the FoV following an initial rigid-body transform?

I am using antsApplyTransforms to perform an initial rigid body transformation of BOLD data to be better aligned with structural images prior to running fMRIPrep (the pipeline fails without this pre-“preprocessing”).

The call I am making is as follows:

antsApplyTransforms /
	-d 3 /
	-i path_to_bold.nii.gz /
	-o path_to_bold_resliced.nii.gz /
	-r /tmp/first_vol_of_bold.nii.gz /
	-e 3 /
	--output-data-type int /
	--verbose /
	--interpolation LanczosWindowedSinc /
	--float /
	-t [T1w_to_bold.txt,1] /
	-t [ses-V02_to_ses-V01.txt,0]

My BOLD image goes from this:
image

To this:
image

So, it gets aligned, but the superior slices are now clipped.

There is clearly a way this must be possible, as using ITK-SNAP to perform this manually works (the file size becomes a whopping 1.3GB however, so not ideal):
image

QUESTION: What changes are necessary to prevent this clipping from happening while keeping filesize under control?

Update: If I mess around by changing the i,j,k translation values of the affine matrix of the reference BOLD volume just before calling antsApplyTransformations I can update the FoV to avoid the clipping issue. Problem is, I used arbitrary values as offsets. Perhaps someone can let me know how to determine ideal values every time.

Update 2 : The most consistent answer I found so far was using the combined transformation matrix that was calculated by taking the dot product of all individual transformation matrices. Importantly:

  • The order has to follow what antsApplyTransforms would do (i.e. work from last written -t flag to first).
  • Invert any matrices that involved the opposite transformation (i.e. transform came from registering T1w to BOLD but you’d like to have the BOLD to be the moving image)

Then from my observations the following rules apply w.r.t the relationship between translations in the transform matrix vs the affine matrix:

  • For i (left/right), these appear to be concordant (i.e. a transformation of -50 [50mm to the left] needs to be accompanied by changing the affine’s i by -50)
  • For j (anterior/posterior), these appear to be concordant (i.e. a transformation of +20 [20mm anteriorly] needs to be accompanied by changing the affine’s j by +20)
  • For k (superior/inferior), these appear to be discordant (i.e. a transformation of -10 [10mm superiorly] needs to be accompanied by changing the affine’s k by +10)

Just my observations, I’m guessing ITK’s conventions are different??? ¯\_(ツ)_/¯