code: def _run_interface(self, runtime):
      from nipy.labs.mask import compute_mask
  
      args = {}
      for key in [
          k
          for k, _ in list(self.inputs.items())
          if k not in BaseInterfaceInputSpec().trait_names()
      ]:
          value = getattr(self.inputs, key)
          if isdefined(value):
              if key in ["mean_volume", "reference_volume"]:
                  value = np.asanyarray(nb.load(value).dataobj)
              args[key] = value
  
      brain_mask = compute_mask(**args)
      _, name, ext = split_filename(self.inputs.mean_volume)
      self._brain_mask_path = os.path.abspath(f"{name}_mask.{ext}")
      nb.save(
          nb.Nifti1Image(brain_mask.astype(np.uint8), nii.affine),
          self._brain_mask_path,
      )
  
      return runtime
  
imports: import os
  import nibabel
  import numpy
  from ...utils.filemanip import split_filename, fname_presuffix
  from .base import NipyBaseInterface, have_nipy
  from ..base import TraitedSpec, traits, BaseInterfaceInputSpec, isdefined, File, InputMultiPath, OutputMultiPath
label_desc: Use image node_id 1 for calling the ComputeMask obj's underlying member method code with example usage: obj._run_interface(runtime) and returns: runtime