class_docstr: Examples
  --------
  
  >>> from nipype.interfaces.ants import MeasureImageSimilarity
  >>> sim = MeasureImageSimilarity()
  >>> sim.inputs.dimension = 3
  >>> sim.inputs.metric = 'MI'
  >>> sim.inputs.fixed_image = 'T1.nii'
  >>> sim.inputs.moving_image = 'resting.nii'
  >>> sim.inputs.metric_weight = 1.0
  >>> sim.inputs.radius_or_number_of_bins = 5
  >>> sim.inputs.sampling_strategy = 'Regular'
  >>> sim.inputs.sampling_percentage = 1.0
  >>> sim.inputs.fixed_image_mask = 'mask.nii'
  >>> sim.inputs.moving_image_mask = 'mask.nii.gz'
  >>> sim.cmdline
  'MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] --metric MI["T1.nii","resting.nii",1.0,5,Regular,1.0]'
class_docstr_tok: ["Examples","--","--","--","--",">",">",">","from","nipype.interfaces.ants","import","MeasureImageSimilarity",">",">",">","sim","=","MeasureImageSimilarity","(",")",">",">",">","sim.inputs.dimension","=","3",">",">",">","sim.inputs.metric","=","'MI'",">",">",">","sim.inputs.fixed_image","=","'T1.nii'",">",">",">","sim.inputs.moving_image","=","'resting.nii'",">",">",">","sim.inputs.metric_weight","=","1.0",">",">",">","sim.inputs.radius_or_number_of_bins","=","5",">",">",">","sim.inputs.sampling_strategy","=","'Regular'",">",">",">","sim.inputs.sampling_percentage","=","1.0",">",">",">","sim.inputs.fixed_image_mask","=","'mask.nii'",">",">",">","sim.inputs.moving_image_mask","=","'mask.nii.gz'",">",">",">","sim.cmdline","'MeasureImageSimilarity","--","dimensionality","3","--","masks","[","``","mask.nii","''",",","''","mask.nii.gz","''","]","--","metric","MI","[","``","T1.nii","''",",","''","resting.nii","''",",1.0,5",",","Regular,1.0","]","'"]
code: def _format_arg(self, opt, spec, val):
      if opt == "metric":
          return self._metric_constructor()
      elif opt == "fixed_image_mask":
          return self._mask_constructor()
      return super()._format_arg(opt, spec, val)
  
imports: import os
  from ...utils.filemanip import ensure_list
  from ..base import TraitedSpec, File, Str, traits, InputMultiPath, isdefined
  from .base import ANTSCommand, ANTSCommandInputSpec, LOCAL_DEFAULT_NUMBER_OF_THREADS
label_desc: Use image node_id 3 for calling the MeasureImageSimilarity obj's underlying member method code with example usage: obj._format_arg(opt, spec, val) and returns: super, self, self