code: def test_slicer(create_files_in_directory_plus_output_type):
      filelist, outdir, _ = create_files_in_directory_plus_output_type
      slicer = fsl.Slicer()
  
      # make sure command gets called
      assert slicer.cmd == "slicer"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          slicer.run()
  
      # .inputs based parameters setting
      slicer.inputs.in_file = filelist[0]
      slicer.inputs.image_edges = filelist[1]
      slicer.inputs.intensity_range = (10.0, 20.0)
      slicer.inputs.all_axial = True
      slicer.inputs.image_width = 750
      slicer.inputs.out_file = "foo_bar.png"
      assert (
          slicer.cmdline
          == "slicer {} {} -L -i 10.000 20.000  -A 750 foo_bar.png".format(
              filelist[0],
              filelist[1],
          )
      )
  
      # .run based parameter setting
      slicer2 = fsl.Slicer(
          in_file=filelist[0],
          middle_slices=True,
          label_slices=False,
          out_file="foo_bar2.png",
      )
      assert slicer2.cmdline == "slicer %s   -a foo_bar2.png" % (
          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 5 for calling a global function with example usage: test_slicer(create_files_in_directory_plus_output_type) without return types