small refactoring to avoid duplicate code + set matrix properties in nifti header of jacobian fields