docs: def check_version(Cnt, chcklst=['RESPATH','REGPATH','DCM2NIIX','HMUDIR']):
      ''' Check version and existence of all third-party software and input data.
          Output a dictionary with bool type of the requested bits in 'chcklst'
      '''
  
      # at start, assume that nothing is present yet
      output = {}
      for itm in chcklst:
          output[itm] = False
  
      # niftyreg reg_resample first
      if 'RESPATH' in chcklst and 'RESPATH' in Cnt:
          try:
              proc = Popen([Cnt['RESPATH'], '--version'], stdout=PIPE)
              out = proc.stdout.read()
              if reg_ver in out:
                  output['RESPATH'] = True
          except OSError:
              print 'e> NiftyReg (reg_resample) either is NOT installed or is corrupt.'
      
      # niftyreg reg_aladin
      if 'REGPATH' in chcklst and 'REGPATH' in Cnt:
          try:
              proc = Popen([Cnt['REGPATH'], '--version'], stdout=PIPE)
              out = proc.stdout.read()
              if reg_ver in out:
                  output['REGPATH'] = True
          except OSError:
              print 'e> NiftyReg (reg_aladin) either is NOT installed or is corrupt.'
  
      # dcm2niix
      if 'DCM2NIIX' in chcklst and 'DCM2NIIX' in Cnt:
          try:
              proc = Popen([Cnt['DCM2NIIX'], '-h'], stdout=PIPE)
              out = proc.stdout.read()
              ver_str = re.search('(?<=dcm2niiX version v)\d{1,2}.\d{1,2}.\d*', out)
              if ver_str and dcm_ver in ver_str.group(0):
                  output['DCM2NIIX'] = True
          except OSError:
              print 'e> dcm2niix either is NOT installed or is corrupt.'
  
      # hdw mu-map list
      if 'HMUDIR' in chcklst and 'HMUDIR' in Cnt:
          for hi in Cnt['HMULIST']:
              if os.path.isfile(os.path.join(Cnt['HMUDIR'],hi)):
                  output['HMUDIR'] = True
              else:
                  output['HMUDIR'] = False
                  break
  
      return output