Skip to content

6. Visualize brain regions traversed by an electrode

philshams edited this page Jan 24, 2020 · 10 revisions

Visualize & analyze brain regions traversed by an electrode (or any linear track)


Explore the electrode track in the reference atlas and histology images

Now you have clicked and saved points from several slices, corresponding to your electrode track(s). Next, you can immediately examine the best-fit line connecting the clicked points, and the brain regions lying along this track. After selecting your probe of interest by pressing 'p', press 'w' to activate probe view mode. This brings up the best-fit line for this probe and the best-fit brain slice along which the line lies. If the probe spans multiple histological slices, as in the example below, this best-fit slice will not correspond to any of the histological slice images. Press 'o' to toggle overlay of brain regions.

Clicking along this line will bring up, in the Transformed Slice & Probe Point Viewer, the point in the histological slice images that is closest to the clicked point (see below). Thus you can verify the quality of the fit. Below, the highlighted areas (in the reticular nucleus (top) and the mediodorsal nucleus (bottom) of the thalamus) were clicked.

As in Navigating in the reference atlas, press the down arrow key and scroll to navigate nearby brain regions. The clicked points will get darker the further they are from where you are currently looking in the reference atlas.

This functionality also reports the estimate insertion point and angle in the console (see Find electrode insertion angle for a desired trajectory))

estimated probe insertion angle: 
11.6 degrees in the anterior direction
7 degrees in the lateral direction

Plot all the brain regions traversed by the electrode track

Open the script Display_Probe_Track.m. First, set the clicked points to analyze by using the same file location and probe save name as used during the previous steps:

% file location of probe points
processed_images_folder = 'C:\Drive\Histology\sample data\slices\processed';

% name of the saved probe points
probe_save_name_suffix = 'electrode_track_1';

% either set to 'all' or a list of indices from the clicked probes in this file, e.g. [2,3]
probes_to_analyze = 'all';

Set some additional parameters:

  • probe_lengths is a list of the known insertion depths in millimeters of all probes saved in this file. Setting it as one number sets all probes to that depth.
  • active_probe_lengths is the distance in mm from the bottom tip of the electrode that contains recording sites. In the case of Neuropixels probes, this is 3.84.
  • probe_radius relates to the plot of brain regions along the electrode track shown below. In that plot, the thicker the colored bar is along the x-axis, the more confidence there is that the correct brain region is plotted. The measure of confidence is how far away the nearest boundary to a different brain region is, in the plane orthogonal to the electrode. This parameter sets how far to search, i.e. the maximum confidence level.
  • show_parent_category if set to true will add a confidence metric for parent regions (e.g. prelimbic area is the parent region of prelimbic area layer 6a). This feature is slow.
  • distance_past_tip_to_plot how far past the estimated tip of the probe should be plotted
  • scaling_factor set the scaling between the known probe length set in the variable probe_lengths and the distance this takes up in the reference atlas. 1.0-1.2 is a reasonable range. Aligning a plot of the electrophysiology data to known landmarks (e.g. white matter) can help to estimate this value. If this variable is set to ‘false,’ the most ventral clicked point will be set as the bottom tip of the electrode; the scaling factor will then be derived automatically.
  • show_region_table generates the variable borders_table, which reports the regions displayed in the plot and their locations (see below)
  • plane needs to match the slice plane used when clicking the probe points.
  • Note that this script assumes that, on the brain surface, the probe was inserted through the isocortex

brain regions and confidence that the ROI track crosses the listed brain region are plotted

A wire frame image of the mouse brain, with clicked points and best-fit lines overlaid is diplayed.

borders_table displays the regions transected by the electrode, and their location along the axis of the electrode. See all abbreviations and hierarchical region structure in the file ‘structure_tree_safe_2017.csv’