net.grelf.grip
Class Connection

java.lang.Object
  extended by net.grelf.grip.Connection
All Implemented Interfaces:
java.lang.Comparable<Connection>

public class Connection
extends java.lang.Object
implements java.lang.Comparable<Connection>

A connection is a vector between the centres of two Blobs detected in an image. The Blobs are identified by numbers, being their positions in a list. The class implements Comparable in order to allow sorting on the vector (which is of class VectorFloat, sorted on angle).
Note: this class has a natural ordering that is inconsistent with equals.


Field Summary
protected  int fromBlob
           
protected  int toBlob
           
protected  VectorFloat vector
           
 
Constructor Summary
Connection(VectorFloat aVector, int from, int to)
           
 
Method Summary
 int compareTo(Connection other)
          For sorting only on angle.
static void reportConnections(java.util.List<java.util.List<ConnectionList>> connectionsInAllImages, java.lang.String fileName)
          Export a sorted list of all connections to a CSV file.
 java.lang.String toString()
          Get a String representation of the Connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vector

protected VectorFloat vector

fromBlob

protected int fromBlob

toBlob

protected int toBlob
Constructor Detail

Connection

public Connection(VectorFloat aVector,
                  int from,
                  int to)
Method Detail

compareTo

public int compareTo(Connection other)
For sorting only on angle.

Specified by:
compareTo in interface java.lang.Comparable<Connection>

toString

public java.lang.String toString()
Get a String representation of the Connection

Overrides:
toString in class java.lang.Object

reportConnections

public static void reportConnections(java.util.List<java.util.List<ConnectionList>> connectionsInAllImages,
                                     java.lang.String fileName)
Export a sorted list of all connections to a CSV file. The vectors are reported by polar coordinates with the angle in degrees.