code: def test_binary_stats():
      """Test for the seg_stats interfaces"""
      # Create a node object
      binarys = BinaryStats()
  
      # Check if the command is properly defined
      cmd = get_custom_path("seg_stats", env_dir="NIFTYSEGDIR")
      assert binarys.cmd == cmd
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          binarys.run()
  
      # Assign some input data
      in_file = example_data("im1.nii")
      binarys.inputs.in_file = in_file
      binarys.inputs.operand_value = 2
      binarys.inputs.operation = "sa"
  
      expected_cmd = f"{cmd} {in_file} -sa 2.00000000"
  
      assert binarys.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 UnaryStats, BinaryStats
label_desc: Use image node_id 2 for calling a global function with example usage: test_binary_stats() without return types