code: def test_fslmaths(create_files_in_directory_plus_output_type):
      filelist, outdir, _ = create_files_in_directory_plus_output_type
      math = fsl.ImageMaths()
  
      # make sure command gets called
      assert math.cmd == "fslmaths"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          math.run()
  
      # .inputs based parameters setting
      math.inputs.in_file = filelist[0]
      math.inputs.op_string = "-add 2.5 -mul input_volume2"
      math.inputs.out_file = "foo_math.nii"
      assert (
          math.cmdline
          == "fslmaths %s -add 2.5 -mul input_volume2 foo_math.nii"
          % filelist[0]
      )
  
      # .run based parameter setting
      math2 = fsl.ImageMaths(
          in_file=filelist[0],
          op_string="-add 2.5",
          out_file="foo2_math.nii",
      )
      assert (
          math2.cmdline
          == "fslmaths %s -add 2.5 foo2_math.nii" % filelist[0]
      )
  
file_path: nipype/nipype/interfaces/fsl/tests/test_utils.py
imports: import os
  import numpy
  import nibabel
  import pytest
  import nipype.interfaces.fsl.utils
  from nipype.interfaces.fsl import no_fsl, Info
  from nipype.testing.fixtures import create_files_in_directory_plus_output_type
label_desc: Use image node_id 3 for calling a global function with example usage: test_fslmaths(create_files_in_directory_plus_output_type) without return types