code: def test_spatial_filter(create_files_in_directory_plus_output_type):
      (
          files,
          testdir,
          out_ext,
      ) = create_files_in_directory_plus_output_type
  
      # Get the command
      filter = fsl.SpatialFilter(in_file="a.nii", out_file="b.nii")
  
      # Test the underlying command
      assert filter.cmd == "fslmaths"
  
      # Test that it fails without an operation
      with pytest.raises(ValueError):
          filter.run()
  
      # Test the different operations
      for op in ["mean", "meanu", "median"]:
          filter.inputs.operation = op
          assert filter.cmdline == f"fslmaths a.nii -f{op} b.nii"
  
      # Test that we don't need to ask for an out name
      filter = fsl.SpatialFilter(in_file="a.nii", operation="mean")
      assert filter.cmdline == "fslmaths a.nii -fmean {}".format(
          os.path.join(testdir, f"a_filt{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 11 for calling a global function with example usage: test_spatial_filter(create_files_in_directory_plus_output_type) without return types