net.grelf.image
Class Image8or16Base

java.lang.Object
  extended by net.grelf.image.ImageBase
      extended by net.grelf.image.Image8or16Base
All Implemented Interfaces:
Image
Direct Known Subclasses:
Image16, Image8

public abstract class Image8or16Base
extends ImageBase
implements Image

Common code for Image8 and Image16, both of which really use a java.awt.image.BufferedImage internally.


Field Summary
protected  java.awt.image.BufferedImage bim
           
protected  double[] zeroPxDouble
           
protected  int[] zeroPxInt
           
 
Fields inherited from class net.grelf.image.ImageBase
metadata
 
Constructor Summary
Image8or16Base()
           
 
Method Summary
 void add(java.awt.image.BufferedImage bim2)
          Add pixel values from bim into the data array.
 void addProportion(Image other, double fractionThis, double fractionOther)
          Add proportion of pixel values from the other Image to a proportion of the current data array.
 void addTranslated(java.awt.image.BufferedImage bim, double dx, double dy)
          Add pixel values from bim into the data array, offset by vector (dx, dy).
 void addTranslated(java.awt.image.BufferedImage bim, int dx, int dy)
          Add pixel values from bim into the data array, offset by vector (dx, dy).
 void applyCurve(RangeInt currentRange, java.util.List<java.awt.Point> points, java.awt.image.BufferedImage dstBim)
          Apply a look-up curve to transform pixels from this image into BufferedImage pixels or, if the BufferedImage is null, back into this image.
 void autoCrop()
          Automatically remove any rectangular margin of black (0, 0, 0) pixels from the image, thereby cropping it.
 void autoStretch(boolean allChannelsSame)
          Stretch the contrast in the image so the full range of levels is used.
 void autoStretch(boolean allChannelsSame, java.awt.Point topLeft, java.awt.Point bottomRight)
          Stretch the contrast in the image so the full range of levels is used.
 ByteMask autoThreshold()
          Threshold automatically.
 void averageVertically()
          Replace every pixel of every vertical line in the image by the average of the levels along the line.
 void averageVertically(int yMin, int yMax)
          Replace every pixel of every vertical line in the image by the average of the levels along the line, within two y coordinate limits.
 void blurGaussian(int nx, int ny, javax.swing.ProgressMonitor monitor)
          Do Gaussian blurring of this image with 1D profiles of width nx (horizontal) and ny (vertical).
protected  void checkCompatibility(java.awt.image.BufferedImage bim)
           
abstract  Image clone()
           
 void convertToMonochrome()
          Convert the image to monochrome, using 0.325 x red + 0.5 * green + 0.175 * blue.
 void convertToMonochrome(double... f)
          Convert the image to monochrome, using given fractions of each channel.
 void convolve(double[] horz, double[] vert, javax.swing.ProgressMonitor monitor)
          Convolve the given image with the given 1D arrays (horizontal and vertical - may be different).
 void convolve(Kernel kernel, javax.swing.ProgressMonitor monitor)
          Perform a 2D linear convolution with the given kernel.
 void correctBackground(double scale, int cellFactor)
          Level the background of the image by dividing the image into n x n cells and using the modal values of the histogram in every cell.
 void crop(java.awt.Point pt1, java.awt.Point pt2)
          Crop the image by a rectangle defined by the diagonally opposite points.
 void deconvolve(Kernel kernel, int nPasses, double weight, javax.swing.ProgressMonitor monitor)
          Deconvolve this image with the given kernel, using van Cittert's method.
 void dispose()
          Release all resources.
 void divide(int n)
          Divide the value of every pixel by n
 void divideByFlatField(Image flat)
          Divide by a flat field image.
 void drawRim(int width, java.awt.Color colour)
          Draw a rim around the image, of the given width and colour
 void fit(int width, int height)
          Scale the image so it fits into the given width and height (in pixels), without changing its proportions.
 void flipHorizontal()
          Flip the image horizontally.
 void flipVertical()
          Flip the image vertically.
 int getBitsPerChannel()
          Get the number of bits per channel.
