code: def test_mask(create_files_in_directory_plus_output_type):
      (
          files,
          testdir,
          out_ext,
      ) = create_files_in_directory_plus_output_type
  
      # Get the command
      masker = fsl.ApplyMask(in_file="a.nii", out_file="c.nii")
  
      # Test the underlying command
      assert masker.cmd == "fslmaths"
  
      # Test that the mask image is mandatory
      with pytest.raises(ValueError):
          masker.run()
  
      # Test setting the mask image
      masker.inputs.mask_file = "b.nii"
      assert masker.cmdline == "fslmaths a.nii -mas b.nii c.nii"
  
      # Test auto name generation
      masker = fsl.ApplyMask(in_file="a.nii", mask_file="b.nii")
      assert (
          masker.cmdline
          == "fslmaths a.nii -mas b.nii "
          + os.path.join(testdir, f"a_masked{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 8 for calling a global function with example usage: test_mask(create_files_in_directory_plus_output_type) without return types