code: def test_meanimage(create_files_in_directory_plus_output_type):
      (
          files,
          testdir,
          out_ext,
      ) = create_files_in_directory_plus_output_type
  
      # Get the command
      meaner = fsl.MeanImage(in_file="a.nii", out_file="b.nii")
  
      # Test the underlying command
      assert meaner.cmd == "fslmaths"
  
      # Test the default opstring
      assert meaner.cmdline == "fslmaths a.nii -Tmean b.nii"
  
      # Test the other dimensions
      cmdline = "fslmaths a.nii -{}mean b.nii"
      for dim in ["X", "Y", "Z", "T"]:
          meaner.inputs.dimension = dim
          assert meaner.cmdline == cmdline.format(dim)
  
      # Test the auto naming
      meaner = fsl.MeanImage(in_file="a.nii")
      assert meaner.cmdline == "fslmaths a.nii -Tmean {}".format(
          os.path.join(testdir, f"a_mean{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 4 for calling a global function with example usage: test_meanimage(create_files_in_directory_plus_output_type) without return types