|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.pixelmed.display.SingleImagePanel
public class SingleImagePanel
Implements a component that can display a single or multi-frame image in a single panel with window center/width adjustment, scrolling through frames of a multi-frame image, resizing to the size of the panel, annotation of pre-defined text and shapes, feedback of cursor position status (2D and 3D position, pixel value, window).
Includes a main() method for testing that will display a single image from a file in a JFrame.
About the most minimal code to display a single DICOM image looks like this:
JFrame p = new JFrame(); p.add(new SingleImagePanel(new SourceImage(filename))); p.setBackground(Color.BLACK); p.setSize(512,512); p.setVisible(true);
SourceImage,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
SingleImagePanel.LeftMouseMode
|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected double[] |
currentLocationIn3DSpace
This value is outside mouseMoved() only so that it doesn't need to be constantly reallocated - it is not used by any other method |
protected Vector |
interactiveDrawingShapes
|
protected SingleImagePanel.LeftMouseMode |
leftMouseMode
|
protected Vector |
localizerShapes
|
protected com.pixelmed.display.OrientationAnnotations |
orientationAnnotations
|
protected Color |
orientationColor
|
protected Font |
orientationFont
|
protected DisplayedAreaSelection |
originalDisplayedAreaSelection
|
protected Vector |
persistentDrawingShapes
|
protected Vector |
persistentDrawingText
|
protected double |
pixelSpacingInSourceImage
|
protected Vector |
preDefinedShapes
|
protected Vector |
preDefinedText
|
protected Vector |
selectedDrawingShapes
|
protected boolean |
showOrientationsLeftSide
|
protected boolean |
showSideAndViewAnnotationLeftSide
|
protected boolean |
showZoomFactor
|
protected boolean |
showZoomFactorLeftSide
|
protected Color |
sideAndViewAnnotationColor
|
protected Font |
sideAndViewAnnotationFont
|
protected String |
sideAndViewAnnotationString
|
protected int |
sideAndViewAnnotationVerticalOffset
|
protected boolean |
useVOILUTNotFunction
whether or not to use the supplied VOI LUT, rather than a linear or sigmoid window function |
protected int |
voiLUTBitsPerEntry
the currently selected VOI LUT bits per entry |
protected short[] |
voiLUTData
the currently selected VOI LUT Data |
protected int |
voiLUTEntryMax
the currently selected VOI LUT maximum entry value |
protected int |
voiLUTEntryMin
the currently selected VOI LUT minimum entry value |
protected int |
voiLUTFirstValueMapped
the currently selected VOI LUT first value mapped |
protected double |
voiLUTIdentityWindowCenter
the currently selected VOI LUT window center value that will result in the application of the VOI LUT rescaling the input (index) values |
protected double |
voiLUTIdentityWindowWidth
the currently selected VOI LUT window width value that will result in the application of the VOI LUT rescaling the input (index) values |
protected int |
voiLUTNumberOfEntries
the currently selected VOI LUT number of entries |
protected int |
voiLUTTopOfEntryRange
the currently selected VOI LUT top of entry range (which may be less than (2^voiLUTNumberOfEntries)-1, e.g., in buggy Agfa images) |
protected Vector |
volumeLocalizationShapes
|
protected double |
windowCenter
the currently selected, default or user modified window center |
protected double |
windowWidth
the currently selected, default or user modified window width |
| 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 | |
|---|---|
SingleImagePanel(SourceImage sImg)
|
|
SingleImagePanel(SourceImage sImg,
EventContext typeOfPanelEventContext)
|
|
SingleImagePanel(SourceImage sImg,
EventContext typeOfPanelEventContext,
GeometryOfVolume imageGeometry)
|
|
SingleImagePanel(SourceImage sImg,
EventContext typeOfPanelEventContext,
int[] sortOrder,
Vector preDefinedShapes,
Vector preDefinedText,
GeometryOfVolume imageGeometry)
|
|
| Method Summary | |
|---|---|
static BufferedImage |
applyVOILUT(BufferedImage src,
double center,
double width,
double identityCenter,
double identityWidth,
boolean signed,
boolean inverted,
double useSlope,
double useIntercept,
boolean hasPad,
int pad,
int padRangeLimit,
int numberOfEntries,
int firstValueMapped,
int bitsPerEntry,
short[] grayTable,
int entryMin,
int entryMax,
int topOfEntryRange)
|
static BufferedImage |
applyWindowCenterAndWidthLinear(BufferedImage src,
double center,
double width,
boolean signed,
boolean inverted,
double useSlope,
double useIntercept,
boolean hasPad,
int pad,
int padRangeLimit)
|
static BufferedImage |
applyWindowCenterAndWidthLogistic(BufferedImage src,
double center,
double width,
boolean signed,
boolean inverted,
double useSlope,
double useIntercept,
boolean hasPad,
int pad,
int padRangeLimit)
|
static BufferedImage |
applyWindowCenterAndWidthWithPaletteColor(BufferedImage src,
double center,
double width,
boolean signed,
boolean inverted,
double useSlope,
double useIntercept,
boolean hasPad,
int pad,
int padRangeLimit,
int largestGray,
int bitsPerEntry,
int numberOfEntries,
short[] redTable,
short[] greenTable,
short[] blueTable)
|
void |
deconstruct()
|
static void |
deconstructAllSingleImagePanelsInContainer(Container container)
|
void |
dirty()
|
void |
dirtyPanned()
|
void |
dirtySource()
|
void |
dirtyWindowing()
|
void |
displayReset()
|
void |
displaySelectedMagnificationRatio(double ratio)
|
protected void |
establishInitialWindowOrVOILUT()
|
protected void |
finalize()
|
protected Point |
getImageCoordinateFromWindowCoordinate(double xw,
double yw)
|
GeometryOfVolume |
getImageGeometry()
Get the geometry of the frames currently loaded in the single image panel. |
Vector |
getPersistentDrawingShapes()
Get the unselected region shapes to to be displayed on the currently selected and displayed frame. |
Vector |
getSelectedDrawingShapes()
Get the selected region shapes to to be displayed on the currently selected and displayed frame. |
protected int |
getSourceImageHeight()
|
protected int |
getSourceImageWidth()
|
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTyped(KeyEvent e)
|
static void |
main(String[] arg)
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
paintComponent(Graphics g)
|
void |
setDemographicAndTechniqueAnnotations(DemographicAndTechniqueAnnotations demographicAndTechniqueAnnotations,
String demographicAndTechniqueFontName,
int demographicAndTechniqueFontStyle,
int demographicAndTechniqueFontSize,
Color demographicAndTechniqueColor)
Set annotative attribute values to be displayed on the currently selected and displayed frame at defined positions. |
void |
setDisplayedAreaSelection(DisplayedAreaSelection displayedAreaSelection)
Select the sub-region of the image to display. |
void |
setLocalizerShapes(Vector shapes)
Set the shapes of any localizer postings to be displayed on the currently selected and displayed frame. |
void |
setOrientationAnnotations(com.pixelmed.display.OrientationAnnotations orientationAnnotations,
String orientationFontName,
int orientationFontStyle,
int orientationFontSize,
Color orientationColor)
Set orientation values to be displayed on the currently selected and displayed frame. |
void |
setOrientationAnnotations(com.pixelmed.display.OrientationAnnotations orientationAnnotations,
String orientationFontName,
int orientationFontStyle,
int orientationFontSize,
Color orientationColor,
boolean leftSide)
Set orientation values to be displayed on the currently selected and displayed frame. |
void |
setPersistentDrawingShapes(Vector shapes)
Set the unselected region shapes to to be displayed on the currently selected and displayed frame. |
void |
setPixelSpacingInSourceImage(double pixelSpacingInSourceImage)
Set pixel spacing in source image. |
void |
setPreDefinedShapes(Vector shapes)
Set the predefined shapes to to be displayed on the currently selected and displayed frame. |
void |
setPreTransformImageRelativeCoordinates(AffineTransform transform)
Select the AffineTransform to apply to image-relative coordinates. |
void |
setSelectedDrawingShapes(Vector shapes)
Set the selected region shapes to to be displayed on the currently selected and displayed frame. |
void |
setshowOverlays(boolean showOverlays)
Set whether or not to show graphics such as overlays. |
void |
setShowZoomFactor(boolean showZoomFactor,
boolean leftSide,
double pixelSpacingInSourceImage)
Select whether or not to annotate displayed image with zoom factor. |
void |
setSideAndViewAnnotationString(String annotationString,
int verticalOffset,
String annotationFontName,
int annotationFontStyle,
int annotationFontSize,
Color annotationColor,
boolean leftSide)
Set side and view annotation string. |
void |
setVOIFunctionToLinear()
Set the VOI function to the (default) window center/width linear transformation. |
void |
setVOIFunctionToLogistic()
Set the VOI function to a non-linear transformation using a logistic (sigmoid) curve with window center and width as parameters. |
void |
setVolumeLocalizationShapes(Vector shapes)
Set the shapes of any volume localization postings to be displayed on the currently selected and displayed frame. |