retina
Class RetinalImage

java.lang.Object
  |
  +--retina.RetinalImage

public class RetinalImage
extends java.lang.Object

This class contains methods to process retinal images. A retinal image always has a 'black' border around it. This border is put to good use by putting parameters into it. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.


Field Summary
(package private) static float HESSIANSCALE
          Optimal scale (unitless, stddev of the Gaussian) of the Hessian tensor for 256x256 retinal images.
(package private) static float REALEDGEFRACTION
          Fraction of edge histogram pixels that are real edges.
(package private) static int REGISTRATIONOFFSET
          On the last line, from the left edge this space is used as registration parameters.
(package private) static int SLIDINGWINDOWSIZE
          Size of sliding window in pixels for equalization and vignetting removal.
(package private) static int STIMULUSOFFSET
          On the last line, this is used as stimulus flag (0=off, 1=on).
 
Constructor Summary
RetinalImage()
           
 
Method Summary
static LocatedCircle findFOV(float[] image, int width, boolean displayFlag)
           
static LocatedCircle findFOV(float[] image, int width, boolean displayFlag, double realedgeFraction)
          Locate the circular FOV (the boundary of the actual retina in the image).
protected static int[] findMaxPositionFromCorner(float[] image, int width, int height, int[] corner, int xstep, int ystep)
          Find the location of the pixel with the maximum value on the line starting at x,y and stepping by xstep, ystep.
protected static int[] findThresholdPositionFromCorner(float[] image, int width, int height, int[] corner, int xstep, int ystep, float threshold)
          Find the location of the first pixel with a value equal or higher than treshold on the line starting at x,y and stepping by xstep, ystep.
static int getRegistrationParameters(float[] image, int width)
          Read the stimulus flag from the bottom left pixels of the image
protected static float largestDiameter(float[] edges, int width, double realedgeFraction)
          Get the diameter of a circle defined as edge pixels.
static void setRegistrationParameters(float[] image, int width, float[] parameters)
          Store the registration parameters (max REGISTRATIONOFFSET) into the bottom left pixels of the image Parameters start from the left with parameters[0], 1 pixel for parameters[2] etc.
static void setStimulusParameter(float[] image, int width, int stimulus)
          Store the stimulus flag into the bottom left pixels of the image
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REALEDGEFRACTION

static final float REALEDGEFRACTION
Fraction of edge histogram pixels that are real edges.

SLIDINGWINDOWSIZE

static final int SLIDINGWINDOWSIZE
Size of sliding window in pixels for equalization and vignetting removal.

HESSIANSCALE

static final float HESSIANSCALE
Optimal scale (unitless, stddev of the Gaussian) of the Hessian tensor for 256x256 retinal images. Correct for smaller and much larger images.

REGISTRATIONOFFSET

static final int REGISTRATIONOFFSET
On the last line, from the left edge this space is used as registration parameters.

STIMULUSOFFSET

static final int STIMULUSOFFSET
On the last line, this is used as stimulus flag (0=off, 1=on).
Constructor Detail

RetinalImage

public RetinalImage()
Method Detail

setRegistrationParameters

public static void setRegistrationParameters(float[] image,
                                             int width,
                                             float[] parameters)
Store the registration parameters (max REGISTRATIONOFFSET) into the bottom left pixels of the image Parameters start from the left with parameters[0], 1 pixel for parameters[2] etc.
Parameters:
image - the retinal image
width - the width of the image in pixels.
parameters - a float[] with the registration parameters.

setStimulusParameter

public static void setStimulusParameter(float[] image,
                                        int width,
                                        int stimulus)
Store the stimulus flag into the bottom left pixels of the image
Parameters:
image - the retinal image
width - the width of the image in pixels.
stimulus - the stimulus condition.

getRegistrationParameters

public static int getRegistrationParameters(float[] image,
                                            int width)
Read the stimulus flag from the bottom left pixels of the image
Parameters:
image - the retinal image
width - the width of the image in pixels.
Returns:
the stimulus condition.

findFOV

public static LocatedCircle findFOV(float[] image,
                                    int width,
                                    boolean displayFlag)
Parameters:
image - a retinal image
width - the width of the retinal image.
displayFlag - whether or not to display intermediate results.
See Also:
Locate the circular FOV (the boundary of the actual retina in the image). Assumes the retinal images occupies the central oval or circular part of the rectangular image. The FOV is the join of a circular optical FOV and a rectangular image. The size of the FOV and the image relative to each other can vary. Adjust the derivative scale relative to the size of the image. Does NOT modify image., HoughTransform, Hessian, Equalize

findFOV

public static LocatedCircle findFOV(float[] image,
                                    int width,
                                    boolean displayFlag,
                                    double realedgeFraction)
Locate the circular FOV (the boundary of the actual retina in the image). Assumes the retinal images occupies the central oval or circular part of the rectangular image. The FOV is the join of a circular optical FOV and a rectangular image. The size of the FOV and the image relative to each other can vary. Adjust the derivative scale relative to the size of the image. Does NOT modify image.
Parameters:
image - a retinal image
width - the width of the retinal image.
displayFlag - whether or not to display intermediate results.
realedgeFraction, - a threshold for edge pixels. It indicates the percentage of histogram particles that are considered edge pixels.
See Also:
HoughTransform, Hessian, Equalize

largestDiameter

protected static float largestDiameter(float[] edges,
                                       int width,
                                       double realedgeFraction)
Get the diameter of a circle defined as edge pixels. From each of the corner of the image edges, run a line to the center, and find the location with the highest pixel value. Take that as an edge location. Return the average of the distance of the four edge locations to the center, excluding obvious errors.
Parameters:
edges - an edge image
realedgeFraction, - a threshold for edge pixels. It indicates the percentage of histogram particles that are considered edge pixels.
Returns:
the average of the distance of the four edge locations to the center.

findThresholdPositionFromCorner

protected static int[] findThresholdPositionFromCorner(float[] image,
                                                       int width,
                                                       int height,
                                                       int[] corner,
                                                       int xstep,
                                                       int ystep,
                                                       float threshold)
Find the location of the first pixel with a value equal or higher than treshold on the line starting at x,y and stepping by xstep, ystep. If no value equal or higher tha threshold is found return the center of the image.
Parameters:
image - the image
width - the width of image in pixels.
x - the x-coordinate of the corner
y - the y-coordinates of the corner
xstep - the direction of the step needed to move to the center of the image in the x-direction.
ystep - the direction of the step needed to move to the center of the image in the y-direction.
threshold - a float
Returns:
an int[2] with int[0] the x-position and int[1] the y-position.

findMaxPositionFromCorner

protected static int[] findMaxPositionFromCorner(float[] image,
                                                 int width,
                                                 int height,
                                                 int[] corner,
                                                 int xstep,
                                                 int ystep)
Find the location of the pixel with the maximum value on the line starting at x,y and stepping by xstep, ystep.
Parameters:
image - the image
width - the width of image in pixels.
x - the x-coordinate of the corner
y - the y-coordinates of the corner
xstep - the direction of the step needed to move to the center of the image in the x-direction.
ystep - the direction of the step needed to move to the center of the image in the y-direction.
Returns:
an int[2] with int[0] the x-position and int[1] the y-position.