Toolbox for aliging histology images to the Allen CCF mouse atlas.
A video demonstration of this toolbox is available here (note - old interface): https://www.youtube.com/watch?v=HKm_G17Wc6g
Inspiration from SHARP-Track by Philip Shamash (https://www.biorxiv.org/content/10.1101/447995v1).
*(note on where these files came from: they are a re-formatted version of the original atlas, which has been processed with this script)
Open the toolbox menu with:
AP_histology
This is the menu for to run all toolbox functions.
The menu functions are described below.
Set the location of the raw images and save path
File selection > Set raw image path
File selection > Set processing save path
1) Downsample image sizes (if desired) 2) Set white balance and color for each channel 3) Extract slices into individual images (if not already)
In the initial dialog box, select the image downsampling factor (e.g. 2 reduces image size to 1/2) and whether images are individual slices (1 = slices, 0 = not slices, e.g. slides)
A montage of images will be shown for each channel, user selects white balance and color:
To create individual slice images from slide imges:
Draw reference line (e.g. the midline):
These reference lines will used to centered and rotate the slice images, which are then saved.
Images can be re-ordered (click to select order)
Images can be flipped (left/right or up/down)
This function is to match histology slices to their corresponding CCF slices. The left plot is the histology slices (scrollable by 1/2), the right plot is the 3D CCF atlas which is rotatable with the arrow keys and scrollable in/out of the plane with the mouse wheel. Typical use would be:
This function auto-aligns each corresponding histology and CCF slice by slice outline. Alignments which need manual correction can be fixed in the next step.
If the auto-alignment didn't work on some slices, they can be manually fixed with this function. Placing > 3 corresponding points on the histology and CCF slices creates a new alignment using those control points, and 'Escape' saves and quits.
From auto-alignment:
After manual control-point alignment:
Get trajectory of dyed probe in CCF coordinates and areas.
Draw lines on slices with visible tract marks corresponding to the probe (select the relevant probe by number, e.g. '1' to draw a line for probe 1). Lines for a given probe can be (and usually are) drawn across multiple slices.
The final probe trajectory will be a line of best fit through all marked points, and brain areas will be saved along that trajectory. NOTE: it is unusual that the exact end of the probe can be visualized and accurately established from histology alone, so this step saves the entire trajectory and the next step aligns it to electrophysiology.
Display the histology slices with overlaid boundaries, hover over region to display name
2024-02-16 - Split re-order/flip GUIs: re-ordering is now a simpler click interface 2023-11-02 - Created menu GUI for easier interfacing re-structured/improve much of the code, improved auto-align