net.grelf.grip
Class ImFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by net.grelf.grip.ImFrame
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
Direct Known Subclasses:
BlobFrame, CometFrame, MagnifiedFrame, StarChartFrame, StarMeasFrame

public class ImFrame
extends javax.swing.JFrame

This class is the window displayed for each image. It has a menu, the code for which is in class ImMenu. The image is displayed on the content pane of the window, in an object of class ImPane. For drawing lines for measuring, the glass pane of this window is used. The code for that is in class GlassPane.

All of the ImFrame objects which currently exist for the application are referenced from a list in the GRIP class.

The frame is only added to the list if an image is successfully opened in it.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  LevelsMenu levelsMenu
           
protected  javax.swing.JMenuBar menubar
           
protected  ImFrame parentFrame
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ImFrame(java.lang.String title, DrawingMode drawingMode, java.lang.String imFilePath, int newImageNo, int width, int height, MeasurementHandler mh)
           
ImFrame(java.lang.String title, DrawingMode drawingMode, java.lang.String imFilePath, int newImageNo, int width, int height, MeasurementHandler mh, boolean withMenu)
           
ImFrame(java.lang.String title, DrawingMode drawingMode, java.lang.String imFilePath, int newImageNo, int width, int height, MeasurementHandler mh, boolean withMenu, ImPane imPane, ImFrame theParentFrame, Image image)
          The most general constructor, that all the others invoke.
ImFrame(java.lang.String imFilePath, Image image)
          The file path is also used as the title.
ImFrame(java.lang.String title, ImPane imPane)
          Make a new frame from an already existing ImPane.
ImFrame(java.lang.String title, int width, int height)
          No file loading, no menu.
ImFrame(java.lang.String title, int width, int height, boolean withMenu)
          No file loading but can have menu.
ImFrame(java.lang.String title, int width, int height, boolean withMenu, ImFrame parentFrame)
          No file loading but can have a menu and has an associated set of blob measurements.
ImFrame(java.lang.String title, int newImageNo, int width, int height, MeasurementHandler mh)
           
ImFrame(java.lang.String imFilePath, MeasurementHandler mh)
           
 
Method Summary
 void addHistory(java.lang.String s)
          Add a string to the history list for this frame.
 void analyseAsSpectrum()
           
 void autoCrop()
          Automatically remove any rectangular margin of black (0, 0, 0) pixels from the image, thereby cropping it.
 void autoStretch()
          Stretch the contrast in the image so the full range of levels is used.
 void blurGaussian(int nx, int ny)
          Do Gaussian blurring of this image with 1D profiles of width nx (horizontal) and ny (vertical).
 void convertToMonochrome()
          Convert the image to monochrome, using 0.325 x red + 0.5 * green + 0.175 * blue.
 void convertToMonochrome(double... f)
          Convert the multi-channel image to monochrome, using the factors f to determine ratios of channels.
 void convolve(Kernel aKernel)
          Convolve this image with the given kernel, setting the kernel as the current kernel field of this class.
 void correctBackground()
          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 correctBackground(double scale, int cellWidth)
          Version which is given the 2 parameters rather than reading them from config.properties file.
 void crop(java.awt.Point pt1, java.awt.Point pt2)
          Crop the image by a drawn rectangle.
 void crop(java.awt.Point pt1, java.awt.Point pt2, boolean promptToConfirm)
          Crop the image by a drawn rectangle and adjust any BlobMeasList it may have.
 void deconvolve(Kernel kernel, int nPasses, double deconvolutionWeight)
          Deconvolve the image with the given kernel by the van Cittert method.
 BlobMeasList detectBlobs()
           
 BlobMeasList detectBlobs(boolean includeSinglePixelBlobs)
           
 BlobMeasList detectBlobs(boolean includeSinglePixelBlobs, boolean replot)
           
 void dispose()
          Tidy up when the frame is closed.
 void divideByFlatField(ImFrame imf2)
          Divide this image by flat field in imf2, pixel by pixel
 void doOpInBackground(OpThread.Ops op)
          For particularly long operations, run them on an OpThread rather than clog up swing's event dispatch thread.
 void doOpInBackground(OpThread.Ops op, int width)
          For particularly long operations, run them on an OpThread rather than clog up swing's event dispatch thread.
 ImFrame duplicate()
          Duplicate this ImFrame, making a new displayed frame.
 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.
 BlobMeasList getBlobMeases()
          If this frame has a list of detected blob measurements return the list, otherwise return null.
 java.lang.String getCaption()
          Get the caption of this frame.
 java.lang.String getFilePath()
          Get the path from which the current image was loaded or into which it has been saved.
 GlassPane getGP()
          Get a reference to this frame's overlaid GlassPane.
 TimeInterval getImageTimeSpan()
           
 ImPane getImPane()
          Get a reference to this frame's ImPane display component, which is on its scroll pane.
 java.lang.StringBuffer getInfo()
          Get information about the current image in a format suitable for display (lines end with "\n").
 ImFrame getParentFrame()
           
 javax.swing.JScrollPane getScrollPane()
          Get a reference to this frame's scroll pane, which is on its content pane.
 void gnomonicProjection()
          Project from sphere to plane.
 void inverseGnomonicProjection()
          Project from plane to sphere.
 void invert()
          Invert the colour at every pixel in the image.
 void magnifier(int centreX, int centreY)
          Display a new frame which presents a magnified view from the current frame, around a given pixel position.
 void meanFilter()
          Ask for neighbourhood size and replace every pixel in the image by the mean value of its neighbourhood.
 void medianFilter()
          Ask for neighbourhood size and replace every pixel in the image by the median value of its neighbourhood.
 void multiply(ImFrame imf2)
          Multiply imf2 into this image, pixel by pixel
 void nearestExtremeFilter()
          Ask for neighbourhood size and replace every pixel in the image by the nearest of the max and min of its neighbourhood.
 void neutraliseBackground()
          Automatically adjust colour balance by equating the modes of all channels.
