class_docstr: Montage for digitized electrode and headshape position data.
  
  .. warning:: Montages are typically created using one of the helper
               functions in the ``See Also`` section below instead of
               instantiating this class directly.
  
  Parameters
  ----------
  dig : list of dict
      The object containing all the dig points.
  ch_names : list of str
      The names of the EEG channels.
  
  See Also
  --------
  read_dig_captrak
  read_dig_dat
  read_dig_egi
  read_dig_fif
  read_dig_hpts
  read_dig_localite
  read_dig_polhemus_isotrak
  make_dig_montage
  
  Notes
  -----
  .. versionadded:: 0.9.0
class_docstr_tok: ["Montage","for","digitized","electrode","and","headshape","position","data",".","..","warning",":",":","Montages","are","typically","created","using","one","of","the","helper","functions","in","the","``","See","Also","``","section","below","instead","of","instantiating","this","class","directly",".","Parameters","--","--","--","--","--","dig",":","list","of","dict","The","object","containing","all","the","dig","points",".","ch_names",":","list","of","str","The","names","of","the","EEG","channels",".","See","Also","--","--","--","--","read_dig_captrak","read_dig_dat","read_dig_egi","read_dig_fif","read_dig_hpts","read_dig_localite","read_dig_polhemus_isotrak","make_dig_montage","Notes","--","--","-","..","versionadded",":",":","0.9.0"]
docstr: Estimate fiducials based on FreeSurfer ``fsaverage`` subject.
  
  This takes a montage with the ``mri`` coordinate frame,
  corresponding to the FreeSurfer RAS (xyz in the volume) T1w
  image of the specific subject. It will call
  :func:`mne.coreg.get_mni_fiducials` to estimate LPA, RPA and
  Nasion fiducial points.
  
  Parameters
  ----------
  %(subject)s
  %(subjects_dir)s
  %(verbose)s
  
  Returns
  -------
  inst : instance of DigMontage
      The instance, modified in-place.
  
  See Also
  --------
  :ref:`tut-source-alignment`
  
  Notes
  -----
  Since MNE uses the FIF data structure, it relies on the ``head``
  coordinate frame. Any coordinate frame can be transformed
  to ``head`` if the fiducials (i.e. LPA, RPA and Nasion) are
  defined. One can use this function to estimate those fiducials
  and then use ``mne.channels.compute_native_head_t(montage)``
  to get the head <-> MRI transform.
code: def add_estimated_fiducials(
      self, subject, subjects_dir=None, verbose=None
  ):
      """Estimate fiducials based on FreeSurfer ``fsaverage`` subject.
  
      This takes a montage with the ``mri`` coordinate frame,
      corresponding to the FreeSurfer RAS (xyz in the volume) T1w
      image of the specific subject. It will call
      :func:`mne.coreg.get_mni_fiducials` to estimate LPA, RPA and
      Nasion fiducial points.
  
      Parameters
      ----------
      %(subject)s
      %(subjects_dir)s
      %(verbose)s
  
      Returns
      -------
      inst : instance of DigMontage
          The instance, modified in-place.
  
      See Also
      --------
      :ref:`tut-source-alignment`
  
      Notes
      -----
      Since MNE uses the FIF data structure, it relies on the ``head``
      coordinate frame. Any coordinate frame can be transformed
      to ``head`` if the fiducials (i.e. LPA, RPA and Nasion) are
      defined. One can use this function to estimate those fiducials
      and then use ``mne.channels.compute_native_head_t(montage)``
      to get the head <-> MRI transform.
      """
      # get coordframe and fiducial coordinates
      montage_bunch = _get_data_as_dict_from_dig(self.dig)
  
      # get the coordinate frame and check that it's MRI
      if montage_bunch.coord_frame != FIFF.FIFFV_COORD_MRI:
          raise RuntimeError(
              f'Montage should be in the "mri" coordinate frame '
              f"to use `add_estimated_fiducials`. The current coordinate "
              f"frame is {montage_bunch.coord_frame}"
          )
  
      # estimate LPA, nasion, RPA from FreeSurfer fsaverage
      fids_mri = list(get_mni_fiducials(subject, subjects_dir))
  
      # add those digpoints to front of montage
      self.dig = fids_mri + self.dig
      return self
  
imports: import os.path
  import re
  from collections import OrderedDict
  from copy import deepcopy
  from dataclasses import dataclass
  import numpy
  from .._fiff._digitization import _coord_frame_const, _count_points_by_type, _ensure_fiducials_head, _format_dig_points, _get_data_as_dict_from_dig, _get_dig_eeg, _get_fid_coords, _make_dig_points, _read_dig_fif, write_dig
  from .._fiff.constants import CHANNEL_LOC_ALIASES, FIFF
  from .._fiff.meas_info import create_info
  from .._fiff.open import fiff_open
  from .._fiff.pick import _picks_to_idx, channel_type, pick_types
  from .._freesurfer import get_mni_fiducials
  from ..defaults import HEAD_SIZE_DEFAULT
  from ..transforms import Transform, _ensure_trans, _fit_matched_points, _frame_to_str, _quat_to_affine, _sph_to_cart, _topo_to_sph, _verbose_frames, apply_trans, get_ras_to_neuromag_trans
  from ..utils import _check_fname, _check_option, _on_missing, _pl, _validate_type, copy_function_doc_to_method_doc, fill_doc, verbose, warn
  from ..utils.docs import docdict
  from ..viz import plot_montage
  from ._dig_montage_utils import _parse_brainvision_dig_montage, _read_dig_montage_egi
label_desc: Use image node_id 14 for calling the DigMontage obj's underlying member method code with example usage: obj.add_estimated_fiducials(subject, subjects_dir, verbose) and returns: self