|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoptics.Optics
optics.Grid
public class Grid
Class to define the sampling grid for a optical image and allow access using continuous variables.
| Field Summary | |
|---|---|
protected javax.vecmath.Point2d |
centre
Reference point for the Grid, wrt to the centre. |
protected double |
dx
Sample interval in x direction |
protected double |
dy
Sample interval in y direction |
protected int |
height
Height of the grid in pixels |
protected int |
width
Width of the grid in pixels |
| Fields inherited from class optics.Optics |
|---|
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS |
| Constructor Summary | |
|---|---|
Grid()
Default constructor to for a grid of size 0 |
|
Grid(Grid g)
Constructor with all parameters set by specified Grid |
|
Grid(int w,
int h)
Constuctor with centre defaulted to 0,0 and sample interval to 1.0,1.0,1.0 |
|
Grid(int w,
int h,
double dx,
double dy)
Constructor with centre defaulted to 0,0 |
|
Grid(int w,
int h,
double dx,
double dy,
double xc,
double yc)
General constructor setting all parameters |
|
| Method Summary | |
|---|---|
Grid |
clone()
Return a clone of the current Grid. |
javax.vecmath.Point2d |
getCentre()
Method to get the centre |
double |
getDeltaX()
Method to get the x-sample |
double |
getDeltaY()
Method to get the y-sample |
int |
getHeight()
Method to get the height |
double |
getMaxRadius()
Method to get the maximum radius of the Grid. |
javax.vecmath.Point2d |
getPoint(int i,
int j)
Method to get the Point2d of a specified pixel
taking into account centre and sample intervals. |
javax.vecmath.Point2d |
getPoint(javax.vecmath.Point2i p)
Method to get the Point2d of a specified pixel
taking into account centre and sample intervals. |
javax.vecmath.Point2i |
getSample(javax.vecmath.Point2d p)
Method to get the sample (pixel) closest to the specified point taking into account centre and scaling. |
javax.vecmath.Point2d |
getSamplePoint(javax.vecmath.Point2d p)
Method to get the scaled sample location being the location of eth given point on the pixel grid. |
int |
getWidth()
Method to get the width |
void |
setCentre(double x,
double y)
Method to set the centre |
void |
setCentre(javax.vecmath.Point2d pt)
Method to set the centre |
void |
setSampleGrid(double dx,
double dy)
Method to set the sampling grid |
java.lang.String |
toString()
Method to return information String |
| Methods inherited from class optics.Optics |
|---|
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int width
protected int height
protected javax.vecmath.Point2d centre
protected double dx
protected double dy
| Constructor Detail |
|---|
public Grid(int w,
int h,
double dx,
double dy,
double xc,
double yc)
w - the widthh - the heightdx - x sample intervaldy - y sample intervalxc - x centreyc - y centre
public Grid(int w,
int h,
double dx,
double dy)
w - the widthh - the heightdx - x sample intervaldy - y sample interval
public Grid(int w,
int h)
w - the widthh - the heightpublic Grid()
public Grid(Grid g)
g - the specifying Grid| Method Detail |
|---|
public Grid clone()
clone in class java.lang.ObjectGrid clone of current Grid
public void setSampleGrid(double dx,
double dy)
dx - the x sample intervaldy - the y sample interval
public void setCentre(double x,
double y)
x - the x locationy - the y locationpublic void setCentre(javax.vecmath.Point2d pt)
pt - the centrepublic int getWidth()
int the widthpublic int getHeight()
int the heightpublic double getMaxRadius()
double the maximum radiuspublic javax.vecmath.Point2d getCentre()
Point2d the centre.public double getDeltaX()
double the x-sample internalpublic double getDeltaY()
double the y-sample internalpublic java.lang.String toString()
toString in class java.lang.Object
public javax.vecmath.Point2d getPoint(int i,
int j)
Point2d of a specified pixel
taking into account centre and sample intervals.
i - the x pixel locationj - the y pixel location
Point2d the locationpublic javax.vecmath.Point2d getPoint(javax.vecmath.Point2i p)
Point2d of a specified pixel
taking into account centre and sample intervals.
p - the pixel Point
Point2D.Float the locationpublic javax.vecmath.Point2d getSamplePoint(javax.vecmath.Point2d p)
This method is the inverse of getPoint(int, int)
p - the specifed point.
Point2d the location on pixel gridpublic javax.vecmath.Point2i getSample(javax.vecmath.Point2d p)
If outside the grid, both components will be set to -1.
p - the specified point.
Point2i closest pixel location.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||