static int getBitsPerChannel(java.awt.image.BufferedImage bimage)
          Not required by Image interface, but useful.
 java.awt.image.BufferedImage getBufferedImage()
           
 RangeInt[] getChannelRanges()
          Find the range of values in each channel, as pairs of int values.
 RangeDouble[] getChannelRangesDouble()
          Find the range of values in each channel, as pairs of double values.
 int getHeight()
          Get the height, in pixels, of the Image.
 java.lang.String getImageTypeAsString()
          For displaying image information, get its java.awt.image.BufferedImage type constant name.
static java.lang.String getImageTypeAsString(java.awt.image.BufferedImage bimage)
          For displaying image information, get the given image's java.awt.image.BufferedImage type constant name.
 int getMaxLevel()
          Not required by Image interface.
static int getMaxLevel(java.awt.image.BufferedImage bimage)
          Not required by Image interface, but useful.
 Metadata getMetadata()
          Get metadata associated with the image.
 int getNBands()
          Get the number of bands (channels) in the Image.
static int getNBands(java.awt.image.BufferedImage bim)
          Not required by Image interface, but useful.
 int[] getPixel(int x, int y)
          Get array of int pixel values for all bands at the given integer (x, y) position.
 double[] getPixelDouble(int x, int y)
          Get array of double pixel values for all bands at the given integer (x, y) position.
 double[] getPixelDoubleInterpolated(double x, double y)
          Get array of double pixel values for all bands at the given fractional (x, y) position.
 int[] getPixelInterpolated(double x, double y)
          Get array of int pixel values for all bands at the given fractional (x, y) position.
 RangeInt getRange()
          Get the minimum and maximum values occurring across all channels, as a pair of int values.
 RangeInt getRangeByRescanning()
          Get overall range of values across all channels, as a pair of int values.
 RangeDouble getRangeByRescanningDouble()
          Get overall range of values across all channels, as a pair of double values.
 RangeDouble getRangeDouble()
          Get the minimum and maximum values occurring across all channels, as a pair of double values.
 int getWidth()
          Get the width, in pixels, of the Image.
 java.awt.image.BufferedImage gnomonicProjection(java.awt.image.BufferedImage src, int focalLength_mm, double detectorWidth_mm, double detectorHeight_mm)
          Project from sphere to plane.
protected  java.awt.image.BufferedImage inverseGnomonicProjection(java.awt.image.BufferedImage src, int focalLength_mm, double detectorWidth_mm, double detectorHeight_mm)
          Project from plane to sphere.
 void invert()
          Invert the colour at every pixel in the image.
 void meanFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
          Replace every pixel in the image by the mean value of its n x n neighbourhood, where n = 2.halfWidth + 1.
 void medianFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
          Replace every pixel in the image by the median value of its n x n neighbourhood, where n = 2.halfWidth + 1.
 void multiply(double f)
          Multiply all pixel values (in all bands) in the Image by factor f, truncating the result if pixels contain integer values.
 void multiply(Image other)
          Multiply pixel values of current image by those of another.
 void multiply(Image other, double f1, double f2)
          Multiply fraction f1 of this image by f2 of the other.
 void nearestExtremeFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
          Replace every pixel in the image by the nearest of the max and min of its n x n neighbourhood, where n = 2.halfWidth + 1.
 void neutraliseBackground()
          Equate the histogram modes of all channels by stretching from the overall maximum value.
 void rankFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
          Replace every pixel in the image by its rank in its n x n neighbourhood, where n = 2.halfWidth + 1.
 void reapplyColour(Image intensityImage, Image colourImage)
          For combining a monochrome intensity image with a multi-band colour information image, the 2 images having been created by ImProcess.splitIntensity ().
 void rotate(double angleDegs)
          Rotate the image anticlockwise by the given angle (in degrees).
 void save(java.lang.String filePath)
          Save image as a file.
 void save(java.lang.String filePath, RangeDouble range)
          Save image as a file.
 void save(java.lang.String filePath, RangeInt range)
          Save image as a file.
 void saveAsFITS(java.lang.String filePath)
          This is called by save() if the filePath ends in ".fits" but it may be called directly.
 void scale(double factor, boolean interpolating)
          Scale the image by the given factor
 java.awt.image.BufferedImage scaleDownForDisplay(int factor)
          Create a BufferedImage compatible with the display and scale the current Image down into it by an integer factor (maximum speed).
 void set(java.awt.image.BufferedImage bim)
          Set pixel values from bim into the data array.
 void setBufferedImage(java.awt.image.BufferedImage bim)
           
 void setMetadata(Metadata theData)
          Associate metadata with the image.
 void setPixel(int x, int y, int[] px)
          Does nothing if (x, y) is outside the image.
 void setPixel(int x, int y, int band, int px)
          Set value into a single band of a pixel without changing the other bands.
 void setPixelDouble(int x, int y, double[] px)
          Does nothing if (x, y) is outside the image.
 void setPixelDouble(int x, int y, int band, double px)
          Set value into a single band of a pixel without changing the other bands.
 void showInfo()
          Display information about the current image in a dialogue.
 void subtract(Image other)
          Subtract pixel values of other image from this image data array, raising result by minimum possible so it is always positive.
 void subtractToZero(Image other)
          Subtract pixel values of other image from this image data array, clipping negative results to zero.
 ByteMask threshold(Threshold thresh)
          Threshold the image to detect pixels in the range(s) specified by the given threshold.
 java.lang.String toFoldedString(java.lang.String lineEnd)
          Return complete metadata in a form suitable for display.
 void translate(double dx, double dy)
          Displace the image content by the given offset vector, interpolating between pixels.
 void translate(int dx, int dy)
          Displace the image content by the given offset vector, a whole number of pixels.
 void varianceFilter(int halfWidth, javax.swing.ProgressMonitor monitor)
          Replace every pixel in the image by the variance of its n x n neighbourhood, where n = 2.halfWidth + 1.
 