protected  void popCaption()
          Retrieve a caption from the stack and use it on the frame.
protected  void pushCaption()
          Push the frame caption onto a stack so a temporary caption be displayed and the current one retrieved later.
 void rankFilter()
          Replace every pixel in the image by its rank in its n x n neighbourhood, where n = 2.halfWidth + 1.
 void redisplay()
          Convenience utility which rescales the image for display and repaints the ImPane and GlassPane.
 BlobMeasList replotBlobs()
           
 void rotate()
          Ask the user for an angle (in degrees), then rotate the image anticlockwise by that angle.
 void rotate(double angle)
          Rotate the image anticlockwise by the given angle (in degrees).
 void saveAs()
          Ask the user for a file path and save the current image there.
 void saveBlobMeasList()
          User selects a file into which to serialise BlobMeasList data which are then written.
 void scale()
          Ask the user for a factor, then scale the image by that factor.
 void scale(double factor, boolean interpolating)
          Scale the image by the given factor
 void setBlobMeases(BlobMeasList meases)
          To enable hovering over detected blobs, give the frame a reference to the list of blob measurements.
 void setCaption(java.lang.String s)
          Set the caption of this frame.
protected  void setFilePath(java.lang.String path)
          Set the path from which the current image was loaded or into which it has been saved.
 void showHistory()
          Show the history list of this frame in a message dialofue.
 void showInfo()
          Display information about the current image in a message dialogue.
 ImFrame[] splitChannels()
          Create 3 new images, one containing each of the channels of the original image, displaying them as new ImFrames, references to which are returned.
 ImFrame[] splitIntensity()
          Create a monochrome image in which each pixel has the value I = sum of the band levels of the current image plus a colour image in which the pixel in each band has the value maxLevel * bandLevel / I.
 void stereo(ImFrame imf2)
          Use this frame to display in red - green stereo the two images from this and imf2.
 void sub(ImFrame imf2)
          Subtract imf2 from this image, pixel by pixel, the result being about the half-way brightness level so that both negative and positive results can be seen.
 void subToZero(ImFrame imf2)
          Subtract imf2 from this image, pixel by pixel, keeping only positive results, base level 0.
 Threshold threshold()
          Display dialogue for user to set thresholds (RGB or monochrome), then threshold the image.
 void threshold(Threshold thresh)
          Threshold the image to detect pixels brighter than the given thresholds.
 void translate()
          Ask the user for x and y displacements and then translate the image accordingly.
 void varianceFilter()
          Ask for neighbourhood size and replace every pixel in the image by the variance of its neighbourhood.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

menubar

protected javax.swing.JMenuBar menubar

levelsMenu

protected LevelsMenu levelsMenu

parentFrame

protected ImFrame parentFrame
Constructor Detail

ImFrame

public ImFrame(java.lang.String title,
               int width,
               int height)
No file loading, no menu.


ImFrame

public ImFrame(java.lang.String title,
               int width,
               int height,
               boolean withMenu)
No file loading but can have menu.


ImFrame

public ImFrame(java.lang.String title,
               int width,
               int height,
               boolean withMenu,
               ImFrame parentFrame)
No file loading but can have a menu and has an associated set of blob measurements.


ImFrame

public ImFrame(java.lang.String imFilePath,
               MeasurementHandler mh)

ImFrame

public ImFrame(java.lang.String title,
               int newImageNo,
               int width,
               int height,
               MeasurementHandler mh)

ImFrame

