class_docstr: Interface for executable seg_LabelFusion from NiftySeg platform using
  type STEPS as classifier Fusion.
  
  This executable implements 4 fusion strategies (-STEPS, -STAPLE, -MV or
  - SBA), all of them using either a global (-GNCC), ROI-based (-ROINCC),
  local (-LNCC) or no image similarity (-ALL). Combinations of fusion
  algorithms and similarity metrics give rise to different variants of known
  algorithms. As an example, using LNCC and MV as options will run a locally
  weighted voting strategy with LNCC derived weights, while using STAPLE and
  LNCC is equivalent to running STEPS as per its original formulation.
  A few other options pertaining the use of an MRF (-MRF beta), the initial
  sensitivity and specificity estimates and the use of only non-consensus
  voxels (-unc) for the STAPLE and STEPS algorithm. All processing can be
  masked (-mask), greatly reducing memory consumption.
  
  As an example, the command to use STEPS should be:
  seg_LabFusion -in 4D_Propragated_Labels_to_fuse.nii -out     FusedSegmentation.nii -STEPS 2 15 TargetImage.nii     4D_Propagated_Intensities.nii
  
  `Source code <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ |
  `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_documentation>`_
  
  Examples
  --------
  >>> from nipype.interfaces import niftyseg
  >>> node = niftyseg.LabelFusion()
  >>> node.inputs.in_file = 'im1.nii'
  >>> node.inputs.kernel_size = 2.0
  >>> node.inputs.file_to_seg = 'im2.nii'
  >>> node.inputs.template_file = 'im3.nii'
  >>> node.inputs.template_num = 2
  >>> node.inputs.classifier_type = 'STEPS'
  >>> node.cmdline
  'seg_LabFusion -in im1.nii -STEPS 2.000000 2 im2.nii im3.nii -out im1_steps.nii'
docstr: Convert input to appropriate format for seg_maths.
docstr_tok: ["Convert","input","to","appropriate","format","for","seg_maths","."]
code: def _format_arg(self, opt, spec, val):
      """Convert input to appropriate format for seg_maths."""
      # Remove options if not STAPLE or STEPS as fusion type:
      if opt in [
          "proportion",
          "prob_update_flag",
          "set_pq",
          "mrf_value",
          "max_iter",
          "unc_thresh",
          "conv",
      ] and self.inputs.classifier_type not in ["STAPLE", "STEPS"]:
          return ""
  
      if opt == "sm_ranking":
          return self.get_staple_args(val)
  
      # Return options string if STEPS:
      if opt == "classifier_type" and val == "STEPS":
          return self.get_steps_args()
  
      return super()._format_arg(opt, spec, val)
  
imports: import os
  import warnings
  from ..base import TraitedSpec, File, traits, isdefined, CommandLineInputSpec, NipypeInterfaceError
  from .base import NiftySegCommand
  from ..niftyreg.base import get_custom_path
  from ...utils.filemanip import load_json, save_json, split_filename
label_desc: Use image node_id 1 for calling the LabelFusion obj's underlying member method code with example usage: obj._format_arg(opt, spec, val) and returns: super, str, self, self