Methods inherited from class net.grelf.image.ImageBase
createImage, createImage, getCalibration, getFilePath, getGraphicsConfiguration, recombine, sameBitsAndBands, sameSizeBitsAndBands, setCalibration, setFilePath, showInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.grelf.image.Image
add, convertToImage16, convertToImage32, convertToImage64, convertToImage8, getCalibration, getFilePath, gnomonicProjection, inverseGnomonicProjection, isRaw, setCalibration, setFilePath, splitChannels, toString
 

Field Detail

bim

protected java.awt.image.BufferedImage bim

zeroPxInt

protected int[] zeroPxInt

zeroPxDouble

protected double[] zeroPxDouble
Constructor Detail

Image8or16Base

public Image8or16Base()
Method Detail

getBufferedImage

public java.awt.image.BufferedImage getBufferedImage()

setBufferedImage

public void setBufferedImage(java.awt.image.BufferedImage bim)

checkCompatibility

protected void checkCompatibility(java.awt.image.BufferedImage bim)
                           throws IncompatibleImageException
Throws:
IncompatibleImageException

add

public void add(java.awt.image.BufferedImage bim2)
         throws IncompatibleImageException
Description copied from interface: Image
Add pixel values from bim into the data array. If bim is larger than the data then the rectangle starting at the top left corner of bim which overlaps the data will be used.

Specified by:
add in interface Image
Throws:
IncompatibleImageException

addProportion

public void addProportion(Image other,
                          double fractionThis,
                          double fractionOther)
                   throws IncompatibleImageException
Add proportion of pixel values from the other Image to a proportion of the current data array. If other is larger than the data then the rectangle starting at the top left corner of other which overlaps the data will be used.

Specified by:
addProportion in interface Image
Throws:
IncompatibleImageException

addTranslated

public void addTranslated(java.awt.image.BufferedImage bim,
                          int dx,
                          int dy)
                   throws IncompatibleImageException
Description copied from interface: Image
Add pixel values from bim into the data array, offset by vector (dx, dy). Only those pixels of the offset bim which overlap the data are used. using integer coordinates, this version is fast but does not interpolate from the source image.

Specified by:
addTranslated in interface Image
Throws:
IncompatibleImageException

addTranslated

public void addTranslated(java.awt.image.BufferedImage bim,
                          double dx,
                          double dy)
                   throws IncompatibleImageException
Description copied from interface: Image
Add pixel values from bim into the data array, offset by vector (dx, dy). Only those pixels of the offset bim which overlap the data are used. Using double coordinates, this version is slower but does interpolate from the source image.

Specified by:
addTranslated in interface Image
Throws:
IncompatibleImageException

applyCurve

public void applyCurve(RangeInt currentRange,
                       java.util.List<java.awt.Point> points,
                       java.awt.image.BufferedImage dstBim)
                throws IncompatibleImageException