public ImFrame(java.lang.String title,
               DrawingMode drawingMode,
               java.lang.String imFilePath,
               int newImageNo,
               int width,
               int height,
               MeasurementHandler mh)

ImFrame

public ImFrame(java.lang.String title,
               DrawingMode drawingMode,
               java.lang.String imFilePath,
               int newImageNo,
               int width,
               int height,
               MeasurementHandler mh,
               boolean withMenu)

ImFrame

public ImFrame(java.lang.String title,
               ImPane imPane)
Make a new frame from an already existing ImPane. This is mainly for creating frames containing something which implements AssociatedPane.


ImFrame

public ImFrame(java.lang.String imFilePath,
               Image image)
The file path is also used as the title.


ImFrame

public ImFrame(java.lang.String title,
               DrawingMode drawingMode,
               java.lang.String imFilePath,
               int newImageNo,
               int width,
               int height,
               MeasurementHandler mh,
               boolean withMenu,
               ImPane imPane,
               ImFrame theParentFrame,
               Image image)
The most general constructor, that all the others invoke.

Method Detail

getFilePath

public java.lang.String getFilePath()
Get the path from which the current image was loaded or into which it has been saved.


setFilePath

protected final void setFilePath(java.lang.String path)
Set the path from which the current image was loaded or into which it has been saved.


addHistory

public void addHistory(java.lang.String s)
Add a string to the history list for this frame.


showHistory

public void showHistory()
Show the history list of this frame in a message dialofue.


setBlobMeases

public void setBlobMeases(BlobMeasList meases)
To enable hovering over detected blobs, give the frame a reference to the list of blob measurements.


getBlobMeases

public BlobMeasList getBlobMeases()
If this frame has a list of detected blob measurements return the list, otherwise return null.


saveBlobMeasList

public void saveBlobMeasList()
User selects a file into which to serialise BlobMeasList data which are then written.


getParentFrame

public ImFrame getParentFrame()

getCaption

public java.lang.String getCaption()
Get the caption of this frame.


setCaption

public void setCaption(java.lang.String s)
Set the caption of this frame.


pushCaption

protected void pushCaption()
Push the frame caption onto a stack so a temporary caption be displayed and the current one retrieved later.


popCaption

protected void popCaption()
Retrieve a caption from the stack and use it on the frame.


getGP

public GlassPane getGP()
Get a reference to this frame's overlaid GlassPane.


getImPane

public ImPane getImPane()
Get a reference to this frame's ImPane display component, which is on its scroll pane.


getScrollPane

public javax.swing.JScrollPane getScrollPane()
Get a reference to this frame's scroll pane, which is on its content pane.


dispose

public void dispose()
Tidy up when the frame is closed. Remove it from the table of images, for example. Also dispose of any frames opened as children of this one (eg, magnified blobs).

Overrides:
dispose in class java.awt.Window

redisplay

public void redisplay()
Convenience utility which rescales the image for display and repaints the ImPane and GlassPane.


duplicate

public ImFrame duplicate()
Duplicate this ImFrame, making a new displayed frame. Returns a reference to the new ImFrame.


saveAs

public void saveAs()
Ask the user for a file path and save the current image there. Update frame caption and current path.


getInfo

public java.lang.StringBuffer getInfo()
Get information about the current image in a format suitable for display (lines end with "\n").


showInfo

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


getImageTimeSpan

public TimeInterval getImageTimeSpan()

magnifier

public void magnifier(int centreX,
                      int centreY)
Display a new frame which presents a magnified view from the current frame, around a given pixel position. This is called from ImPane when the drawing mode is HOVER and the user clicks the mouse. The magnified view is around the point where the mouse is released.


analyseAsSpectrum

public void analyseAsSpectrum()

detectBlobs

public BlobMeasList detectBlobs()
Returns:
BlobMeasList, sorted in descending order of brightness. Will be null if user cancels threshold dialogue. This version does not include 1-pixel blobs and never replots.

detectBlobs

public BlobMeasList detectBlobs(boolean includeSinglePixelBlobs)
Returns:
BlobMeasList, sorted in descending order of brightness. Will be null if user cancels threshold dialogue. Including 1-pixel blobs is optional but this version never replots.

detectBlobs

public BlobMeasList detectBlobs(boolean includeSinglePixelBlobs,
                                boolean replot)
Returns:
BlobMeasList, sorted in descending order of brightness. Will be null if user cancels threshold dialogue.

replotBlobs

public BlobMeasList replotBlobs()
Returns:
BlobMeasList, sorted in descending order of brightness, having replotted them.

doOpInBackground

public void doOpInBackground(OpThread.Ops op)
For particularly long operations, run them on an OpThread rather than clog up swing's event dispatch thread.


doOpInBackground

