code: def test_reg_jacobian_jac():
      """Test interface for RegJacobian"""
      # Create a reg_jacobian object
      nr_jacobian = RegJacobian()
  
      # Check if the command is properly defined
      assert nr_jacobian.cmd == get_custom_path("reg_jacobian")
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          nr_jacobian.run()
  
      # Test Reg Jacobian: jac
      ref_file = example_data("im1.nii")
      trans_file = example_data("warpfield.nii")
      nr_jacobian.inputs.ref_file = ref_file
      nr_jacobian.inputs.trans_file = trans_file
      nr_jacobian.inputs.omp_core_val = 4
  
      cmd_tmp = "{cmd} -omp 4 -ref {ref} -trans {trans} -jac {jac}"
      expected_cmd = cmd_tmp.format(
          cmd=get_custom_path("reg_jacobian"),
          ref=ref_file,
          trans=trans_file,
          jac="warpfield_jac.nii.gz",
      )
  
      assert nr_jacobian.cmdline == expected_cmd
  
      # Test Reg Jacobian: jac m
      nr_jacobian_2 = RegJacobian(type="jacM", omp_core_val=4)
      ref_file = example_data("im1.nii")
      trans_file = example_data("warpfield.nii")
      nr_jacobian_2.inputs.ref_file = ref_file
      nr_jacobian_2.inputs.trans_file = trans_file
  
      cmd_tmp = "{cmd} -omp 4 -ref {ref} -trans {trans} -jacM {jac}"
      expected_cmd = cmd_tmp.format(
          cmd=get_custom_path("reg_jacobian"),
          ref=ref_file,
          trans=trans_file,
          jac="warpfield_jacM.nii.gz",
      )
  
      assert nr_jacobian_2.cmdline == expected_cmd
  
      # Test Reg Jacobian: jac l
      nr_jacobian_3 = RegJacobian(type="jacL", omp_core_val=4)
      ref_file = example_data("im1.nii")
      trans_file = example_data("warpfield.nii")
      nr_jacobian_3.inputs.ref_file = ref_file
      nr_jacobian_3.inputs.trans_file = trans_file
  
      cmd_tmp = "{cmd} -omp 4 -ref {ref} -trans {trans} -jacL {jac}"
      expected_cmd = cmd_tmp.format(
          cmd=get_custom_path("reg_jacobian"),
          ref=ref_file,
          trans=trans_file,
          jac="warpfield_jacL.nii.gz",
      )
  
      assert nr_jacobian_3.cmdline == expected_cmd
  
file_path: nipype/nipype/interfaces/niftyreg/tests/test_regutils.py
imports: import os
  import pytest
  from ....utils.filemanip import which
  from ....testing import example_data
  from ..None import get_custom_path, RegAverage, RegResample, RegJacobian, RegTools, RegMeasure, RegTransform
label_desc: Use image node_id 3 for calling a global function with example usage: test_reg_jacobian_jac() without return types