The Physiologist's Friend Simulation API

ch.unizh.ini.friend.topology
Class RetinotopicLocation

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.geom.Point2D.Float
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float
 
Field Summary
 
Fields inherited from class java.awt.geom.Point2D.Float
x, y
 
Constructor Summary
RetinotopicLocation(Point2D p)
          constructs a RetinotopicLocation from a Point2D.
 
Method Summary
static Retinotopic findCenterCell(Collection cells)
          static helper that takes a list of cells, each Retinotopic, and finds the geometrically-center one.
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.
static Retinotopic findNearestNeighbor(Retinotopic me, Collection all, HexDirection dir)
          finds the nearst neighboring cell to me, in collection all, in direction dir.
static void main(String[] args)
           
 
Methods inherited from class java.awt.geom.Point2D.Float
getX, getY, setLocation, setLocation, toString
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetinotopicLocation

public RetinotopicLocation(Point2D p)
constructs a RetinotopicLocation from a Point2D.

Method Detail

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 cell
all - cells in which to look for closest one
dir - 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 layer
all - the cells in the other layer
Returns:
the closest cell in the layer all to me

main

public static void main(String[] args)

http://www.ini.unizh.ch/~tobi/friend