|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.vecmath.Tuple2d
javax.vecmath.Point2d
uk.ac.ed.ph.signal.Grid2d
uk.ac.ed.ph.signal.Image
uk.ac.ed.ph.signal.RealImage
public class RealImage
Class to read and maniulate real monochrone images held as doubles.
Field Summary |
---|
Fields inherited from class uk.ac.ed.ph.signal.Image |
---|
data, statistics |
Fields inherited from class uk.ac.ed.ph.signal.Grid2d |
---|
height, width |
Fields inherited from class javax.vecmath.Tuple2d |
---|
x, y |
Constructor Summary | |
---|---|
RealImage(ComplexImage s)
Constuctor to form a RealImage from a ComplexImage with default conversion flag |
|
RealImage(ComplexImage s,
int flag)
Constuctor to form a RealImage from a ComplexImage with a conversion flag |
|
RealImage(int w,
int h)
Construcor to form RealImage of specified size in real space with the pixel values defaulting to zero. |
|
RealImage(RealDataArray dataArray)
Constuctor to form a RealImage from a specifed RealDataArray |
|
RealImage(RealImage s)
Constrcuor to form new RealImage being a copy of the specified RealImage including the image data. |
|
RealImage(RealImage s,
boolean copydata)
Constrcuor to form new RealImage being a copy of the specified RealImage. |
Method Summary | |
---|---|
RealImage |
blankcopy()
Method to forms a blacnk copy of the corrent RealImage with all parameters copyied, but the image data left blank. |
void |
calculateStatistics()
Method to calcualte the statisticse, even if they are currently flagged as valid. |
RealImage |
clone()
Methed to clone the current image, inclduing the data |
RealImage |
convolve(ImageFilterKernel k)
Methdo to convolve the current image with a kernel in real space. |
RealImage |
extract(int xstart,
int ystart,
int w,
int h)
Method to extract a region of an real image into a` new RealImage with samples of 1 in both direction. |
RealImage |
extract(int xstart,
int ystart,
int w,
int h,
int xsample,
int ysample)
Method to extract a region of an current image into a` new RealImage |
static RealImage |
fromPGMFile(File file)
Static method to read PGM image File of type P2 (assi) and P5 (raw) |
static RealImage |
fromPGMFile(String fileName)
Static method to read a PGM image of type P2 (asci) and P5 (raw) by filename |
static RealImage |
fromPGMStream(DataInputStream input)
Static method to read a RealImage from a pgm file, formatted P2 and raw P5 pgm files are supported |
static RealImage |
fromTextFile(String fileName,
int width,
int height)
Read a RealImage from a asci file that contains only the with one pixel per number in any format accepted by Double.parseDouble(). |
BufferedImage |
getBufferedImage()
Method to get the image as a displayable BufferedImage of type double . |
ColourScale |
getColourScale()
Method to get the ColourScale |
RealSignal |
getColumn(int i)
Method to get a Column as a RealSignal, valid only for image in real space. |
RealDataArray |
getDataArray()
Method to get the underlying RealDataArray |
BufferedImage |
getGreyBufferedImage(double min,
double max)
Method to get the RealImage as a BYTE_GRAY BufferedImage which can be displayed with specified min/max. |
RealSignal |
getRow(int j)
Method to get a Row as a RealSignal, valid only for image in real space. |
RealStatistics |
getStatistics()
Method to get the RealStatistics, which will be calcualte if they are not currently valid. |
RealImage |
median(ImageFilterKernel k)
Method to median the current image with a kernel in real space. |
RealImage |
median(int w,
int h)
Method to apply a smoothing median filter of specified size |
static RealImage |
readImage(File file)
General ReadImage static method with will read pgm, and any format accepted by the ImageIO (currently pnp,jpeg and gif). |
static RealImage |
readImage(String fileName)
General ReadImage static method with will read pgm, and any format accepted by the ImageIO (currently pnp,jpeg and gif). |
static RealImage |
readImageIO(File file,
int band)
Static method to read a RealImage a from jpeg/png/gif using the ImageIO inetrface. |
void |
setColourScale(ColourScale cs)
Method to set the image colourscale |
Methods inherited from class uk.ac.ed.ph.signal.Image |
---|
add, add, add, centreFourier, conjugate, conjugate, conjugate, fill, fourier, getComplex, getComplex, getConversion, getDataBuffer, getDouble, getDoubleValue, getSpace, getTitle, getType, mult, mult, mult, mult, mult, mult, mult, mult, multConjugate, setComplex, setComplex, setComplex, setComplex, setConversion, setDouble, setDouble, setStatisticsInvalid, setTitle, toString, validStatistics |
Methods inherited from class uk.ac.ed.ph.signal.Grid2d |
---|
getCentre, getDeltaX, getDeltaY, getHeight, getPoint, getPoint, getSample, getSamplePoint, getWidth, getXCentre, getXRange, getYCentre, getYRange, setCentre, setCentre, setHeight, setRange, setRange, setSampleGrid, setSampleGrid, setWidth |
Methods inherited from class javax.vecmath.Point2d |
---|
distance, distanceL1, distanceLinf, distanceSquared |
Methods inherited from class javax.vecmath.Tuple2d |
---|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, getX, getY, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setX, setY, sub, sub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RealImage(int w, int h)
w
- the width of the imageh
- the heigh of the imagepublic RealImage(RealImage s)
s
- the specifing RealImagepublic RealImage(RealImage s, boolean copydata)
s
- the specifing RealImagepublic RealImage(ComplexImage s, int flag)
s
- the ComplexImageflag
- the conversion flag.Complex
public RealImage(ComplexImage s)
s
- the ComplexSignalpublic RealImage(RealDataArray dataArray)
Note that the data is not copied
dataArray
- the DataArray holding the image data.Method Detail |
---|
public RealImage clone()
clone
in class Grid2d
RealImage
clone of current RealImagepublic RealImage blankcopy()
RealImage
blank copy of current RealImagepublic RealDataArray getDataArray()
RealDataArray
underlying data arraypublic void calculateStatistics()
public RealStatistics getStatistics()
RealStatistics
the image statistics.public ColourScale getColourScale()
public void setColourScale(ColourScale cs)
public BufferedImage getBufferedImage()
double
. If the colourscale is not
pretset it will deafult to a linear grey scale.
Note the actual data array is ued to make the displayable raster.
BufferedImage
displayable buffered image.public BufferedImage getGreyBufferedImage(double min, double max)
If min = max they will be found from the image statistics
min
- the min pixel value, zero in BufferedImagemax
- the max pixel valie, 255 in BufferedImage
BufferedImage
displayable image.public RealSignal getColumn(int i)
i
- the columnpublic RealSignal getRow(int j)
j
- the rowpublic RealImage extract(int xstart, int ystart, int w, int h, int xsample, int ysample)
xstart
- left start pixelystart
- top start pixelw
- width to be extractedh
- height to be extractedxsample
- sample interval in x directionysample
- sample internal in y directionpublic RealImage extract(int xstart, int ystart, int w, int h)
xstart
- left start pixelystart
- top start pixelw
- width to be extractedh
- height to be extractedpublic static RealImage fromPGMStream(DataInputStream input)
input
- the InputStreampublic static RealImage fromPGMFile(File file)
file
- the File containing the image
RealImage
The read PGM imagepublic static RealImage fromPGMFile(String fileName)
fileName
- the file name
RealImage
The read PGM imagepublic static RealImage fromTextFile(String fileName, int width, int height)
fileName
- the ASCI filewidth
- the image widthheight
- the image height
public static RealImage readImageIO(File file, int band)
file
- the Fileband
- the image band.
public static RealImage readImage(File file)
file
- the File
RealImage
containing the imagepublic static RealImage readImage(String fileName)
fileName
- the file name
RealImage
containing the imagepublic RealImage convolve(ImageFilterKernel k)
k
- the filter kernelpublic RealImage median(ImageFilterKernel k)
k
- the filter kernelpublic RealImage median(int w, int h)
w
- width of median kernelh
- height of median kernel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |