class_docstr: Sensor layouts.
  
  Layouts are typically loaded from a file using
  :func:`~mne.channels.read_layout`. Only use this class directly if you're
  constructing a new layout.
  
  Parameters
  ----------
  box : tuple of length 4
      The box dimension (x_min, x_max, y_min, y_max).
  pos : array, shape=(n_channels, 4)
      The unit-normalized positions of the channels in 2d
      (x, y, width, height).
  names : list
      The channel names.
  ids : list
      The channel ids.
  kind : str
      The type of Layout (e.g. 'Vectorview-all').
class_docstr_tok: ["Sensor","layouts",".","Layouts","are","typically","loaded","from","a","file","using",":","func",":","`","~mne.channels.read_layout","`",".","Only","use","this","class","directly","if","you're","constructing","a","new","layout",".","Parameters","--","--","--","--","--","box",":","tuple","of","length","4","The","box","dimension","(","x_min",",","x_max",",","y_min",",","y_max",")",".","pos",":","array",",","shape=","(","n_channels",",","4",")","The","unit-normalized","positions","of","the","channels","in","2d","(","x",",","y",",","width",",","height",")",".","names",":","list","The","channel","names",".","ids",":","list","The","channel","ids",".","kind",":","str","The","type","of","Layout","(","e.g",".","'Vectorview-all","'",")","."]
docstr: Save Layout to disk.
  
  Parameters
  ----------
  fname : path-like
      The file name (e.g. ``'my_layout.lout'``).
  overwrite : bool
      If True, overwrites the destination file if it exists.
  
  See Also
  --------
  read_layout
docstr_tok: ["Save","Layout","to","disk",".","Parameters","--","--","--","--","--","fname",":","path-like","The","file","name","(","e.g",".","``","'my_layout.lout","'","``",")",".","overwrite",":","bool","If","True",",","overwrites","the","destination","file","if","it","exists",".","See","Also","--","--","--","--","read_layout"]
code: def save(self, fname, overwrite=False):
      """Save Layout to disk.
  
      Parameters
      ----------
      fname : path-like
          The file name (e.g. ``'my_layout.lout'``).
      overwrite : bool
          If True, overwrites the destination file if it exists.
  
      See Also
      --------
      read_layout
      """
      x = self.pos[:, 0]
      y = self.pos[:, 1]
      width = self.pos[:, 2]
      height = self.pos[:, 3]
      fname = _check_fname(fname, overwrite=overwrite, name=fname)
      if fname.suffix == ".lout":
          out_str = "{:8.2f} {:8.2f} {:8.2f} {:8.2f}\n".format(
              *self.box
          )
      elif fname.suffix == ".lay":
          out_str = ""
      else:
          raise ValueError(
              "Unknown layout type. Should be of type " ".lout or .lay."
          )
  
      for ii in range(x.shape[0]):
          out_str += "%03d %8.2f %8.2f %8.2f %8.2f %s\n" % (
              self.ids[ii],
              x[ii],
              y[ii],
              width[ii],
              height[ii],
              self.names[ii],
          )
  
      f = open(fname, "w")
      f.write(out_str)
      f.close()
  
imports: import logging
  from collections import defaultdict
  from itertools import combinations
  from pathlib import Path
  import numpy
  from scipy.spatial.distance import pdist, squareform
  from .._fiff.constants import FIFF
  from .._fiff.meas_info import Info
  from .._fiff.pick import _FNIRS_CH_TYPES_SPLIT, _picks_to_idx, pick_types
  from ..transforms import _cart_to_sph, _pol_to_cart
  from ..utils import _check_ch_locs, _check_fname, _check_option, _check_sphere, _clean_names, fill_doc, logger, warn
  from ..viz.topomap import plot_layout
  from .channels import _get_ch_info
label_desc: Use image node_id 2 for calling the Layout obj's underlying member method code with example usage: obj.save(fname, overwrite) without return types