To get the geometry matrix and dimensions:
3dAttribute IJK_TO_DICOM_REAL dset_name
3dAttribute DATASET_DIMENSIONS dset_name
To copy one matrix from a dset to another (but I don't think this is what you want to do for your data case here??):
# tcsh syntax
set obliq_matr = `3dAttribute IJK_TO_DICOM_REAL my_dset`
3dcopy other_dset other_dset_copy.nii
3drefit -atrfloat IJK_TO_DICOM_REAL "${obliq_matr}" other_dset_copy.nii
Above, I copie dthe "other_dset" because refitting the header might do bad, undoable things to it.
--pt