Apply a look-up curve to transform pixels from this image into BufferedImage pixels or, if the BufferedImage is null, back into this image. The curve is a set of points with x and y ranges of 0..255 but this image (x-axis) has 32-bit range and the target image (y-axis) may have any number of bits per channel. This and the other image must have the same number of channels, otherwise an IncompatibleImageException is thrown.

Specified by:
applyCurve in interface Image
Throws:
IncompatibleImageException

autoCrop

public void autoCrop()
Automatically remove any rectangular margin of black (0, 0, 0) pixels from the image, thereby cropping it.

Specified by:
autoCrop in interface Image

autoStretch

public void autoStretch(boolean allChannelsSame)
Stretch the contrast in the image so the full range of levels is used.

Specified by:
autoStretch in interface Image

autoStretch

public void autoStretch(boolean allChannelsSame,
                        java.awt.Point topLeft,
                        java.awt.Point bottomRight)
Stretch the contrast in the image so the full range of levels is used. This version only changes pixels in the rectangle defined by the two points as diagonal.

Specified by:
autoStretch in interface Image

autoThreshold

public ByteMask autoThreshold()
Threshold automatically. First gets a histogram and finds the channel means. Sets the threshold for each channel: if the mean is lower than half-way up the brightness range the background is assumed to be dark so the threshold goes from half-way up to the top. Otherwise the background is assumed to be bright so the threshold goes from 0 to half-way. Then does the thresholding to set a mask in the GlassPane, suitable for blob detection.
Not for segmenting stars: use StarSegmenter class instead.

Specified by:
autoThreshold in interface Image

averageVertically

public void averageVertically()
Replace every pixel of every vertical line in the image by the average of the levels along the line. This is for analysing profiles (particularly for spectroscopy). Rotate and crop the image appropriately before using this.

Specified by:
averageVertically in interface Image

averageVertically

public void averageVertically(int yMin,
                              int yMax)
Replace every pixel of every vertical line in the image by the average of the levels along the line, within two y coordinate limits. This is for analysing profiles (particularly for spectroscopy). Rotate and crop the image appropriately before using this.

Specified by:
averageVertically in interface Image

blurGaussian

public void blurGaussian(int nx,
                         int ny,
                         javax.swing.ProgressMonitor monitor)
Do Gaussian blurring of this image with 1D profiles of width nx (horizontal) and ny (vertical).

Specified by:
blurGaussian in interface Image

clone

public abstract Image clone()
Specified by:
clone in interface Image
Overrides:
clone in class java.lang.Object

convertToMonochrome

public void convertToMonochrome()
Convert the image to monochrome, using 0.325 x red + 0.5 * green + 0.175 * blue.

Specified by:
convertToMonochrome in interface Image

convertToMonochrome

public void convertToMonochrome(double... f)
Convert the image to monochrome, using given fractions of each channel. The fractions need not add up to 1.0 because the result is scaled. The number of fractions supplied must equal to the initial number of channels in the image, otherwise the user sees an error message.

Specified by:
convertToMonochrome in interface Image

convolve

public void convolve(Kernel kernel,
                     javax.swing.ProgressMonitor monitor)
Perform a 2D linear convolution with the given kernel. The monitor may be null.

Specified by:
convolve in interface Image

convolve

public void convolve(double[] horz,
                     double[] vert,
                     javax.swing.ProgressMonitor monitor)
Convolve the given image with the given 1D arrays (horizontal and vertical - may be different). All channels are convolved the same. If either array is null the convolution in that direction is skipped. This method is intended as a quicker way of doing certain useful convolutions, such as Gaussian blurring. The monitor may be null.

Specified by:
convolve in interface Image

correctBackground

public void correctBackground(double scale,
                              int cellFactor)
Level the background of the image by dividing the image into n x n cells and using the modal values of the histogram in every cell. n (cellFactor) is set in the Config.

Specified by:
correctBackground in interface Image

crop

public void crop(java.awt.Point pt1,
                 java.awt.Point pt2)
Crop the image by a rectangle defined by the diagonally opposite points. Does not assume pt1 is above or to the left of pt2.

Specified by:
crop in interface Image

deconvolve

public void deconvolve(Kernel kernel,
                       int nPasses,
                       double weight,
                       javax.swing.ProgressMonitor monitor)
