com.pentec.adapt
Class AImage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.pentec.adapt.APanel
                      extended by com.pentec.adapt.AImage
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class AImage
extends APanel

AImage extends APanel and provides the base class for all images viewed by ADAPT.

Author:
Pender Technology
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 java.lang.String $ColorSpace
           
 java.lang.String $Profile
           
private  double[][] aadBandCombineMatrix
           
 javax.media.jai.PlanarImage backgroundImage
          Images for file type background and scale factor calculations
 Colorizer colorizer
          Colorizer for image panels
private  double dImageMax
          Image extrema
private  double dImageMin
          Image extrema
private  int interpolationType
          The type of interpolation method to use
private  javax.media.jai.Interpolation interpolator
          The interpolation methods are in this class
private  java.awt.image.WritableRaster originalRaster
          A copy of the raster as originally loaded from disk
private  java.awt.RenderingHints rh
          Use border copy for all JAI operations that need border extension
private  java.awt.image.Raster scaledRaster
          A copy of the image raster scaled to the current window size; this raster contains only the currently active bands, which is just 1 band (except for 3 in the case of RGB images in band combined mode)
 javax.media.jai.PlanarImage sclFacImage
           
private  javax.media.jai.TiledImage sourceImage
          The JAI version of the image contained in this panel
private  javax.media.jai.RenderedOp transposeOp
           
private  java.awt.image.Raster transposeRaster
          The raster contained in the source image, but after it has been transposed
private  javax.media.jai.operator.TransposeType transposeType
           
 
Fields inherited from class com.pentec.adapt.APanel
axes, color_Grid, color_Markers, color_Overlay, color_Plot, color_Trace1, color_Trace2, color_Trace3, dataFrame, dDataXMax, dDataXMin, dDataYMax, dDataYMin, dXScale, dYScale, iLRX, iLRY, imageBuffer, iScanNumber, isIntegrationEnabled, iULX, iULY, panelBounds, zl
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AImage(DataFrame ownerFrame)
           
 
Method Summary
protected  boolean apaint(java.awt.Graphics2D g)
          This is called by the apanel paint method to paint the image contents
 void centerMax()
          Center the image about its maximum pixel
 void centerMin()
          Center the image about its minimum pixel
static javax.media.jai.Interpolation createInterpolator(int interpolationType)
           
private  boolean doInterpolatedGrid()
           
 void editOriginal()
          Edit--Original
 void findMinima(java.lang.String $)
           
 double[][] getBandCombineMatrix()
           
 java.lang.String getColorSpace()
           
 javax.media.jai.RenderedOp getCorrectedImage()
           
 java.awt.Color getCursorColor(int ix, int iy)
          Return the color (from the current color palette) of the pixel at the specified coordinates
 java.lang.String[] getCursorInfo$(double dx, double dy)
          Load the value of the pixel at the current mouse cursor location into strings for status bar updates
 java.lang.String getCursorInfo$(int ix, int iy, boolean flagHex)
          Return the pixel value for coordinates into the actual image raster
 double[] getIntegral()
          Integrate all pixels in the current ROI and return the result as a double
 int getInterpolationType()
           
 double[] getMean(javax.media.jai.ROI roi)
           
 java.lang.Number[] getMedian(javax.media.jai.ROI roi)
           
 double[][] getMinMax(javax.media.jai.ROI roi)
          Find the max and min for a given ROI
 double[][] getMinMaxIn()
          Find the max and min in the current ROI
 double[][] getMinMaxOut()
          Find the max and min outside of the current ROI
 java.lang.Number[] getPerimeterMean(AOI aoi)
          Get the perimeter mean about a given AOI
 java.lang.String getProfile()
           
 double[] getRGBOffset()
           
 double[] getRGBScale()
           
 double getSampleDouble(int ix, int iy, int ib)
           
 int getSampleInt(int ix, int iy, int ib)
           
 javax.media.jai.TiledImage getSourceImage()
           
 javax.media.jai.operator.TransposeType getTransposeType()
           
protected  void init(DataFrame ownerFrame)
          This method will be called by the super constructor when the owner frame handle is available
 void integrate()
          Integrate all pixels in the current ROI and update the status bar
 boolean isBandCombine()
           
 void loadTransposeRaster()
           
