code: def test_unarymaths(create_files_in_directory_plus_output_type):
      (
          files,
          testdir,
          out_ext,
      ) = create_files_in_directory_plus_output_type
  
      # Get the command
      maths = fsl.UnaryMaths(in_file="a.nii", out_file="b.nii")
  
      # Test the underlying command
      assert maths.cmd == "fslmaths"
  
      # Test that it fails without an operation
      with pytest.raises(ValueError):
          maths.run()
  
      # Test the different operations
      ops = [
          "exp",
          "log",
          "sin",
          "cos",
          "sqr",
          "sqrt",
          "recip",
          "abs",
          "bin",
          "index",
      ]
      for op in ops:
          maths.inputs.operation = op
          assert maths.cmdline == f"fslmaths a.nii -{op} b.nii"
  
      # Test that we don't need to ask for an out file
      for op in ops:
          maths = fsl.UnaryMaths(in_file="a.nii", operation=op)
          assert maths.cmdline == "fslmaths a.nii -{} {}".format(
              op, os.path.join(testdir, f"a_{op}{out_ext}")
          )
  
imports: import os
  import numpy
  from nipype.interfaces.base import Undefined
  import nipype.interfaces.fsl.maths
  from nipype.interfaces.fsl import no_fsl
  import pytest
  from nipype.testing.fixtures import create_files_in_directory_plus_output_type
label_desc: Use image node_id 12 for calling a global function with example usage: test_unarymaths(create_files_in_directory_plus_output_type) without return types