Skip to content

3. Navigating in the reference atlas

philshams edited this page Jan 24, 2020 · 8 revisions

With the folder of processed images from the previous step, find each corresponding slice in the reference atlas. Alternatively, search the atlas without the slice images in a simpler GUI


In all cases, do the following:

Open the MATLAB script Navigate_Atlas_and_Register_Slices.m

Use the AtlasTransformBrowser if you plan to use the functionalities shown in the next sections of the wiki

Enter the folder containing the appropriately sized (typically, 800 x 1140 pxl) and ordered .tif images of your brain slices (see Pre-processing histology images)

% directory of histology
processed_images_folder = 'C:\Drive\Histology\sample data\slices\processed';

Enter the file location of the Allen reference atlas data (see Requirements)

% directory of reference atlas files
annotation_volume_location = 'C:\Drive\Histology\annotation_volume_10um_by_index.npy';
structure_tree_location = 'C:\Drive\Histology\structure_tree_safe_2017.csv';
template_volume_location = 'C:\Drive\Histology\template_volume_10um.npy';

Enter the axis along which your slices are cut

% plane to view ('coronal', 'sagittal', 'transverse')
plane = 'coronal';

Navigating in the AltasTransformBrowser

Now run the script. Two figures appear, and instructions appear in the console. SliceViewer contains the pre-processed histology images. Examine these images by pressing the left and right arrow keys. AtlasViewer contains the reference atlas images.

Selecting the AtlasViewer figure and scrolling will move through coronal slices in the reference atlas. Thus you can find the approximate position of the slice shown in the SliceViewer window.

Pressing the down arrow key activates this default mode of scrolling across coronal slices in the reference atlas. Pressing the right arrow key activates the mode of scrolling across angles offset from a medial-lateral axis perpendicular to the anterior-posterior axis. Pressing the up arrow key activates the mode of scrolling across angles offset from a dorso-ventral axis perpendicular to the anterior-posterior axis. In the following image, the right arrow key was pressed and the user scrolled to an angle of -1.8 degrees, in order to match this histology image.

You can also press 'v' to view the reference atlas colored in by brain region.


Navigating in the simpler allenAltasBrowser

Follow the same steps laid out in the above section, with a couple of changes:

  • To use this GUI, comment out the 5 lines of code calling the sliceBrowser and AtlasTransformBrowser; and uncomment the two lines of code calling the allenAtlasBrowser:
% % show histology in Slice Viewer
% try; figure(slice_figure_browser); title('');
% catch; slice_figure_browser = figure('Name','Slice Viewer'); end
% reference_size = size(tv);
% sliceBrowser(slice_figure_browser, processed_images_folder, f, reference_size);
% 
% 
% % use application in Atlas Transform Viewer
% % use this function if you have a processed_images_folder with appropriately processed .tif histology images
% f = AtlasTransformBrowser(f, tv,av,st, slice_figure_browser, processed_images_folder, probe_save_name_suffix);   
    
% use the simpler version, which does not interface with processed slice images
% just run these two lines instead of the previous 5 lines of code    
save_location = processed_images_folder;
f = allenAtlasBrowser(tv,av,st, save_location, probe_save_name_suffix);
  • Note that the variable called processed_images_folder now refers not to where your saved images are but simply to the folder where your ROI tracking will be saved.