ch.unizh.ini.friend.topology
Class RetinotopicLocation
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Float
ch.unizh.ini.friend.topology.RetinotopicLocation
- All Implemented Interfaces:
- Serializable, Cloneable
public class RetinotopicLocation
- extends Point2D.Float
Represents a location of a retinotopic cell in the 2d image plane. Provides static methods for finding cells topologically.
E.g.
SimulationSetup setup=SimulationSetupFactory.getSimulationSetup();
Collection on=setup.getOnGanglions();
Retinotopic c=RetinotopicLocation.findCenterCell(on);
Retinotopic x=RetinotopicLocation.findNearestNeighbor(c, on, new HexDirection(HexDirection.E));
- Since:
- $Revision: 1.8 $
- Author:
- $Author: tobi $
- See Also:
- Serialized Form
RetinotopicLocation
public RetinotopicLocation(Point2D p)
- constructs a
RetinotopicLocation
from a Point2D
.
findCenterCell
public static Retinotopic findCenterCell(Collection cells)
- static helper that takes a list of cells, each Retinotopic, and finds the geometrically-center one.
The center of mass of all the cells is computed, and the cell closest to this point is returned.
This method is slow, not for runtime use.
This method is slow because it just does a serial search, but this should be ok for the purposes of establishing cell connections.
- Parameters:
cells
- List of cells
- Returns:
- center cell
findNearestNeighbor
public static Retinotopic findNearestNeighbor(Retinotopic me,
Collection all,
HexDirection dir)
- finds the nearst neighboring cell to me, in collection all, in direction dir.
This method is slow--not for runtime use.
- Parameters:
me
- starting cellall
- cells in which to look for closest onedir
- direction to look in
- Returns:
- closest cell in
HexDirection
dir
. If there is no cell in that direction, returns null.
findCorresponding
public static Retinotopic findCorresponding(Retinotopic me,
Collection all)
- finds the corresponding cell in another layer at this same retinotopic location
This method is slow--not for runtime use.
- Parameters:
me
- the cell in this layerall
- the cells in the other layer
- Returns:
- the closest cell in the layer
all
to me
main
public static void main(String[] args)