Changing header geometry numbers?

Hello AFNI Gurus,

I have a problem with the alignment of older mask files (BRIK/HEAD format) on to a newer nifti volume. Looking back at the processing the +orig anat files were generated with to3d, after renaming the dicoms in correct slice order. Whereas the new nifti files were generated without the rename step with dcm2niix. I thought the volumes should align perfectly, but there seems to be a shift in the old mask files in the viewer. Looking at the header info from 3dinfo for both the geometry numbers weren’t the same, as expected seeing that they didn’t align in the viewer. Is there a utility in ANFI that will allow me to change the geometry to make the mask align to the nifti?

I thought that 3dresample should do this, setting the master to the newer nifti, it does change the header info, but the original shift still persists when overlaying the mask over the nifti.

The original mask:

Geometry String: “MATRIX(-0.073238,0,0.997315,-74.87848,0.997315,0,0.073238,-159.0646,0,-1,0,128):256,256,176”
Data Axes Tilt: Oblique (4.200 deg. from plumb)
Data Axes Approximate Orientation:
first (x) = Anterior-to-Posterior
second (y) = Superior-to-Inferior
third (z) = Right-to-Left [-orient ASR]
R-to-L extent: -74.878 [R] -to- 100.122 [L] -step- 1.000 mm [176 voxels]
A-to-P extent: -159.065 [A] -to- 95.935 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -127.000 [I] -to- 128.000 [S] -step- 1.000 mm [256 voxels]

nifti volume:

Geometry String: “MATRIX(-0.997314,0.073238,0,80.97565,-0.073238,-0.997314,0,108.0673,0,0,1,-127):176,256,256”
Data Axes Tilt: Oblique (4.200 deg. from plumb)
Data Axes Approximate Orientation:
first (x) = Left-to-Right
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient LPI]
R-to-L extent: -94.024 [R] -to- 80.976 [L] -step- 1.000 mm [176 voxels]
A-to-P extent: -146.933 [A] -to- 108.067 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -127.000 [I] -to- 128.000 [S] -step- 1.000 mm [256 voxels]

mask after 3dresample:

Geometry String: “MATRIX(-0.999999,0,0,80.97565,0,-1,0,108.0673,0,0,1,-127):176,256,256”
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Left-to-Right
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient LPI]
R-to-L extent: -94.024 [R] -to- 80.976 [L] -step- 1.000 mm [176 voxels]
A-to-P extent: -146.933 [A] -to- 108.067 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -127.000 [I] -to- 128.000 [S] -step- 1.000 mm [256 voxels]

Any assistance would be greatly appreciated.

-Ben