protected  void menuFixer(AMenuBar menuBar)
          Disables or removes menu items that are not implemented for images
 void resetInterpolator()
           
 void reSync()
          The new image max and min are found, and (unless the scale is locked) the color scale is respanned.
 void scaleData()
          Create a new color scale using the existing scale min and max.
 void scaleData(double dMin, double dMax)
          Create a new color scale using a specified scale min and max.
 void setAxes()
          Set axes parameters to default values
 void setAxesNormal()
           
 void setAxesSwapped()
           
 void setBandCombineMatrix(double[][] aad)
           
 void setColors()
           
 void setColors(boolean flag)
          Create a default color scale for this image
 void setInterpolationType(int iType)
           
 void setInterpolator(javax.media.jai.Interpolation interpolator)
           
 void setRGBOffset(double[] ad)
           
 void setRGBScale(double[] ad)
           
 void setSourceData(java.awt.image.DataBuffer dataBuffer)
           
 void setSourceData(java.awt.image.DataBuffer dataBuffer, java.awt.image.ComponentSampleModel sampleModel)
           
 void setSourceData(javax.media.jai.PlanarImage imageIn)
           
 void setTransposedImage()
           
 void setTransposeType(javax.media.jai.operator.TransposeType tt)
           
 java.nio.channels.FileChannel write(boolean isNative, java.lang.String $Format)
          Create a file and write out the header and the data.
 java.nio.channels.FileChannel write(boolean isNative, java.lang.String $Format, boolean doShift)
          Create a file and write out the header and the data.
 void write(java.nio.channels.FileChannel channel, boolean doShift)
          Write the native raster data out to an existing file.
 
Methods inherited from class com.pentec.adapt.APanel
addPopupMenu, autoscaleInsideExtr, autoscaleInsideZero, autoscaleOutsideExtr, autoscaleOutsideZero, boundX, boundY, centerAbout, centerMouseCursor, clearOverlay, convertBox, drawBorder, getAoi, getMouseX, getMouseY, getScaledX, getScaledY, getSize, getXScale, getXYAdjust, getYScale, menuFixer, paint, scaleX, scaleY, scrollX, scrollY, setActive, setBounds, setIntegrationEnabled, setOverlay, setSize, setTraceColor, setXRange, setXYRange, setXYRange, setYRange, toString, update, zoom
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

$ColorSpace

public java.lang.String $ColorSpace

$Profile

public java.lang.String $Profile

aadBandCombineMatrix

private double[][] aadBandCombineMatrix

backgroundImage

public javax.media.jai.PlanarImage backgroundImage
Images for file type background and scale factor calculations


colorizer

public Colorizer colorizer
Colorizer for image panels


dImageMax

private double dImageMax
Image extrema


dImageMin

private double dImageMin
Image extrema


interpolationType

private int interpolationType
The type of interpolation method to use


interpolator

private javax.media.jai.Interpolation interpolator
The interpolation methods are in this class


originalRaster

private java.awt.image.WritableRaster originalRaster
A copy of the raster as originally loaded from disk


rh

private java.awt.RenderingHints rh
Use border copy for all JAI operations that need border extension


scaledRaster

private java.awt.image.Raster scaledRaster
A copy of the image raster scaled to the current window size; this raster contains only the currently active bands, which is just 1 band (except for 3 in the case of RGB images in band combined mode)


sclFacImage

public javax.media.jai.PlanarImage sclFacImage

sourceImage

private javax.media.jai.TiledImage sourceImage
The JAI version of the image contained in this panel


transposeOp

private javax.media.jai.RenderedOp transposeOp

transposeRaster

private java.awt.image.Raster transposeRaster
The raster contained in the source image, but after it has been transposed


transposeType

private javax.media.jai.operator.TransposeType transposeType
Constructor Detail

AImage

public AImage(DataFrame ownerFrame)
Method Detail

apaint

protected boolean apaint(java.awt.Graphics2D g)
This is called by the apanel paint method to paint the image contents

Specified by:
apaint in class APanel
Parameters:
g - a handle to the graphics buffer to paint to
Returns:
true if successful, false if not

centerMax

public void centerMax()
Center the image about its maximum pixel

Specified by:
centerMax in class APanel

centerMin

public void centerMin()
Center the image about its minimum pixel

Specified by:
centerMin in class APanel

createInterpolator

public static javax.media.jai.Interpolation createInterpolator(int interpolationType)

doInterpolatedGrid

private boolean doInterpolatedGrid()

editOriginal

public void editOriginal()
Edit--Original

Specified by:
editOriginal in class APanel

findMinima

public void findMinima(java.lang.String $)
Specified by:
findMinima in class APanel

getBandCombineMatrix

public double[][] getBandCombineMatrix()

getColorSpace

public java.lang.String getColorSpace()

getCorrectedImage

public javax.media.jai.RenderedOp getCorrectedImage()

getCursorColor

public java.awt.Color getCursorColor(int ix,
                                     int iy)
Return the color (from the current color palette) of the pixel at the specified coordinates


getCursorInfo$

public java.lang.String[] getCursorInfo$(double dx,
                                         double dy)
Load the value of the pixel at the current mouse cursor location into strings for status bar updates

Specified by:
getCursorInfo$ in class APanel
Parameters:
dx - the x coordinate
dy - the y coordinate
Returns:
an array of 3 strings. String 1 is the X position, string 2 is the Y position, and string 3 is the pixel value.

