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.
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
java.awt.Cursor |
IMFRAME_DEFAULT_CURSOR |
java.awt.Cursor |
IMFRAME_HAND_CURSOR |
java.awt.Cursor |
IMFRAME_WAIT_CURSOR |
protected javax.swing.JMenuBar |
menubar |
protected ImFrame |
parentFrame |
protected SegmentationMenu |
segmentationMenu |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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 |
cropPower2()
Crop the image so its width and height are the largest possible powers of
2, allowing user to drag the rectangle to a suitable position.
|
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.
|
void |
drawOverlay(boolean newImage)
Copy the shapes from the GlassPane of this frame into its image
(newImage == false) or into a new 8-bit image.
|
ImFrame |
duplicate()
Duplicate this ImFrame, making a new displayed frame.
|
void |
equaliseHistogram() |
void |
expandPower2()
Expand the image so its width and height are the next larger powers of 2,
adding a constant width black rim on all sides.
|
void |
fft()
Fast Fourier Transform; creates a pair of 64-bit images, real [0] and
imaginary [1] parts.
|
void |
fft(ImFrame otherFrame,
boolean forward)
Fast Fourier Transform; creates a pair of 64-bit images, real [0] and
imaginary [1] parts, from this and another 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.
|
Image |
getImage()
Convenience method for when the ImPane is not required.
|
TimeInterval |
getImageTimeSpan() |
ImPane |
getImPane()
Get a reference to this frame's ImPane display component, which is on its
scroll pane.
|
java.lang.String |
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 |
keepOnlyDifferingPixels(ImFrame imf2,
int threshold)
Keep only pixels in this image which differ by more than the threshold
amount (in at least one band) from pixels at the same position in the
other 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(double factor)
Multiply brightness levels by a factor, never overflowing (see
net.grelf.image.Image.multiply ().
|
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 |
rotate180()
Rotate the image by exactly 180 degrees - faster than the
more general method because it requires no pixel interpolation.
|
void |
rotate270()
Rotate the image by exactly 90 degrees clockwise - faster than the
more general method because it requires no pixel interpolation.
|
void |
rotate90()
Rotate the image by exactly 90 degrees anticlockwise - faster than the
more general method because it requires no pixel interpolation.
|
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.
|
static void |
showCameraResponseCurve(java.util.List<ImFrame> frames)
Uses the images to compute the camera response curve and display it as a
graph, as described in "On Being ‘Undigital’ With
Digital Cameras: Extending Dynamic Range By Combining Differently Exposed
Pictures" by S.
|
void |
showHistory()
Show the history list of this frame in a message dialogue.
|
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.
|
void |
swapQuadrants()
Rearrange the 4 quadrants of the image - useful for viewing Fourier
Transform results.
|
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.
|
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
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
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, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public final java.awt.Cursor IMFRAME_DEFAULT_CURSOR
public final java.awt.Cursor IMFRAME_HAND_CURSOR
public final java.awt.Cursor IMFRAME_WAIT_CURSOR
protected javax.swing.JMenuBar menubar
protected SegmentationMenu segmentationMenu
protected ImFrame parentFrame
public ImFrame(java.lang.String title, int width, int height)
public ImFrame(java.lang.String title, int width, int height, boolean withMenu)
public ImFrame(java.lang.String title, int width, int height, boolean withMenu, ImFrame parentFrame)
public ImFrame(java.lang.String imFilePath, MeasurementHandler mh)
public ImFrame(java.lang.String title, int newImageNo, int width, int height, MeasurementHandler mh)
public ImFrame(java.lang.String title, DrawingMode drawingMode, java.lang.String imFilePath, int newImageNo, int width, int height, MeasurementHandler mh)
public ImFrame(java.lang.String title, DrawingMode drawingMode, java.lang.String imFilePath, int newImageNo, int width, int height, MeasurementHandler mh, boolean withMenu)
public ImFrame(java.lang.String title, ImPane imPane)
public ImFrame(java.lang.String imFilePath, Image image)
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)
public java.lang.String getFilePath()
protected final void setFilePath(java.lang.String path)
public void addHistory(java.lang.String s)
public void showHistory()
public void setBlobMeases(BlobMeasList meases)
public BlobMeasList getBlobMeases()
public void saveBlobMeasList()
public ImFrame getParentFrame()
public java.lang.String getCaption()
public void setCaption(java.lang.String s)
protected void pushCaption()
protected void popCaption()
public GlassPane getGP()
public ImPane getImPane()
public javax.swing.JScrollPane getScrollPane()
public void dispose()
dispose
in class java.awt.Window
public void redisplay()
public ImFrame duplicate()
public void saveAs()
public java.lang.String getInfo()
public void showInfo()
public Image getImage()
public TimeInterval getImageTimeSpan()
public void keepOnlyDifferingPixels(ImFrame imf2, int threshold)
public void magnifier(int centreX, int centreY)
public void analyseAsSpectrum()
public BlobMeasList detectBlobs()
public BlobMeasList detectBlobs(boolean includeSinglePixelBlobs)
public BlobMeasList detectBlobs(boolean includeSinglePixelBlobs, boolean replot)
public BlobMeasList replotBlobs()
public void doOpInBackground(OpThread.Ops op)
public void doOpInBackground(OpThread.Ops op, int width)
public void autoCrop()
public void autoStretch()
public void blurGaussian(int nx, int ny)
public void convertToMonochrome()
public void convertToMonochrome(double... f)
public void convolve(Kernel aKernel)
public void correctBackground(double scale, int cellWidth)
public void correctBackground()
public void crop(java.awt.Point pt1, java.awt.Point pt2)
public void crop(java.awt.Point pt1, java.awt.Point pt2, boolean promptToConfirm)
public void cropPower2()
public void deconvolve(Kernel kernel, int nPasses, double deconvolutionWeight)
public void divideByFlatField(ImFrame imf2)
public void drawOverlay(boolean newImage)
public void equaliseHistogram()
public void expandPower2()
public void fft()
public void fft(ImFrame otherFrame, boolean forward)
public void fit(int width, int height)
public void flipHorizontal()
public void flipVertical()
public void gnomonicProjection()
public void inverseGnomonicProjection()
public void invert()
public void meanFilter()
public void medianFilter()
public void multiply(double factor)
public void multiply(ImFrame imf2)
public void nearestExtremeFilter()
public void neutraliseBackground()
public void rankFilter()
public void rotate()
public void rotate(double angle)
public void rotate180()
public void rotate270()
public void rotate90()
public void scale()
public void scale(double factor, boolean interpolating)
public static void showCameraResponseCurve(java.util.List<ImFrame> frames)
public ImFrame[] splitChannels()
public ImFrame[] splitIntensity()
public void stereo(ImFrame imf2)
public void sub(ImFrame imf2)
public void subToZero(ImFrame imf2)
public Threshold threshold()
public void swapQuadrants()
public void threshold(Threshold thresh)
public void translate()
public void varianceFilter()