Deconvolve this image with the given kernel, using van Cittert's method. The monitor may be null.

Specified by:
deconvolve in interface Image

dispose

public void dispose()
Description copied from interface: Image
Release all resources.

Specified by:
dispose in interface Image

divide

public void divide(int n)
Divide the value of every pixel by n

Specified by:
divide in interface Image

divideByFlatField

public void divideByFlatField(Image flat)
Divide by a flat field image.

Specified by:
divideByFlatField in interface Image

drawRim

public void drawRim(int width,
                    java.awt.Color colour)
Draw a rim around the image, of the given width and colour

Specified by:
drawRim in interface Image

fit

public void fit(int width,
                int height)
Scale the image so it fits into the given width and height (in pixels), without changing its proportions.

Specified by:
fit in interface Image

flipHorizontal

public void flipHorizontal()
Flip the image horizontally.

Specified by:
flipHorizontal in interface Image

flipVertical

public void flipVertical()
Flip the image vertically.

Specified by:
flipVertical in interface Image

getBitsPerChannel

public int getBitsPerChannel()
Description copied from interface: Image
Get the number of bits per channel.

Specified by:
getBitsPerChannel in interface Image

getBitsPerChannel

public static int getBitsPerChannel(java.awt.image.BufferedImage bimage)
Not required by Image interface, but useful.


getChannelRanges

public RangeInt[] getChannelRanges()
Description copied from interface: Image
Find the range of values in each channel, as pairs of int values.

Specified by:
getChannelRanges in interface Image

getChannelRangesDouble

public RangeDouble[] getChannelRangesDouble()
Description copied from interface: Image
Find the range of values in each channel, as pairs of double values.

Specified by:
getChannelRangesDouble in interface Image

getHeight

public int getHeight()
Description copied from interface: Image
Get the height, in pixels, of the Image.

Specified by:
getHeight in interface Image

getImageTypeAsString

public java.lang.String getImageTypeAsString()
For displaying image information, get its java.awt.image.BufferedImage type constant name.

Specified by:
getImageTypeAsString in interface Image

getImageTypeAsString

public static java.lang.String getImageTypeAsString(java.awt.image.BufferedImage bimage)
For displaying image information, get the given image's java.awt.image.BufferedImage type constant name.


getMaxLevel

public int getMaxLevel()
Not required by Image interface.


getMaxLevel

public static int getMaxLevel(java.awt.image.BufferedImage bimage)
Not required by Image interface, but useful.


getMetadata

public Metadata getMetadata()
Description copied from class: ImageBase
Get metadata associated with the image. Null if none.

Specified by:
getMetadata in interface Image
Overrides:
getMetadata in class ImageBase

getNBands

public int getNBands()
Description copied from interface: Image
Get the number of bands (channels) in the Image.

Specified by:
getNBands in interface Image

getNBands

public static int getNBands(java.awt.image.BufferedImage bim)
Not required by Image interface, but useful.


getRangeByRescanning

public RangeInt getRangeByRescanning()
Description copied from interface: Image
Get overall range of values across all channels, as a pair of int values.

Specified by:
getRangeByRescanning in interface Image

getRangeByRescanningDouble

public RangeDouble getRangeByRescanningDouble()
Description copied from interface: Image
Get overall range of values across all channels, as a pair of double values.

Specified by:
getRangeByRescanningDouble in interface Image

getPixel

public int[] getPixel(int x,
                      int y)
Description copied from interface: Image
Get array of int pixel values for all bands at the given integer (x, y) position. Returns all zeroes if the position is outside the data array.

Specified by:
getPixel in interface Image

getPixelDouble

public double[] getPixelDouble(int x,
                               int y)
Description copied from interface: Image
Get array of double pixel values for all bands at the given integer (x, y) position. Returns all zeroes if the position is outside the data array.

Specified by:
getPixelDouble in interface Image

getPixelDoubleInterpolated

public double[] getPixelDoubleInterpolated(double x,
                                           double y)
Description copied from interface: Image
Get array of double pixel values for all bands at the given fractional (x, y) position. Returns all zeroes if the position is outside the data array.

Specified by:
getPixelDoubleInterpolated in interface Image

getPixelInterpolated

public int[] getPixelInterpolated(double x,
                                  double y)
