class_docstr: Uses Chris Rorden's dcm2niix to convert dicom files
  
  Examples
  ========
  
  >>> from nipype.interfaces.dcm2nii import Dcm2niix
  >>> converter = Dcm2niix()
  >>> converter.inputs.source_dir = 'dicomdir'
  >>> converter.inputs.compression = 5
  >>> converter.inputs.output_dir = 'ds005'
  >>> converter.cmdline
  'dcm2niix -b y -z y -5 -x n -t n -m 0 -o ds005 -s n -v n dicomdir'
  >>> converter.run() # doctest: +SKIP
  
  In the example below, we note that the current version of dcm2niix
  converts any files in the directory containing the files in the list. We
  also do not support nested filenames with this option. **Thus all files
  must have a common root directory.**
  
  >>> converter = Dcm2niix()
  >>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
  >>> converter.inputs.compression = 5
  >>> converter.inputs.output_dir = 'ds005'
  >>> converter.cmdline
  'dcm2niix -b y -z y -5 -x n -t n -m 0 -o ds005 -s n -v n .'
  >>> converter.run() # doctest: +SKIP
class_docstr_tok: ["Uses","Chris","Rorden","'s","dcm2niix","to","convert","dicom","files","Examples","========",">",">",">","from","nipype.interfaces.dcm2nii","import","Dcm2niix",">",">",">","converter","=","Dcm2niix","(",")",">",">",">","converter.inputs.source_dir","=","'dicomdir'",">",">",">","converter.inputs.compression","=","5",">",">",">","converter.inputs.output_dir","=","'ds005'",">",">",">","converter.cmdline","'dcm2niix","-b","y","-z","y","-5","-x","n","-t","n","-m","0","-o","ds005","-s","n","-v","n","dicomdir'",">",">",">","converter.run","(",")","#","doctest",":","+SKIP","In","the","example","below",",","we","note","that","the","current","version","of","dcm2niix","converts","any","files","in","the","directory","containing","the","files","in","the","list",".","We","also","do","not","support","nested","filenames","with","this","option",".","*","*","Thus","all","files","must","have","a","common","root","directory",".","*","*",">",">",">","converter","=","Dcm2niix","(",")",">",">",">","converter.inputs.source_names","=","[","'functional_1.dcm","'",",","'functional_2.dcm","'","]",">",">",">","converter.inputs.compression","=","5",">",">",">","converter.inputs.output_dir","=","'ds005'",">",">",">","converter.cmdline","'dcm2niix","-b","y","-z","y","-5","-x","n","-t","n","-m","0","-o","ds005","-s","n","-v","n",".","'",">",">",">","converter.run","(",")","#","doctest",":","+SKIP"]
code: def _format_arg(self, opt, spec, val):
      bools = [
          "bids_format",
          "single_file",
          "verbose",
          "crop",
          "has_private",
          "anon_bids",
          "ignore_deriv",
          "philips_float",
          "to_nrrd",
      ]
      if opt in bools:
          spec = deepcopy(spec)
          if val:
              spec.argstr += " y"
          else:
              spec.argstr += " n"
              val = True
      if opt == "source_names":
          return spec.argstr % (os.path.dirname(val[0]) or ".")
      return super()._format_arg(opt, spec, val)
  
imports: import os
  import re
  from copy import deepcopy
  import itertools
  import glob
  from glob import iglob
  from ..utils.filemanip import split_filename
  from .base import CommandLine, CommandLineInputSpec, InputMultiPath, traits, TraitedSpec, OutputMultiPath, isdefined, File, Directory, PackageInfo
label_desc: Use image node_id 2 for calling the Dcm2niix obj's underlying member method code with example usage: obj._format_arg(opt, spec, val) and returns: super, unknown