text: """
  For a given track file (pts.csv), plot the coronal and sagittal
  slices.
  Option: either plot the best-fitted slices (tilted), or the
  projection of the probe track onto non-tilted cor/sag slices.
  
  """
  # Author: Olivier Winter
  
  from ibllib.pipes import histology
  import ibllib.atlas as atlas
  import numpy as np
  import matplotlib.pyplot as plt
  
  # === Parameters section (edit) ===
  
  track_file = "/Users/gaelle/Downloads/electrodetracks_lic3/2019-08-27_lic3_002_probe00_pts.csv"
  
  # === Code (do not edit) ===
  ba = atlas.AllenAtlas(res_um=25)
  xyz_picks = histology.load_track_csv(track_file)
  bl, ins = histology.get_brain_regions(xyz_picks)
  
  # --- Initialise figure containing 4 subplots ---
  fig, axs = plt.subplots(1, 4)
  
  # --- PLOT TILTED SLICES THAT BEST CONTAIN THE PROBE TRACK ---
  # Sagittal view
  sax = ba.plot_tilted_slice(ins.xyz, axis=0, ax=axs[0])
  sax.plot(ins.xyz[:, 1] * 1e6, ins.xyz[:, 2] * 1e6)
  sax.plot(bl.xyz[:, 1] * 1e6, bl.xyz[:, 2] * 1e6, '.')
  
  # Coronal view
  cax = ba.plot_tilted_slice(ins.xyz, axis=1, ax=axs[1])
  cax.plot(ins.xyz[:, 0] * 1e6, ins.xyz[:, 2] * 1e6)
  cax.plot(bl.xyz[:, 0] * 1e6, bl.xyz[:, 2] * 1e6, '.')
  
  # --- PLOT SLICES THAT ARE COR/SAG PLANES, AND PROBE TRACK PROJECTED ---
  # Sagittal view
  sax2 = ba.plot_sslice(ml_coordinate=np.mean(ins.xyz[:, 0]), ax=axs[2])
  sax2.plot(ins.xyz[:, 1] * 1e6, ins.xyz[:, 2] * 1e6)
  sax2.plot(bl.xyz[:, 1] * 1e6, bl.xyz[:, 2] * 1e6, '.')
  
  # Coronal view
  cax2 = ba.plot_cslice(ap_coordinate=np.mean(ins.xyz[:, 1]), ax=axs[3])
  cax2.plot(ins.xyz[:, 0] * 1e6, ins.xyz[:, 2] * 1e6)
  cax2.plot(bl.xyz[:, 0] * 1e6, bl.xyz[:, 2] * 1e6, '.')
  
  # # -- Test insertion
  # xyz = np.array([[0, 0, 0], [0.001, 0.005, -0.005]])
  # # SAG TILTED
  # sax_t = ba.plot_tilted_slice(xyz, axis=0)
  # sax_t.plot(xyz[:, 1] * 1e6, xyz[:, 2] * 1e6)
  # # COR TILTED
  # cax_t = ba.plot_tilted_slice(xyz, axis=1)
  # cax_t.plot(xyz[:, 1] * 1e6, xyz[:, 2] * 1e6)
  