code: def test_overlay(create_files_in_directory_plus_output_type):
      filelist, outdir, _ = create_files_in_directory_plus_output_type
      overlay = fsl.Overlay()
  
      # make sure command gets called
      assert overlay.cmd == "overlay"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          overlay.run()
  
      # .inputs based parameters setting
      overlay.inputs.stat_image = filelist[0]
      overlay.inputs.stat_thresh = (2.5, 10)
      overlay.inputs.background_image = filelist[1]
      overlay.inputs.auto_thresh_bg = True
      overlay.inputs.show_negative_stats = True
      overlay.inputs.out_file = "foo_overlay.nii"
      assert (
          overlay.cmdline
          == "overlay 1 0 %s -a %s 2.50 10.00 %s -2.50 -10.00 foo_overlay.nii"
          % (filelist[1], filelist[0], filelist[0])
      )
  
      # .run based parameter setting
      overlay2 = fsl.Overlay(
          stat_image=filelist[0],
          stat_thresh=(2.5, 10),
          background_image=filelist[1],
          auto_thresh_bg=True,
          out_file="foo2_overlay.nii",
      )
      assert (
          overlay2.cmdline
          == "overlay 1 0 {} -a {} 2.50 10.00 foo2_overlay.nii".format(
              filelist[1],
              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 4 for calling a global function with example usage: test_overlay(create_files_in_directory_plus_output_type) without return types