gov.nist.microanalysis.NISTMonte
Class EmissionImage

java.lang.Object
  extended by java.awt.Image
      extended by java.awt.image.BufferedImage
          extended by gov.nist.microanalysis.NISTMonte.EmissionImage
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.RenderedImage, java.awt.image.WritableRenderedImage, java.awt.Transparency, java.util.EventListener

public class EmissionImage
extends java.awt.image.BufferedImage
implements java.awt.event.ActionListener

Creates a bitmap image showing the generation of detected x-rays as a function of position. The thermal color scale shows white where the most x-rays are generated and black where almost no or no x-rays are generated. The left and bottom edge show accumulated transmitted phi-rho-z and phi-rho-x (projected) curves.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Field Summary
 
Fields inherited from class java.awt.image.BufferedImage
TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY
 
Fields inherited from class java.awt.Image
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
EmissionImage(int width, int height, XRayTransition xrt)
          monteCarloImage - Creates a monteCarloImage instance with the standard thermal color palette of the specified size (width and height).
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed - Implements actionPerformed for the ActionListener interface.
static EmissionImage[] addDefaultImages(XRayEventListener xrel, int dim, double dx, double dy)
          addDefaultImages - Add MCSS_Image listeners to the default transitions
 void dumpToFile(java.lang.String dest)
          dumpToFile - Dump this MCSS_TrajectoryImage to a file in the specified directory.
static void dumpToFiles(EmissionImage[] imgs, java.lang.String dest)
          dumpToFiles - Dump a list of MCSS_Image into files within the specified destination directory.
 double getMaxIntensity()
          getMaxIntensity - Get the intensity of the pixel the generates the most detected x-rays.
 XRayTransition getTransition()
          getTransition - Get the transition associated with this image.
 boolean isLogScale()
          Gets the current value assigned to logScale
 void setLogScale(boolean logScale)
          Sets the value assigned to logScale.
 void setMaxTrajectories(int max)
          setMaxTrajectories - Sets the maximum number of trajectories that will be added to the image.
 void setPixel(double x, double y, double val)
          setPixel - Sets the pixel at position (x, y) with the color corresponding to val.
 void setXRange(double min, double max)
          setXRange - Sets the range of x values that will display on the image.
 void setYRange(double min, double max)
          setYRange - Sets the range of y-values that will display on the image.
static EmissionImage[] watchDefaultTransitions(XRayEventListener xrel, int dim, double range)
          watchDefaultTransitions - Add MCSS_Image watchers to each transition being watched by the xrel
 
Methods inherited from class java.awt.image.BufferedImage
addTileObserver, coerceData, copyData, createGraphics, flush, getAlphaRaster, getCapabilities, getColorModel, getData, getData, getGraphics, getHeight, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWidth, getWidth, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB, toString
 
Methods inherited from class java.awt.Image
getAccelerationPriority, getScaledInstance, setAccelerationPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmissionImage

public EmissionImage(int width,
                     int height,
                     XRayTransition xrt)
monteCarloImage - Creates a monteCarloImage instance with the standard thermal color palette of the specified size (width and height).

Parameters:
width - int
height - int
xrt - XRayTransition
Method Detail

addDefaultImages

public static EmissionImage[] addDefaultImages(XRayEventListener xrel,
                                               int dim,
                                               double dx,
                                               double dy)
addDefaultImages - Add MCSS_Image listeners to the default transitions

Parameters:
xrel - MCSS_XRayEventListener
dim - int
dx - double
dy - double
Returns:
MCSS_Image[]

dumpToFile

public void dumpToFile(java.lang.String dest)
                throws java.io.FileNotFoundException,
                       java.io.IOException
dumpToFile - Dump this MCSS_TrajectoryImage to a file in the specified directory.

Parameters:
dest - String - The destination directory
Throws:
java.io.FileNotFoundException
java.io.IOException

dumpToFiles

public static void dumpToFiles(EmissionImage[] imgs,
                               java.lang.String dest)
                        throws java.io.FileNotFoundException,
                               java.io.IOException
dumpToFiles - Dump a list of MCSS_Image into files within the specified destination directory.

Parameters:
imgs - MCSS_Image[]
dest - String
Throws:
java.io.FileNotFoundException
java.io.IOException

watchDefaultTransitions

public static EmissionImage[] watchDefaultTransitions(XRayEventListener xrel,
                                                      int dim,
                                                      double range)
watchDefaultTransitions - Add MCSS_Image watchers to each transition being watched by the xrel

Parameters:
xrel - MCSS_XRayEventListener
dim - int - The image dimension
range - double - The size of the viewport
Returns:
MCSS_Image[] - A list of the MCSS_Image objects attached to xrel

setXRange

public void setXRange(double min,
                      double max)
setXRange - Sets the range of x values that will display on the image. min is left and max is right.

Parameters:
min - double
max - double

setYRange

public void setYRange(double min,
                      double max)
setYRange - Sets the range of y-values that will display on the image. min is top and max is bottom.

Parameters:
min - double
max - double

getMaxIntensity

public double getMaxIntensity()
getMaxIntensity - Get the intensity of the pixel the generates the most detected x-rays. Valid only after a trajectory set ends.

Returns:
double

setPixel

public void setPixel(double x,
                     double y,
                     double val)
setPixel - Sets the pixel at position (x, y) with the color corresponding to val. val is [0.0,1.0]

Parameters:
x - double
y - double
val - double - between 0.0 and 1.0 inclusive

getTransition

public XRayTransition getTransition()
getTransition - Get the transition associated with this image.

Returns:
XRayTransition

setMaxTrajectories

public void setMaxTrajectories(int max)
setMaxTrajectories - Sets the maximum number of trajectories that will be added to the image.

Parameters:
max - int

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed - Implements actionPerformed for the ActionListener interface.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent

isLogScale

public boolean isLogScale()
Gets the current value assigned to logScale

Returns:
Returns the logScale.

setLogScale

public void setLogScale(boolean logScale)
Sets the value assigned to logScale.

Parameters:
logScale - The value to which to set logScale.