Description copied from interface: Image
Get array of int pixel values for all bands at the given fractional (x, y) position. Returns all zeroes if the position is outside the data array.

Specified by:
getPixelInterpolated in interface Image

getRange

public RangeInt getRange()
Description copied from interface: Image
Get the minimum and maximum values occurring across all channels, as a pair of int values. Fast version, which does not scan the image.

Specified by:
getRange in interface Image

getRangeDouble

public RangeDouble getRangeDouble()
Description copied from interface: Image
Get the minimum and maximum values occurring across all channels, as a pair of double values. Fast version, which does not scan the image.

Specified by:
getRangeDouble in interface Image

getWidth

public int getWidth()
Description copied from interface: Image
Get the width, in pixels, of the Image.

Specified by:
getWidth in interface Image

gnomonicProjection

public java.awt.image.BufferedImage gnomonicProjection(java.awt.image.BufferedImage src,
                                                       int focalLength_mm,
                                                       double detectorWidth_mm,
                                                       double detectorHeight_mm)
Project from sphere to plane.


inverseGnomonicProjection

protected java.awt.image.BufferedImage inverseGnomonicProjection(java.awt.image.BufferedImage src,
                                                                 int focalLength_mm,
                                                                 double detectorWidth_mm,
                                                                 double detectorHeight_mm)
Project from plane to sphere.


invert

public void invert()
Invert the colour at every pixel in the image.

Specified by:
invert in interface Image

meanFilter

