code: def test_maths_base(create_files_in_directory_plus_output_type):
      (
          files,
          testdir,
          out_ext,
      ) = create_files_in_directory_plus_output_type
  
      # Get some fslmaths
      maths = fsl.MathsCommand()
  
      # Test that we got what we wanted
      assert maths.cmd == "fslmaths"
  
      # Test that it needs a mandatory argument
      with pytest.raises(ValueError):
          maths.run()
  
      # Set an in file
      maths.inputs.in_file = "a.nii"
      out_file = f"a_maths{out_ext}"
  
      # Now test the most basic command line
      assert (
          maths.cmdline
          == f"fslmaths a.nii {os.path.join(testdir, out_file)}"
      )
  
      # Now test that we can set the various data types
      dtypes = ["float", "char", "int", "short", "double", "input"]
      int_cmdline = "fslmaths -dt {} a.nii " + os.path.join(
          testdir, out_file
      )
      out_cmdline = (
          "fslmaths a.nii "
          + os.path.join(testdir, out_file)
          + " -odt {}"
      )
      duo_cmdline = (
          "fslmaths -dt {} a.nii "
          + os.path.join(testdir, out_file)
          + " -odt {}"
      )
      for dtype in dtypes:
          foo = fsl.MathsCommand(
              in_file="a.nii", internal_datatype=dtype
          )
          assert foo.cmdline == int_cmdline.format(dtype)
          bar = fsl.MathsCommand(in_file="a.nii", output_datatype=dtype)
          assert bar.cmdline == out_cmdline.format(dtype)
          foobar = fsl.MathsCommand(
              in_file="a.nii",
              internal_datatype=dtype,
              output_datatype=dtype,
          )
          assert foobar.cmdline == duo_cmdline.format(dtype, dtype)
  
      # Test that we can ask for an outfile name
      maths.inputs.out_file = "b.nii"
      assert maths.cmdline == "fslmaths a.nii b.nii"
  
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 1 for calling a global function with example usage: test_maths_base(create_files_in_directory_plus_output_type) without return types