class_docstr: create an anatomical segmentation for the geometric transfer matrix (GTM).
  
  Examples
  --------
  >>> gtmpvc = GTMPVC()
  >>> gtmpvc.inputs.in_file = 'sub-01_ses-baseline_pet.nii.gz'
  >>> gtmpvc.inputs.segmentation = 'gtmseg.mgz'
  >>> gtmpvc.inputs.reg_file = 'sub-01_ses-baseline_pet_mean_reg.lta'
  >>> gtmpvc.inputs.pvc_dir = 'pvc'
  >>> gtmpvc.inputs.psf = 4
  >>> gtmpvc.inputs.default_seg_merge = True
  >>> gtmpvc.inputs.auto_mask = (1, 0.1)
  >>> gtmpvc.inputs.km_ref = ['8 47']
  >>> gtmpvc.inputs.km_hb = ['11 12 50 51']
  >>> gtmpvc.inputs.no_rescale = True
  >>> gtmpvc.inputs.save_input = True
  >>> gtmpvc.cmdline  # doctest: +NORMALIZE_WHITESPACE
  'mri_gtmpvc --auto-mask 1.000000 0.100000 --default-seg-merge     --i sub-01_ses-baseline_pet.nii.gz --km-hb 11 12 50 51 --km-ref 8 47 --no-rescale     --psf 4.000000 --o pvc --reg sub-01_ses-baseline_pet_mean_reg.lta --save-input     --seg gtmseg.mgz'
  
  >>> gtmpvc = GTMPVC()
  >>> gtmpvc.inputs.in_file = 'sub-01_ses-baseline_pet.nii.gz'
  >>> gtmpvc.inputs.segmentation = 'gtmseg.mgz'
  >>> gtmpvc.inputs.regheader = True
  >>> gtmpvc.inputs.pvc_dir = 'pvc'
  >>> gtmpvc.inputs.mg = (0.5, ["ROI1", "ROI2"])
  >>> gtmpvc.cmdline  # doctest: +NORMALIZE_WHITESPACE
  'mri_gtmpvc --i sub-01_ses-baseline_pet.nii.gz --mg 0.5 ROI1 ROI2 --o pvc --regheader --seg gtmseg.mgz'
class_docstr_tok: ["create","an","anatomical","segmentation","for","the","geometric","transfer","matrix","(","GTM",")",".","Examples","--","--","--","--",">",">",">","gtmpvc","=","GTMPVC","(",")",">",">",">","gtmpvc.inputs.in_file","=","'sub-01_ses-baseline_pet.nii.gz'",">",">",">","gtmpvc.inputs.segmentation","=","'gtmseg.mgz'",">",">",">","gtmpvc.inputs.reg_file","=","'sub-01_ses-baseline_pet_mean_reg.lta'",">",">",">","gtmpvc.inputs.pvc_dir","=","'pvc'",">",">",">","gtmpvc.inputs.psf","=","4",">",">",">","gtmpvc.inputs.default_seg_merge","=","True",">",">",">","gtmpvc.inputs.auto_mask","=","(","1",",","0.1",")",">",">",">","gtmpvc.inputs.km_ref","=","[","'","8","47","'","]",">",">",">","gtmpvc.inputs.km_hb","=","[","'11","12","50","51","'","]",">",">",">","gtmpvc.inputs.no_rescale","=","True",">",">",">","gtmpvc.inputs.save_input","=","True",">",">",">","gtmpvc.cmdline","#","doctest",":","+NORMALIZE_WHITESPACE","'mri_gtmpvc","--","auto-mask","1.000000","0.100000","--","default-seg-merge","--","i","sub-01_ses-baseline_pet.nii.gz","--","km-hb","11","12","50","51","--","km-ref","8","47","--","no-rescale","--","psf","4.000000","--","o","pvc","--","reg","sub-01_ses-baseline_pet_mean_reg.lta","--","save-input","--","seg","gtmseg.mgz'",">",">",">","gtmpvc","=","GTMPVC","(",")",">",">",">","gtmpvc.inputs.in_file","=","'sub-01_ses-baseline_pet.nii.gz'",">",">",">","gtmpvc.inputs.segmentation","=","'gtmseg.mgz'",">",">",">","gtmpvc.inputs.regheader","=","True",">",">",">","gtmpvc.inputs.pvc_dir","=","'pvc'",">",">",">","gtmpvc.inputs.mg","=","(","0.5",",","[","``","ROI1","''",",","``","ROI2","''","]",")",">",">",">","gtmpvc.cmdline","#","doctest",":","+NORMALIZE_WHITESPACE","'mri_gtmpvc","--","i","sub-01_ses-baseline_pet.nii.gz","--","mg","0.5","ROI1","ROI2","--","o","pvc","--","regheader","--","seg","gtmseg.mgz","'"]
code: def _format_arg(self, name, spec, val):
      # Values taken from
      # https://github.com/freesurfer/freesurfer/blob/fs-7.2/mri_gtmpvc/mri_gtmpvc.cpp#L115-L122
      if name == "optimization_schema":
          return (
              spec.argstr
              % {
                  "3D": 1,
                  "2D": 2,
                  "1D": 3,
                  "3D_MB": 4,
                  "2D_MB": 5,
                  "1D_MB": 6,
                  "MBZ": 7,
                  "MB3": 8,
              }[val]
          )
      if name == "mg":
          return spec.argstr % (val[0], " ".join(val[1]))
      return super()._format_arg(name, spec, val)
  
imports: import os
  from ...None import logging
  from ..base import TraitedSpec, File, traits, Directory, InputMultiPath, isdefined
  from .base import FSCommand, FSTraitedSpec
  from .model import GLMFitInputSpec, GLMFit
label_desc: Use image node_id 1 for calling the GTMPVC obj's underlying member method code with example usage: obj._format_arg(name, spec, val) and returns: super, unknown, unknown