When using finite differences to approximate the Jacobian of the fieldmap, it is essential that the sampling points be evenly spaced along the phase-encoding direction. When resampling into orig space, this is satisfied, but targeting anatomical space, the error scales with the rotation of the target axis relative to the phase-encoding direction. For MNI, the situation is worse, as the grid that is sampled uniformly in template space may be highly irregular in boldref space.
The distortion is still correct, but the intensity scaling is problematic in subject and template spaces. Given that the fieldmap is fairly smooth, the impact should be small, but since we're taking the derivative, the impact should be highest where the correction is most extreme.
At this point, --ignore fmap-jacobian should be considered recommended usage.
This issue affects every version since 23.2.
There are two possible solutions:
- Sample the field map into BOLD space and calculate the Jacobian there. Sample both after mapping coordinates from the target space, and call it a day. (Note that the Jacobian must pad with 1, not 0.)
- Project the BOLD orientation vector into fieldmap space. Calculate the derivative analytically from the spline coefficients, take the dot product with the orientation vector to get the difference field, and then finish the Jacobian calculation ( $J = 1 + \tau_{ro}\left(\nabla\phi \cdot \vec o\right)$ ). Because this is a scalar field, we can resample that into the target space as well.
Both require a bit of reworking. The second is more satisfying to me, if we can analytically calculate the derivative correctly.
One additional point: we should be projecting the target FoV into the fieldmap space to ensure that we have full coverage when we resample.
When using finite differences to approximate the Jacobian of the fieldmap, it is essential that the sampling points be evenly spaced along the phase-encoding direction. When resampling into orig space, this is satisfied, but targeting anatomical space, the error scales with the rotation of the target axis relative to the phase-encoding direction. For MNI, the situation is worse, as the grid that is sampled uniformly in template space may be highly irregular in boldref space.
The distortion is still correct, but the intensity scaling is problematic in subject and template spaces. Given that the fieldmap is fairly smooth, the impact should be small, but since we're taking the derivative, the impact should be highest where the correction is most extreme.
At this point,
--ignore fmap-jacobianshould be considered recommended usage.This issue affects every version since 23.2.
There are two possible solutions:
Both require a bit of reworking. The second is more satisfying to me, if we can analytically calculate the derivative correctly.
One additional point: we should be projecting the target FoV into the fieldmap space to ensure that we have full coverage when we resample.