getCursorInfo$

public java.lang.String getCursorInfo$(int ix,
                                       int iy,
                                       boolean flagHex)
Return the pixel value for coordinates into the actual image raster


getIntegral

public double[] getIntegral()
Integrate all pixels in the current ROI and return the result as a double


getInterpolationType

public int getInterpolationType()

getMean

public double[] getMean(javax.media.jai.ROI roi)

getMedian

public java.lang.Number[] getMedian(javax.media.jai.ROI roi)

getMinMax

public double[][] getMinMax(javax.media.jai.ROI roi)
Find the max and min for a given ROI


getMinMaxIn

public double[][] getMinMaxIn()
Find the max and min in the current ROI

Specified by:
getMinMaxIn in class APanel

getMinMaxOut

public double[][] getMinMaxOut()
Find the max and min outside of the current ROI

Specified by:
getMinMaxOut in class APanel

getPerimeterMean

public java.lang.Number[] getPerimeterMean(AOI aoi)
Get the perimeter mean about a given AOI

Parameters:
aoi - AOI at which to get perimeter mean
Returns:
perimeter means for all bands

getProfile

public java.lang.String getProfile()

getRGBOffset

public double[] getRGBOffset()

getRGBScale

public double[] getRGBScale()

getSampleDouble

public double getSampleDouble(int ix,
                              int iy,
                              int ib)

getSampleInt

public int getSampleInt(int ix,
                        int iy,
                        int ib)

getSourceImage

public javax.media.jai.TiledImage getSourceImage()

getTransposeType

public javax.media.jai.operator.TransposeType getTransposeType()

init

protected void init(DataFrame ownerFrame)
This method will be called by the super constructor when the owner frame handle is available

Overrides:
init in class APanel

integrate

public void integrate()
Integrate all pixels in the current ROI and update the status bar

Specified by:
integrate in class APanel

isBandCombine

public boolean isBandCombine()

loadTransposeRaster

public void loadTransposeRaster()

menuFixer

protected void menuFixer(AMenuBar menuBar)
Disables or removes menu items that are not implemented for images

Specified by:
menuFixer in class APanel

resetInterpolator

public void resetInterpolator()

reSync

public void reSync()
The new image max and min are found, and (unless the scale is locked) the color scale is respanned.

Specified by:
reSync in class APanel

scaleData

public void scaleData()
Create a new color scale using the existing scale min and max. This method is used by the color controls dialog when the granularity is changed


scaleData

public void scaleData(double dMin,
                      double dMax)
Create a new color scale using a specified scale min and max. This method autmatically works globally since there is only one colorizer per DataFrame.

Specified by:
scaleData in class APanel
Parameters:
dMin - the minimum value for the color scale
dMax - the maximum value for the color scale

setAxes

public void setAxes()
Set axes parameters to default values


setAxesNormal

public void setAxesNormal()

setAxesSwapped

public void setAxesSwapped()

setBandCombineMatrix

public void setBandCombineMatrix(double[][] aad)

setColors

public void setColors()

setColors

public void setColors(boolean flag)
Create a default color scale for this image


setInterpolationType

public void setInterpolationType(int iType)

setInterpolator

public void setInterpolator(javax.media.jai.Interpolation interpolator)

setRGBOffset

public void setRGBOffset(double[] ad)

setRGBScale

public void setRGBScale(double[] ad)

setSourceData

public void setSourceData(java.awt.image.DataBuffer dataBuffer)
Specified by:
setSourceData in class APanel

setSourceData

public void setSourceData(java.awt.image.DataBuffer dataBuffer,
                          java.awt.image.ComponentSampleModel sampleModel)

setSourceData

public void setSourceData(javax.media.jai.PlanarImage imageIn)

setTransposedImage

public void setTransposedImage()

setTransposeType

public void setTransposeType(javax.media.jai.operator.TransposeType tt)

write

public java.nio.channels.FileChannel write(boolean isNative,
                                           java.lang.String $Format)
Create a file and write out the header and the data. All output is done with big endian byte ordering.

Specified by:
write in class APanel
Parameters:
isNative - flag indicating whether to save in native or interpolated format
$Format - the output file format

write

public java.nio.channels.FileChannel write(boolean isNative,
                                           java.lang.String $Format,
                                           boolean doShift)
Create a file and write out the header and the data. All output is done with big endian byte ordering.

Parameters:
isNative - flag indicating whether to save in native or interpolated format
$Format - the output file format
doShift - flag to indicate whether or not to perform spatial pixel registration

write

public void write(java.nio.channels.FileChannel channel,
                  boolean doShift)
Write the native raster data out to an existing file. Only SAF format with big endian byte ordering is supported.

Parameters:
channel - the output file channel
doShift - flag to indicate whether or not to perform spatial pixel registration