public void meanFilter(int halfWidth,
                       javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the mean value of its n x n neighbourhood, where n = 2.halfWidth + 1.

Specified by:
meanFilter in interface Image

medianFilter

public void medianFilter(int halfWidth,
                         javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the median value of its n x n neighbourhood, where n = 2.halfWidth + 1.

Specified by:
medianFilter in interface Image

multiply

public void multiply(double f)
Multiply all pixel values (in all bands) in the Image by factor f, truncating the result if pixels contain integer values. May well saturate but will not overflow to negative values.

Specified by:
multiply in interface Image

multiply

public void multiply(Image other)
Multiply pixel values of current image by those of another. May well saturate but will not overflow to negative values.

Specified by:
multiply in interface Image

multiply

public void multiply(Image other,
                     double f1,
                     double f2)
Multiply fraction f1 of this image by f2 of the other.

Specified by:
multiply in interface Image

nearestExtremeFilter

public void nearestExtremeFilter(int halfWidth,
                                 javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the nearest of the max and min of its n x n neighbourhood, where n = 2.halfWidth + 1.

Specified by:
nearestExtremeFilter in interface Image

neutraliseBackground

public void neutraliseBackground()
Description copied from interface: Image
Equate the histogram modes of all channels by stretching from the overall maximum value.

Specified by:
neutraliseBackground in interface Image

rankFilter

public void rankFilter(int halfWidth,
                       javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by its rank in its n x n neighbourhood, where n = 2.halfWidth + 1. The rank is scaled up so that its possible values span the grey level range of the image. Each channel is treated independently.

Specified by:
rankFilter in interface Image

reapplyColour

public void reapplyColour(Image intensityImage,
                          Image colourImage)
Description copied from interface: Image
For combining a monochrome intensity image with a multi-band colour information image, the 2 images having been created by ImProcess.splitIntensity (). The result fills the current Image, overwriting any previous contents.

Specified by:
reapplyColour in interface Image

rotate

public void rotate(double angleDegs)
Rotate the image anticlockwise by the given angle (in degrees).

Specified by:
rotate in interface Image

save

public void save(java.lang.String filePath)
Save image as a file. FITS or any format supported by JAI may be used. The format is indicated by the extension at the end of the path. Metadata will be written in the standard format (javax_imageio_1.0) if the writer supports it.

Specified by:
save in interface Image

save

public void save(java.lang.String filePath,
                 RangeInt range)
Save image as a file. In the case of 8 and 16 bit images this simply calls save(), so the second parameter is ignored and may be null.

Specified by:
save in interface Image

save

public void save(java.lang.String filePath,
                 RangeDouble range)
Save image as a file. In the case of 8 and 16 bit images this simply calls save(), so the second parameter is ignored and may be null.

Specified by:
save in interface Image

saveAsFITS

public void saveAsFITS(java.lang.String filePath)
This is called by save() if the filePath ends in ".fits" but it may be called directly.

Specified by:
saveAsFITS in interface Image

scale

public void scale(double factor,
                  boolean interpolating)
Scale the image by the given factor

Specified by:
scale in interface Image

scaleDownForDisplay

public java.awt.image.BufferedImage scaleDownForDisplay(int factor)
Create a BufferedImage compatible with the display and scale the current Image down into it by an integer factor (maximum speed).

Specified by:
scaleDownForDisplay in interface Image

set

public void set(java.awt.image.BufferedImage bim)
         throws IncompatibleImageException
Description copied from interface: Image
Set pixel values from bim into the data array. If bim is larger than the data then the rectangle starting at the top left corner of bim which overlaps the data will be used.

Specified by:
set in interface Image
Throws:
IncompatibleImageException

setMetadata

public void setMetadata(Metadata theData)
Description copied from class: ImageBase
Associate metadata with the image.

Specified by:
setMetadata in interface Image
Overrides:
setMetadata in class ImageBase

setPixel

public void setPixel(int x,
                     int y,
                     int[] px)
Description copied from interface: Image
Does nothing if (x, y) is outside the image.

Specified by:
setPixel in interface Image

setPixel

public void setPixel(int x,
                     int y,
                     int band,
                     int px)
Description copied from interface: Image
Set value into a single band of a pixel without changing the other bands. Does nothing if (x, y) is outside the image.

Specified by:
setPixel in interface Image

setPixelDouble

public void setPixelDouble(int x,
                           int y,
                           double[] px)
Description copied from interface: Image
Does nothing if (x, y) is outside the image.

Specified by:
setPixelDouble in interface Image

setPixelDouble

public void setPixelDouble(int x,
                           int y,
                           int band,
                           double px)
Description copied from interface: Image
Set value into a single band of a pixel without changing the other bands. Does nothing if (x, y) is outside the image.

Specified by:
setPixelDouble in interface Image

showInfo

public void showInfo()
Display information about the current image in a dialogue.

Specified by:
showInfo in interface Image

subtract

public void subtract(Image other)
              throws IncompatibleImageException
Subtract pixel values of other image from this image data array, raising result by minimum possible so it is always positive. If other is larger than this image then the rectangle starting at the top left corner of other which overlaps this image will be used.

Specified by:
subtract in interface Image
Throws:
IncompatibleImageException

subtractToZero

public void subtractToZero(Image other)
                    throws IncompatibleImageException
Subtract pixel values of other image from this image data array, clipping negative results to zero. If other is larger than this image then the rectangle starting at the top left corner of other which overlaps this image will be used.

Specified by:
subtractToZero in interface Image
Throws:
IncompatibleImageException

threshold

public ByteMask threshold(Threshold thresh)
Threshold the image to detect pixels in the range(s) specified by the given threshold. Return a binary mask (values BlobMask.MASK_CLEAR or BlobMask.MASK_SET), suitable for setting into GlassPane. The image may have any number of bands.

Specified by:
threshold in interface Image

translate

public void translate(int dx,
                      int dy)
Displace the image content by the given offset vector, a whole number of pixels. Image size is unchanged. Margins exposed by the shift are filled with zeroes. Portions of the image shifted off the edge are lost. Shifting an image by a very small amount and then subtracting it from itself (eg, as previously cloned) is a way of detecting edges in the direction of the offset.

Specified by:
translate in interface Image

translate

public void translate(double dx,
                      double dy)
Displace the image content by the given offset vector, interpolating between pixels. Image size is unchanged. Margins exposed by the shift are filled with zeroes. Portions of the image shifted off the edge are lost. Shifting an image by a very small amount and then subtracting it from itself (eg, as previously cloned) is a way of detecting edges in the direction of the offset.

Specified by:
translate in interface Image

varianceFilter

public void varianceFilter(int halfWidth,
                           javax.swing.ProgressMonitor monitor)
Replace every pixel in the image by the variance of its n x n neighbourhood, where n = 2.halfWidth + 1.

Specified by:
varianceFilter in interface Image

toFoldedString

public java.lang.String toFoldedString(java.lang.String lineEnd)
Description copied from interface: Image
Return complete metadata in a form suitable for display. The lineEnd might be "\n" or "
", depending on the intended output medium.

Specified by:
toFoldedString in interface Image