code: def test_seg_em():
      # Create a node object
      seg_em = EM()
  
      # Check if the command is properly defined
      cmd = get_custom_path("seg_EM", env_dir="NIFTYSEGDIR")
      assert seg_em.cmd == cmd
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          seg_em.run()
  
      # Assign some input data
      in_file = example_data("im1.nii")
      seg_em.inputs.in_file = in_file
      seg_em.inputs.no_prior = 4
  
      cmd_tmp = "{cmd} -in {in_file} -nopriors 4 -bc_out {bc_out} -out \
  {out_file} -out_outlier {out_outlier}"
  
      expected_cmd = cmd_tmp.format(
          cmd=cmd,
          in_file=in_file,
          out_file="im1_em.nii.gz",
          bc_out="im1_bc_em.nii.gz",
          out_outlier="im1_outlier_em.nii.gz",
      )
  
      assert seg_em.cmdline == expected_cmd
  
imports: import pytest
  from ....testing import example_data
  from ...niftyreg import get_custom_path
  from ...niftyreg.tests.test_regutils import no_nifty_tool
  from ..None import EM
label_desc: Use image node_id 1 for calling a global function with example usage: test_seg_em() without return types