code: def _create_info_chs_dig(ft_struct):
      """Create the chs info field from the FieldTrip structure."""
      all_channels = ft_struct["label"]
      ch_defaults = dict(
          coord_frame=FIFF.FIFFV_COORD_UNKNOWN,
          cal=1.0,
          range=1.0,
          unit_mul=FIFF.FIFF_UNITM_NONE,
          loc=np.array([0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]),
          unit=FIFF.FIFF_UNIT_V,
      )
      try:
          elec = ft_struct["elec"]
      except KeyError:
          elec = None
  
      try:
          grad = ft_struct["grad"]
      except KeyError:
          grad = None
  
      if elec is None and grad is None:
          warn(
              "The supplied FieldTrip structure does not have an elec or grad "
              "field. No channel locations will extracted and the kind of "
              "channel might be inaccurate."
          )
      if "chanpos" not in (elec or grad or {"chanpos": None}):
          raise RuntimeError(
              "This file was created with an old version of FieldTrip. You can "
              "convert the data to the new version by loading it into FieldTrip "
              "and applying ft_selectdata with an empty cfg structure on it. "
              "Otherwise you can supply the Info field."
          )
  
      chs = list()
      dig = list()
      counter = 0
      for idx_chan, cur_channel_label in enumerate(all_channels):
          cur_ch = ch_defaults.copy()
          cur_ch["ch_name"] = cur_channel_label
          cur_ch["logno"] = idx_chan + 1
          cur_ch["scanno"] = idx_chan + 1
          if elec and cur_channel_label in elec["label"]:
              cur_ch = _process_channel_eeg(cur_ch, elec)
              assert cur_ch["coord_frame"] == FIFF.FIFFV_COORD_HEAD
              # Ref gets ident=0 and we don't have it, so start at 1
              counter += 1
              d = DigPoint(
                  r=cur_ch["loc"][:3],
                  coord_frame=FIFF.FIFFV_COORD_HEAD,
                  kind=FIFF.FIFFV_POINT_EEG,
                  ident=counter,
              )
              dig.append(d)
          elif grad and cur_channel_label in grad["label"]:
              cur_ch = _process_channel_meg(cur_ch, grad)
          else:
              if cur_channel_label.startswith("EOG"):
                  cur_ch["kind"] = FIFF.FIFFV_EOG_CH
                  cur_ch["coil_type"] = FIFF.FIFFV_COIL_EEG
              elif cur_channel_label.startswith("ECG"):
                  cur_ch["kind"] = FIFF.FIFFV_ECG_CH
                  cur_ch["coil_type"] = FIFF.FIFFV_COIL_EEG_BIPOLAR
              elif cur_channel_label.startswith("STI"):
                  cur_ch["kind"] = FIFF.FIFFV_STIM_CH
                  cur_ch["coil_type"] = FIFF.FIFFV_COIL_NONE
              else:
                  warn(
                      "Cannot guess the correct type of channel %s. Making "
                      "it a MISC channel." % (cur_channel_label,)
                  )
                  cur_ch["kind"] = FIFF.FIFFV_MISC_CH
                  cur_ch["coil_type"] = FIFF.FIFFV_COIL_NONE
  
          chs.append(cur_ch)
      _ensure_fiducials_head(dig)
  
      return chs, dig
  
file_path: mne-python/mne/io/fieldtrip/utils.py
imports: import numpy
  from ..._fiff._digitization import DigPoint, _ensure_fiducials_head
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import create_info
  from ..._fiff.pick import pick_info
  from ...transforms import rotation3d_align_z_axis
  from ...utils import _check_pandas_installed, warn
label_desc: Use image node_id 4 for calling a global function with example usage: _create_info_chs_dig(ft_struct) and returns: chs,  dig