3.1.2 Non-uniform image registration
Having chosen the best-corresponding atlas panel (3.1.1), the next step is to establish a map of locations within the atlas panel to locations in the experimental slice. Atlas Fitter assumes that digitized images of both the atlas panels and the experimental section are available. The question is then what transformation from one image to the other is required to result in the best match between the two images. For small sections usually subject to little torsion, a global rotation, translation, and scaling of the atlas are likely to suffice. More commonly, however, experimental sections are subject to several different forces across their extent: one part of the section may have been twisted or stretched, while another may be relatively intact. To address this problem, we use a landmark-based, non-uniform transformation from one image to the other. Rather than warping the histological section (Gefen et al., 2003
; Ju et al., 2006
) and potentially altering one’s data, here we warp the atlas to match the section as-is.
Atlas Fitter first automatically finds the outer boundaries of the experimental tissue section. This is done using a simple intensity threshold for edge detection, together with “opening” and “closing” morphological filters (Ronse and Heijmans, 1991
; Serra, 1982
) to smooth over any small bumps (opening) or tears (closing) that may occur along the edge of the tissue. Here we typically lowpass filter the image with a 10 pixels standard deviation Gaussian function, use a threshold defined in the green color channel, and then apply a 50 pixel diameter disk as the opening and closing filter structuring element. The specific parameters for the edge detection can be tuned to work on any magnification, tissue type, and stain combination.
The user is then asked to identify a minimum of three landmark points on the outer boundary of the atlas panel, together with their corresponding locations in the experimental image (). The locations of the remaining boundary points are then linearly interpolated between the manually defined landmarks along the detected tissue boundary (maintaining the relative direct distance between points not necessarily the distance along the traced boundary). For each boundary point a horizontal and vertical translation are now defined according to Equation 1
Figure 1 Registering atlas panels with histological sections. A) Atlas panel subject to global rotation, translation, and scaling shows poor alignment with a coronal rat brain section. B) Surface warp applied to atlas in A. Warp algorithm need not be applied to (more ...)
Atlas Fitter now interpolates the horizontal and vertical translation for each internal point on the atlas using the boundary point translations as a reference (). To interpolate the translations for the internal points, the image is first divided into the Delaunay triangles (using only the boundary points as vertices). Delaunay triangulation is defined such that no vertex exists inside any of the circumcircles for the resulting triangles (Barber et al., 1996
; Delaunay, 1934
). This form of triangulation maximizes the minimum angle of the resulting triangles, i.e. it minimizes the occurrence of long skinny triangles. To compute the translation for each internal point we first transform each point’s Cartesian coordinates (x,y) into a Barycentric coordinate system (t1,t2,t3) according to Equation 2
where (x1,y1), (x2,y2), and (x3,y3) are the coordinates of the vertices of the circumscribing Delaunay triangle and (x,y) are the coordinates of the internal point (Barber et al., 1996
The translation of each internal point is then given by equation 3
Where (Hn,Vn) are the horizontal and vertical translations at each of the vertices of the circumscribing Delaunay triangle and (t1,t2,t3) are the Barycentric coordinates for the internal point (Barber et al., 1996
The resulting horizontal and vertical translations, or “warp”, can then be applied to the atlas to produce an image that can be directly compared to the experimental image. We call this procedure the “interpolated warp algorithm.” demonstrates how the interpolated warp algorithm affects a uniform grid of points. Any points that lie outside all Delaunay triangles use the translation values associated with the nearest point on a Delaunay triangle edge.
Larger histological sections tend to suffer from greater stretching and bending during the mounting process. This can cause internal structures to still be misaligned with the atlas panel following the first application of the interpolated warp algorithm described above. Any remaining internal misalignments can be corrected with a second application of the interpolated warp algorithm. The user is free to select any atlas point and manually define its correct position, thus defining the horizontal and vertical translations for that point. Since the external boundary points have already been “warped” into place, they are kept fixed with horizontal and vertical translations of 0 and continue to serve as vertices for the triangulation. The translations for all remaining internal points can be recalculated, as described above, and applied. By this point the atlas panel and the histological image should be well aligned with one another (). The typical atlas fitting procedure is outlined in .
Flowchart of atlas fitting and cell counting procedures. OC: opening and closing morphological filters. IWA: interpolated warp algorithm. ROI: region of interest. Relevant figure panels and equations are highlighted next to each step.
The number of iterations of the interpolated warp algorithm and the number of landmark points required to bring an atlas panel into proper registration with a histological section will vary depending on the degree of distortion the tissue has suffered. Here we measured the best alignment that could be achieved across 4 coronal rat brain sections using either linear transformations, the surface warp algorithm (with 4 landmark points), or the surface warp algorithm (4 landmark points) and the internal warp algorithm (average 6 landmark points) compared with a fully manually positioned atlas. On average we achieved alignments of 66.3%, 88.8%, and 98.9% respectively.
This warp algorithm is perfectly reversible () under the condition that the triangulation does not change. To minimize changes in the triangulation following application of the surface warp algorithm and increase the accuracy of the resulting warp we also include the centroid of the atlas as a vertex in the triangulation. The horizontal and vertical translation for the atlas’ centroid is defined as the difference between it and the centroid of the histological section. The surface warp algorithm is also capable of accurately reversing both linear transformations, including translations, rotations, and scaling (98.2%, 98.3%, and 97.6% alignment respectively), as well as non-linear transformations such as the surface warp algorithm itself (97.1% alignment) ().
Since the interpolated warp algorithm requires the user to manually identify landmark points, the accuracy of the resulting alignment is dependent on the accuracy of the placement of those points. Small errors in landmark point placement can result in misalignments even when there is no change in the triangulation (as seen above with the attempt to reverse the linear transformations). We therefore sought to measure the sensitivity of the warp algorithm to errors in landmark placement. Here we applied the surface warp algorithm using 4 landmark points, the internal warp algorithm again with 4 landmark points (and the surface points held fixed), and a simple translation with 1 landmark point. The position of the landmark points was then jittered by some fixed distance, the transformations applied, and the alignment of the atlas compared to the transformation with no jitter computed (). In general we found that both warp algorithms are less sensitive to landmark location errors than a simple translation. This is because independent errors tend to average out across points and in the surface warp algorithm the points are constrained to be on the surface of the histological section.
3.1.3 Uniform image registration
Occasionally a simple uniform transformation, such as sliding the atlas to the right, stretching the atlas vertically, or rotating it clockwise, may be all that’s necessary to align an atlas panel to a histological section. For that reason Atlas Fitter also comes equipped with a range of manual atlas manipulating tools. Users can translate, flip, rotate, stretch, and shrink individual or groups of atlas subregions. For sectioning planes that possess symmetry (such as coronal brain sections with symmetric left and right hemispheres), the program is able to treat the left and right halves independently. Users can also reposition individual points for fine touch ups.
3.1.4 Region of Interest feature analysis
Once an atlas panel is registered to the histological section (3.1.2–3), quantitative feature analysis becomes possible. One such application is to quantify the extent of a lesion. Often, to determine the effect of a lesion on an animal’s behavior, it is important to not only know which brain areas were lesions, but also to what extent, i.e. area Y lesioned X%. For any such application users will first manually trace out regions of interest (ROIs), corresponding to the feature of interest such as the tissue lesion. The program can then calculate the percent overlap between the ROI and each of the subregions in the atlas (). When one wants to compare the extent of lesions across multiple animals, a graphical display showing the boundary of each lesion drawn over the atlas panel is often useful. However, because the shape of each brain is not identical, the atlas panel registered to each section will be warped slightly differently, therefore one cannot simply superimpose the lesion ROIs on top of one another for direct comparison. So to facilitate the graphical comparison of ROIs drawn on different sections Atlas Fitter can apply the warp algorithm that was used to bring the atlas panel into alignment with the tissue section in reverse (fully automated) to the user defined ROI. This results in the ROI being projected back onto the raw unwarped atlas panel (). Now lesions from multiple subjects can be superimposed over a single atlas panel for direct qualitative comparison.