public void doOpInBackground(OpThread.Ops op,
                             int width)
For particularly long operations, run them on an OpThread rather than clog up swing's event dispatch thread.


autoCrop

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


autoStretch

public void autoStretch()
Stretch the contrast in the image so the full range of levels is used. Ask the user whether all channels are to be stretched by the same factor and offset.


blurGaussian

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


convertToMonochrome

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


convertToMonochrome

public void convertToMonochrome(double... f)
Convert the multi-channel image to monochrome, using the factors f to determine ratios of channels.


convolve

public void convolve(Kernel aKernel)
Convolve this image with the given kernel, setting the kernel as the current kernel field of this class.


correctBackground

public void correctBackground(double scale,
                              int cellWidth)
Version which is given the 2 parameters rather than reading them from config.properties file. Default values: scale = 1.0, cellWidth = 256.


correctBackground

public void correctBackground()
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 is set in the Config.


crop

public void crop(java.awt.Point pt1,
                 java.awt.Point pt2)
Crop the image by a drawn rectangle. Convenience version which simply calls crop (pt1, pt2, imf, true).


crop

public void crop(java.awt.Point pt1,
                 java.awt.Point pt2,
                 boolean promptToConfirm)
Crop the image by a drawn rectangle and adjust any BlobMeasList it may have.


deconvolve

public void deconvolve(Kernel kernel,
                       int nPasses,
                       double deconvolutionWeight)
Deconvolve the image with the given kernel by the van Cittert method.


divideByFlatField

public void divideByFlatField(ImFrame imf2)
Divide this image by flat field in imf2, pixel by pixel


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.


flipHorizontal

public void flipHorizontal()
Flip the image horizontally.


flipVertical

public void flipVertical()
Flip the image vertically.


gnomonicProjection

public void gnomonicProjection()
Project from sphere to plane.


inverseGnomonicProjection

public void inverseGnomonicProjection()
Project from plane to sphere.


invert

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


meanFilter

public void meanFilter()
Ask for neighbourhood size and replace every pixel in the image by the mean value of its neighbourhood.


medianFilter

public void medianFilter()
Ask for neighbourhood size and replace every pixel in the image by the median value of its neighbourhood.


multiply

public void multiply(ImFrame imf2)
Multiply imf2 into this image, pixel by pixel


nearestExtremeFilter

public void nearestExtremeFilter()
Ask for neighbourhood size and replace every pixel in the image by the nearest of the max and min of its neighbourhood.


neutraliseBackground

public void neutraliseBackground()
Automatically adjust colour balance by equating the modes of all channels. Done by scaling levels so that channels with higher modal values go down to the same as the one with the lowest mode. The maximum level in each channel is unchanged so the colours of bright objects are unchanged. Intended for night sky images, to make the sky background colourless (grey). Any pixels that would scale to below zero are clipped at zero.


rankFilter

public void rankFilter()
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.


rotate

public void rotate()
Ask the user for an angle (in degrees), then rotate the image anticlockwise by that angle.


rotate

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


scale

public void scale()
Ask the user for a factor, then scale the image by that factor.


scale

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


splitChannels

public ImFrame[] splitChannels()
Create 3 new images, one containing each of the channels of the original image, displaying them as new ImFrames, references to which are returned.


splitIntensity

public ImFrame[] splitIntensity()
Create a monochrome image in which each pixel has the value I = sum of the band levels of the current image plus a colour image in which the pixel in each band has the value maxLevel * bandLevel / I. A 2-element array of the 2 frames is returned, or null if the images could not both be created.. This operation enables GRIP to implement the colour preservation scheme described at http://www.allthesky.com/articles/colorpreserve.html


stereo

public void stereo(ImFrame imf2)
Use this frame to display in red - green stereo the two images from this and imf2. Both images must have the same size and number of channels and they must be monochrome.


sub

public void sub(ImFrame imf2)
Subtract imf2 from this image, pixel by pixel, the result being about the half-way brightness level so that both negative and positive results can be seen.


subToZero

public void subToZero(ImFrame imf2)
Subtract imf2 from this image, pixel by pixel, keeping only positive results, base level 0.


threshold

public Threshold threshold()
Display dialogue for user to set thresholds (RGB or monochrome), then threshold the image.


threshold

public void threshold(Threshold thresh)
Threshold the image to detect pixels brighter than the given thresholds. The image may have any number of bands.


translate

public void translate()
Ask the user for x and y displacements and then translate the image accordingly. Shifting an image by a very small amount and then subtracting it from itself (eg, as previously cloned from the image menu) is a way of detecting edges in the direction of the offset.


varianceFilter

public void varianceFilter()
Ask for neighbourhood size and replace every pixel in the image by the variance of its neighbourhood.