Skip to content

4. Registering slices to the atlas

philshams edited this page Aug 27, 2018 · 8 revisions

Transform the histology image and overlay it with the reference atlas.


After having mastered navigating in the AtlasTransformBrowser (see Navigating in the reference atlas), you can further increase the accuracy of region-of-interest localization by registering slices to the atlas. This is done by interacting with the AtlasViewer and SliceViewer figures.

Press 't' once with the AtlasViewer figure selected and again with the SliceViewer figure selected. This activates transform point mode. This only needs to be done again if 'p' is pressed to switch to probe point mode (see Selecting regions of interest).


Registering your first brain slice

First, navigate to the slice in the reference atlas approximately corresponding to the slice of interest shown in the SliceViewer.

Click a point on the reference atlas and then the corresponding point on the histology image.

Do so for ~10 points (at least 4). The points must be clicked in the same order on both figures. I suggest choosing some points along the outer boundaries of the slice and some points that unambiguously match between the histology and atlas (such as the dentate gyrus). If the slice is very warped, you can focus on points near the region of interest and allow the transform to be inaccurate in other parts of the slice. Note that clicked points on the AtlasViewer that are not the most recently clicked point turn red, to help remember the current location to now click on the SliceViewer.

Now press 'h' to switch between the three histology overlay modes: just the reference atlas, the reference atlas overlaid with the transformed histology image, and just the transformed histology image. Press 'a' to display the brain-region boundaries. Press 'o' to overlay a highlight of the brain region your mouse is hovering over.

It is unlikely that the match will be perfect on this initial attempt. Add some more transform points at the areas that mismatch by clicking each image, and scroll to adjust the altas position and angle to get a better fit. If in the viewing mode of the above image, click the white outline on the AtlasViewer and on the corresponding point in the SliceViewer. Now, the slice is registered! The transforms and position within the reference atlas are saved when 'h' is pressed. Alternatively, press 'x' to save them, for instance after just adjusting the atlas position.

Clear the current transform and clicked points from the AtlasViewer or SliceViewer by pressing 'd' with that figure selected. Note that you even if you do not transform and overlay the slice, you can still save the atlas position by pressing 'x'. The analyses in the next steps will still work, but without use the histology overlay features.


Registering multiple slices

Press the left arrow to activate the last scrolling mode: scrolling between the slices in the processed_images_folder. Now, when you scroll forward, the top left of the AtlasViewer will display which slice you are currently working on. For example, scrolling forward after registering the first slice would bring up the text 'Slice 2 - no transform'. Now, repeat the steps in the section above to register this slice. Note that the first step will typically be to press the down arrow and navigate to the location in the reference atlas corresponding to this new histology image.

If, while scrolling between slices in the AtlasViewer, you encounter a slice that has already been registered, its location, transform, and previously clicked transform points will load automatically. Likewise, while navigating between histology images in the SliceViewer by pressing the left and right arrows, the previously clicked transform points will load. Thus if you match up the slice number in the title of the SliceViewer and on the top-left corner of the AtlasViewer, you can click more points and update the saved transform.

Note that you can also press 'l' to bring up the atlas position, transform, and previously clicked transform points corresponding to the slice currently showing on the SliceViewer.

For advanced users: if the histology slice is extremely warped, a piece-wise linear transform can be used instead of the projective transform (default). To do this, go into AtlasTransformBrowser.m and change the setting in the top function from ud.transform_type = 'projective' to ud.transform_type = 'pwl'. This is not generally recommended, however.