Grid field plot border wrapping
This documentation describes concepts and methods related to avoiding grid fields appearing to wrap around the borders of plots. How to cause them to appear to wrap around if wanted is also included.
Real cell plots not showing wrapping
In real cell plots something that can be observed is that a grid field that is partially shown at a border of the plot (e.g., a section of it is cropped at the border) does not have the rest of the field shown at the opposite border. In the network-level theory and algorithm of continuous attractor networks (CAN), for periodic bumps a theoretical idea is that the grid cell neural layer is on a toroidal manifold. The movement of bumps help create what grid fields are created in plots of a grid cell’s firing vs. animal location in an environment (physical space plots). In these plots one would expect a field partially on one border to have its other field section appear on the opposite border because the manifold causes the bump to wrap around the torus. This is considered “wrapping around” the borders.
An approach has been used in the article’s work that recreates the real cells not having fields wrap around in physical space plots. This approach uses mapping of animal movement to bump movement to create field firing that avoids the wrapping around. In the CAN model, the bumps are intended to follow the movement of the animal. Physical space plots are generated by recording the movements of bumps over a single neuron. Fields of firing are recorded from the selected neuron because of the periodic occurence of bumps in the neural layer.
Mapping animal movement
Mapping movement of an animal to a level of movement of bumps can cause the movement of an animal in an environment not to span the full length of a neural layer. Movement (at a set angle) across the full neural layer causes the bump to loop back around to where it started. This causes a physical space plot of grid fields produced from the movement to have the fields wrapping around the edges of the plot appearance. Mapping the movement of the animal to span a subsection of the full neural layer causes the fields that are produced to potentially avoid that wrapping around the borders of the physical space plot appearance.
Another factor considered in avoiding the wrapping appearance is the bounds of the plotted area. Bounds in this case refers to what is designated as the units on the x- and y-axes. For example, in a 40x40 cm environment, the motion of bumps may span 30x30 neurons in the sense that the center of any bump travels no more than 30x30 neurons in the neural layer. Where in the neural layer, which could be any size, but per se is 40x40 neurons, this 30x30 space of movement occurs could be in theory any 30x30 space in the layer. For plotting purposes this is relevant because wrapping around of fields could appear in plots if the plot considered halfway through the 30x30 space to be the border of the plotted area. Where to designate such borders of the plotted area is however arbitrary because the manifold is a torus. The movement of bumps looping around the manifold means that there are no true “borders” in the neural layer. Therefore, that 30x30 area can be positioned in a space in the layer that avoids the appearance of fields wrapping for the purposes of plotting.
Fig. 1. Neural layer including subsection highlighed in teal.
The appearance of fields wrapping around can be avoided by having the space of bump movement set to the subsection of the total layer, and therefore in the plots avoids capturing bump movement over a recorded neuron that is at the arbitrarily defined “borders” of the neural layer. Borders in this sense are the minimum and maximum neuron soma position in 3d space in the layer when the layer is plotted as a 2d plot. These are arbitrary designations due to how the layer loops around in the toroidal manifold. This concept is shown in Fig. 1 having units on the x- and y-axes being 0-40 representing the 3d spacing of 40x40 neuron somas.
Shown in Fig. 1 in a teal highlight is a 30x30 subsection within the neural layer. This subsection represents the bounds of where the real animal’s movement was mapped to bump movement. The bump firing in the figure indicates how this firing creating similar grid field firing in physical space plots will not have fields wrapping around borders of the plotted area. The plotted area will be the section highlighed in teal because it will cover all animal movement overlayed onto the neural layer. In comparison, Fig. 1 shows that the borders of the neural layer have bumps with firing that wraps around. Animal movement could be mapped to the borders of the neural layer if an objective of recreating a real cell’s plot was to include fields that wrap around. Overall, selecting the subsection of the neural layer that animal movement is mapped to can control if field wrapping around borders appears in physical space plots.
Fig. 2. Virtual animal movements shown in teal overlayed on to a neural layer.
A line that traces the movements of a real animal in a 40x40 cm enviornment is shown in teal overlayed onto a neural layer in Fig. 2. This shows how the movements can be mapped to the 30x30 neuron distance space as described earlier. Methods described in the “converting animal recordings” documentation are used to position the movements in the layer. For instance, selecting a virtual animal starting position relative to the neural layer’s coordinates can help center the movement trajectory to an intended part of the layer. Plotted results in the article show how these methods of mapping animal movement to bump movement in selected parts of a grid cell neural layer produce plots that avoid the field wrapping appearance. One should take account of a rotation in an animal movement area, e.g. square enviornment, that has its edges moved closer to neuron space borders due to an offset angle provided by the grid_pattern_rot parameter. In such a case, mapping animal movement to a smaller neuron space area may be needed to avoid field wrapping appearing in physical space plots.
It can be useful for plotting purposes to center the mapping of the animal movement area to a section of the neural layer that does not go past the plotting borders of the neural layer. The movement area (trajectory) of the virtual animal occuring past such a border causes there to be a need to combine the part past the border with the part within the border for graphical design of a plot. Conceptually, the area traveled past the border would wrap around to the opposite side of the neural layer because the layer is a torus. Programming may be needed to align that part of the plot that continues past the opposite border with the part within the border. It can be simpler to program a plot that does not have to account for combining neural firing activity past a border with that which is not past the border. Centering the movement area in the layer is able to be done since the coordinates of the border are arbitrary (and set for plotting not biological purposes) due to the manifold looping around. Therefore, choosing a movement area that accomidates plotting is reasonable.