Hi Z,
I don't see an A->B transformation in your description, so can I assume you computed all those transformations not using the A dataset? The trick then would be to move A to B with @Align_Centers as a first step. That won't apply any interpolation, of course, because only the origin moves in the header of the dataset. The centering brings the data to a kind of B(pre) space, so you probably want to compute an A(Bpre)->B alignment and continuing on. Inverting the transformation could be done in reverse stopping at the B(pre) space before another @Align_Centers or the inverse of the shift.1D applied with 3drefit instead. This method is used in the @animal_warper script to move data in both directions, so you can look at that script for an example. HTH!