Class SingleImagePanel
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,MouseWheelListener,ImageObserver,MenuContainer,Serializable,EventListener
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);
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<SuperimposedImage.AppliedToUnderlyingImage>protected double[]This value is outside mouseMoved() only so that it doesn't need to be constantly reallocated - it is not used by any other methodprotected GeometryOfVolumeprotected SingleImagePanel.LeftMouseModeprotected com.pixelmed.display.OrientationAnnotationsprotected Colorprotected Fontprotected DisplayedAreaSelectionprotected Vector<com.pixelmed.display.TextAnnotation>protected doubleprotected booleanprotected booleanprotected booleanprotected booleanprotected Colorprotected Fontprotected Stringprotected intprotected Vector<SuperimposedImage>protected Stringprotected booleanwhether or not to use the supplied VOI LUT, rather than a linear or sigmoid window functionprotected intthe currently selected VOI LUT bits per entryprotected short[]the currently selected VOI LUT Dataprotected intthe currently selected VOI LUT maximum entry valueprotected intthe currently selected VOI LUT minimum entry valueprotected intthe currently selected VOI LUT first value mappedprotected doublethe currently selected VOI LUT window center value that will result in the application of the VOI LUT rescaling the input (index) valuesprotected doublethe currently selected VOI LUT window width value that will result in the application of the VOI LUT rescaling the input (index) valuesprotected intthe currently selected VOI LUT number of entriesprotected intthe currently selected VOI LUT top of entry range (which may be less than (2^voiLUTNumberOfEntries)-1, e.g., in buggy Agfa images)protected doublethe currently selected, default or user modified window centerprotected doublethe currently selected, default or user modified window widthFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionSingleImagePanel(SourceImage sImg) SingleImagePanel(SourceImage sImg, EventContext typeOfPanelEventContext) SingleImagePanel(SourceImage sImg, EventContext typeOfPanelEventContext, int[] sortOrder, Vector preDefinedShapes, Vector preDefinedText, GeometryOfVolume imageGeometry) SingleImagePanel(SourceImage sImg, EventContext typeOfPanelEventContext, GeometryOfVolume imageGeometry) -
Method Summary
Modifier and TypeMethodDescriptionstatic final BufferedImageapplyVOILUT(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 final BufferedImageapplyWindowCenterAndWidthLinear(BufferedImage src, double center, double width, boolean signed, boolean inverted, double useSlope, double useIntercept, boolean hasPad, int pad, int padRangeLimit) static final BufferedImageapplyWindowCenterAndWidthLinear(BufferedImage src, double center, double width, boolean signed, boolean inverted, double useSlope, double useIntercept, boolean hasPad, int pad, int padRangeLimit, boolean useExactCalculationInsteadOfDICOMStandardMethod) static final BufferedImageapplyWindowCenterAndWidthLinearToColorImage(BufferedImage src, double center, double width) static final BufferedImageapplyWindowCenterAndWidthLogistic(BufferedImage src, double center, double width, boolean signed, boolean inverted, double useSlope, double useIntercept, boolean hasPad, int pad, int padRangeLimit) static final BufferedImageapplyWindowCenterAndWidthWithPaletteColor(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) voidstatic voidvoiddirty()voiddirty(SourceImage sImg) voidvoidvoiddirtySource(SourceImage sImg) voidvoidvoiddisplaySelectedMagnificationRatio(double ratio) protected voidprotected voidprotected voidfinalize()protected Point2DgetImageCoordinateFromWindowCoordinate(double xw, double yw) Get location on source image from window relative location.Get the geometry of the frames currently loaded in the single image panel.final VectorGet the unselected region shapes to to be displayed on the currently selected and displayed frame.final VectorGet the selected region shapes to to be displayed on the currently selected and displayed frame.protected intprotected intfinal Vector<SuperimposedImage>Get the superimposed images to to be displayed on the appropriate frames.voidvoidvoidstatic voidvoidvoidvoidvoidvoidvoidvoidvoidvoidfinal voidsetApplyShutter(boolean applyShutter) Set whether or not to apply shutter.final voidsetDemographicAndTechniqueAnnotations(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.final voidsetDisplayedAreaSelection(DisplayedAreaSelection displayedAreaSelection) Select the sub-region of the image to display.final voidsetLocalizerShapes(Vector shapes) Set the shapes of any localizer postings to be displayed on the currently selected and displayed frame.final voidsetOrientationAnnotations(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.final voidsetOrientationAnnotations(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.final voidsetPerFrameDrawingShapes(Vector<Shape>[] arrayOfShapes) Set the array of per-frame shapes to be displayed on the respective frame when it is selected and displayed.final voidsetPersistentDrawingShapes(Vector shapes) Set the unselected region shapes to to be displayed on the currently selected and displayed frame.final voidsetPixelSpacingInSourceImage(double pixelSpacingInSourceImage) Set pixel spacing in source image.final voidsetPixelSpacingInSourceImage(double pixelSpacingInSourceImage, String typeOfPixelSpacing) Set pixel spacing in source image.final voidsetPreDefinedShapes(Vector shapes) Set the predefined shapes to to be displayed on the currently selected and displayed frame.final voidSelect the AffineTransform to apply to image-relative coordinates.final voidsetSelectedDrawingShapes(Vector shapes) Set the selected region shapes to to be displayed on the currently selected and displayed frame.final voidsetShowOverlays(boolean showOverlays) Set whether or not to show graphics such as overlays.final voidsetShowSuperimposedImages(boolean showSuperimposedImages) Set whether or not to show superimposed images.final voidsetShowZoomFactor(boolean showZoomFactor, boolean leftSide, double pixelSpacingInSourceImage) Select whether or not to annotate displayed image with zoom factor.final voidsetShowZoomFactor(boolean showZoomFactor, boolean leftSide, double pixelSpacingInSourceImage, String typeOfPixelSpacing) Select whether or not to annotate displayed image with zoom factor.final voidsetSideAndViewAnnotationString(String annotationString, int verticalOffset, String annotationFontName, int annotationFontStyle, int annotationFontSize, Color annotationColor, boolean leftSide) Set side and view annotation string.final voidsetSuperimposedImages(Vector<SuperimposedImage> superimposedImages) Set the superimposed images to to be displayed on the appropriate frames.final voidSet the VOI function to the (default) window center/width linear transformation.final voidSet the VOI function to a non-linear transformation using a logistic (sigmoid) curve with window center and width as parameters.final voidsetVolumeLocalizationShapes(Vector shapes) Set the shapes of any volume localization postings to be displayed on the currently selected and displayed frame.final voidsetWindowingAccelerationValue(double value) Set the windowing acceleration value to use.final voidSet the VOI linear function to use the DICOM offset window center/width linear transformation when applying to rescaled pixels.final voidSet the VOI linear function to use the exact window center/width linear transformation when applying to rescaled pixels.voidupdateStatusBarValues(int x, int y) Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, paintComponents, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, list, list, list, paintAll, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
activeSuperimposedImagesAppliedToUnderlyingImage
protected Set<SuperimposedImage.AppliedToUnderlyingImage> activeSuperimposedImagesAppliedToUnderlyingImage -
useVOILUTNotFunction
protected boolean useVOILUTNotFunctionwhether or not to use the supplied VOI LUT, rather than a linear or sigmoid window function -
windowCenter
protected double windowCenterthe currently selected, default or user modified window center -
windowWidth
protected double windowWidththe currently selected, default or user modified window width -
voiLUTIdentityWindowWidth
protected double voiLUTIdentityWindowWidththe currently selected VOI LUT window width value that will result in the application of the VOI LUT rescaling the input (index) values -
voiLUTIdentityWindowCenter
protected double voiLUTIdentityWindowCenterthe currently selected VOI LUT window center value that will result in the application of the VOI LUT rescaling the input (index) values -
voiLUTNumberOfEntries
protected int voiLUTNumberOfEntriesthe currently selected VOI LUT number of entries -
voiLUTFirstValueMapped
protected int voiLUTFirstValueMappedthe currently selected VOI LUT first value mapped -
voiLUTBitsPerEntry
protected int voiLUTBitsPerEntrythe currently selected VOI LUT bits per entry -
voiLUTData
protected short[] voiLUTDatathe currently selected VOI LUT Data -
voiLUTEntryMin
protected int voiLUTEntryMinthe currently selected VOI LUT minimum entry value -
voiLUTEntryMax
protected int voiLUTEntryMaxthe currently selected VOI LUT maximum entry value -
voiLUTTopOfEntryRange
protected int voiLUTTopOfEntryRangethe currently selected VOI LUT top of entry range (which may be less than (2^voiLUTNumberOfEntries)-1, e.g., in buggy Agfa images) -
imageGeometry
-
preDefinedShapes
-
preDefinedText
-
localizerShapes
-
volumeLocalizationShapes
-
interactiveDrawingShapes
-
persistentDrawingShapes
-
selectedDrawingShapes
-
persistentDrawingText
-
perFrameDrawingShapes
-
superimposedImages
-
orientationAnnotations
protected com.pixelmed.display.OrientationAnnotations orientationAnnotations -
orientationColor
-
orientationFont
-
showOrientationsLeftSide
protected boolean showOrientationsLeftSide -
sideAndViewAnnotationString
-
sideAndViewAnnotationVerticalOffset
protected int sideAndViewAnnotationVerticalOffset -
sideAndViewAnnotationColor
-
sideAndViewAnnotationFont
-
showSideAndViewAnnotationLeftSide
protected boolean showSideAndViewAnnotationLeftSide -
originalDisplayedAreaSelection
-
showZoomFactor
protected boolean showZoomFactor -
showZoomFactorLeftSide
protected boolean showZoomFactorLeftSide -
pixelSpacingInSourceImage
protected double pixelSpacingInSourceImage -
typeOfPixelSpacing
-
leftMouseMode
-
currentLocationIn3DSpace
protected double[] currentLocationIn3DSpaceThis value is outside mouseMoved() only so that it doesn't need to be constantly reallocated - it is not used by any other method
-
-
Constructor Details
-
SingleImagePanel
public SingleImagePanel(SourceImage sImg, EventContext typeOfPanelEventContext, int[] sortOrder, Vector preDefinedShapes, Vector preDefinedText, GeometryOfVolume imageGeometry) - Parameters:
sImg-typeOfPanelEventContext-sortOrder-preDefinedShapes-preDefinedText-imageGeometry-
-
SingleImagePanel
public SingleImagePanel(SourceImage sImg, EventContext typeOfPanelEventContext, GeometryOfVolume imageGeometry) - Parameters:
sImg-typeOfPanelEventContext-imageGeometry-
-
SingleImagePanel
- Parameters:
sImg-typeOfPanelEventContext-
-
SingleImagePanel
- Parameters:
sImg-
-
-
Method Details
-
dirty
public void dirty() -
dirtySource
public void dirtySource() -
dirty
-
dirtySource
-
dirtyWindowing
public void dirtyWindowing() -
dirtyPanned
public void dirtyPanned() -
getImageGeometry
Get the geometry of the frames currently loaded in the single image panel.
- Returns:
- the geometry of the frames
-
setPreDefinedShapes
Set the predefined shapes to to be displayed on the currently selected and displayed frame.
- Parameters:
shapes- ajava.util.Vectorofjava.awt.Shape, may be null or empty
-
setLocalizerShapes
Set the shapes of any localizer postings to be displayed on the currently selected and displayed frame.
- Parameters:
shapes- ajava.util.Vectorofjava.awt.Shape, may be null or empty
-
setVolumeLocalizationShapes
Set the shapes of any volume localization postings to be displayed on the currently selected and displayed frame.
- Parameters:
shapes- ajava.util.Vectorofjava.awt.Shape, may be null or empty
-
setPersistentDrawingShapes
Set the unselected region shapes to to be displayed on the currently selected and displayed frame.
- Parameters:
shapes- ajava.util.Vectorofjava.awt.Shape, may be null or empty
-
getPersistentDrawingShapes
Get the unselected region shapes to to be displayed on the currently selected and displayed frame.
- Returns:
- a
java.util.Vectorofjava.awt.Shape, may be null or empty
-
setSelectedDrawingShapes
Set the selected region shapes to to be displayed on the currently selected and displayed frame.
- Parameters:
shapes- ajava.util.Vectorofjava.awt.Shape, may be null or empty
-
getSelectedDrawingShapes
Get the selected region shapes to to be displayed on the currently selected and displayed frame.
- Returns:
- a
java.util.Vectorofjava.awt.Shape, may be null or empty
-
setPerFrameDrawingShapes
Set the array of per-frame shapes to be displayed on the respective frame when it is selected and displayed.
- Parameters:
arrayOfShapes- an array ofjava.util.Vectorofjava.awt.Shape
-
setSuperimposedImages
Set the superimposed images to to be displayed on the appropriate frames.
- Parameters:
superimposedImages- ajava.util.Vectorofcom.pixelmed.display.SuperimposedImage, may be null or empty
-
getSuperimposedImages
Get the superimposed images to to be displayed on the appropriate frames.
- Returns:
- a
java.util.Vectorofcom.pixelmed.display.SuperimposedImage, may be null or empty
-
setDemographicAndTechniqueAnnotations
public final 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.
- Parameters:
demographicAndTechniqueAnnotations- the set of annotations, indexed per framedemographicAndTechniqueFontName- the name of the font, e.g. "SansSerif"demographicAndTechniqueFontStyle- the style of the font, e.g. Font.PLAINdemographicAndTechniqueFontSize- the size of the font in points, e.g. 10demographicAndTechniqueColor- the color to draw, e.g. Color.pink
-
setOrientationAnnotations
public final 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.
- Parameters:
orientationAnnotations- the set of orientations, indexed per frameorientationFontName- the name of the font, e.g. "SansSerif"orientationFontStyle- the style of the font, e.g. Font.PLAINorientationFontSize- the size of the font in points, e.g. 20orientationColor- the color to draw, e.g. Color.pink
-
setOrientationAnnotations
public final 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.
- Parameters:
orientationAnnotations- the set of orientations, indexed per frameorientationFontName- the name of the font, e.g. "SansSerif"orientationFontStyle- the style of the font, e.g. Font.PLAINorientationFontSize- the size of the font in points, e.g. 20orientationColor- the color to draw, e.g. Color.pinkleftSide- show row orientation on left (true) or right (false) side of view port
-
setSideAndViewAnnotationString
public final void setSideAndViewAnnotationString(String annotationString, int verticalOffset, String annotationFontName, int annotationFontStyle, int annotationFontSize, Color annotationColor, boolean leftSide) Set side and view annotation string.
- Parameters:
annotationString- additional side (image laterality) and view (e.g., mammo CC) string to show on same sideverticalOffset-annotationFontName- the name of the font, e.g. "SansSerif"annotationFontStyle- the style of the font, e.g. Font.PLAINannotationFontSize- the size of the font in points, e.g. 20annotationColor- the color to draw, e.g. Color.pinkleftSide- show row orientation on left (true) or right (false) side of view port
-
setDisplayedAreaSelection
Select the sub-region of the image to display.
- Parameters:
displayedAreaSelection- the selection, or null to reset to using the entire image
-
displayReset
public void displayReset() -
displaySelectedMagnificationRatio
public void displaySelectedMagnificationRatio(double ratio) -
setPreTransformImageRelativeCoordinates
Select the AffineTransform to apply to image-relative coordinates.
Used in cases where the supplied image has already been flipped or rotated but the coordinates relative to the original image have not.
- Parameters:
transform- the transform, or null to reset to no transform
-
setShowZoomFactor
public final void setShowZoomFactor(boolean showZoomFactor, boolean leftSide, double pixelSpacingInSourceImage) Select whether or not to annotate displayed image with zoom factor.
Uses same font parameters as set for orientation annotations.
Also implicitly effects setPixelSpacingInSourceImage().
- Parameters:
showZoomFactor- true or false to activate annotation of zoom factorleftSide- show zoom factor on left (true) or right (false) side of view portpixelSpacingInSourceImage- a single value that is the (square) row and column pixel spacing, or 0 if not known
-
setShowZoomFactor
public final void setShowZoomFactor(boolean showZoomFactor, boolean leftSide, double pixelSpacingInSourceImage, String typeOfPixelSpacing) Select whether or not to annotate displayed image with zoom factor.
Uses same font parameters as set for orientation annotations.
Also implicitly effects setPixelSpacingInSourceImage().
- Parameters:
showZoomFactor- true or false to activate annotation of zoom factorleftSide- show zoom factor on left (true) or right (false) side of view portpixelSpacingInSourceImage- a single value that is the (square) row and column pixel spacing, or 0 if not knowntypeOfPixelSpacing- a String that describes the type of pixel spacing (e.g., detector plane, calibrated, accounting for geometric magnification, etc.), or null if not to be described when making measurements
-
setPixelSpacingInSourceImage
public final void setPixelSpacingInSourceImage(double pixelSpacingInSourceImage) Set pixel spacing in source image.
Used for displaying zoom factor and making measurements, therefore should be appropriate choice of Pixel Spacing or Imager Pixel Spacing (appropriately corrected for radiographic magnification factor, if any), etc.
- Parameters:
pixelSpacingInSourceImage- a single value that is the (square) row and column pixel spacing, or 0 if not known
-
setPixelSpacingInSourceImage
public final void setPixelSpacingInSourceImage(double pixelSpacingInSourceImage, String typeOfPixelSpacing) Set pixel spacing in source image.
Used for displaying zoom factor and making measurements, therefore should be appropriate choice of Pixel Spacing or Imager Pixel Spacing (appropriately corrected for radiographic magnification factor, if any), etc.
- Parameters:
pixelSpacingInSourceImage- a single value that is the (square) row and column pixel spacing, or 0 if not knowntypeOfPixelSpacing- a String that describes the type of pixel spacing (e.g., detector plane, calibrated, accounting for geometric magnification, etc.), or null if not to be described when making measurements
-
setVOIFunctionToLinear
public final void setVOIFunctionToLinear()Set the VOI function to the (default) window center/width linear transformation.
-
setVOIFunctionToLogistic
public final void setVOIFunctionToLogistic()Set the VOI function to a non-linear transformation using a logistic (sigmoid) curve with window center and width as parameters.
-
setWindowLinearCalculationToExact
public final void setWindowLinearCalculationToExact()Set the VOI linear function to use the exact window center/width linear transformation when applying to rescaled pixels.
-
setWindowLinearCalculationToDicom
public final void setWindowLinearCalculationToDicom()Set the VOI linear function to use the DICOM offset window center/width linear transformation when applying to rescaled pixels.
The DICOM offset subtracts 0.5 from the window center and subtracts 1.0 from the window width before applying to rescaled pixels.
-
setWindowingAccelerationValue
public final void setWindowingAccelerationValue(double value) Set the windowing acceleration value to use.
-
setShowOverlays
public final void setShowOverlays(boolean showOverlays) Set whether or not to show graphics such as overlays.
-
setApplyShutter
public final void setApplyShutter(boolean applyShutter) Set whether or not to apply shutter.
-
setShowSuperimposedImages
public final void setShowSuperimposedImages(boolean showSuperimposedImages) Set whether or not to show superimposed images.
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e-
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
e-
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener- Parameters:
e-
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener- Parameters:
e-
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e-
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e-
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e-
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e-
-
getSourceImageHeight
protected int getSourceImageHeight() -
getSourceImageWidth
protected int getSourceImageWidth() -
getImageCoordinateFromWindowCoordinate
Get location on source image from window relative location.- Parameters:
xw- x coordinate in AWT window as returned by MouseEvent.getX()yw- y coordinate in AWT window as returned by MouseEvent.getY()- Returns:
- source image-relative coordinates with sub-pixel resolution clamped to image size but including BLHC of BLHC pixel (per DICOM PS 3.3 Figure C.10.5-1)
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
e-
-
updateStatusBarValues
public void updateStatusBarValues(int x, int y) - Parameters:
x-y-
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e-
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e-
-
applyVOILUT
public static final 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) - Parameters:
src-center-width-identityCenter-identityWidth-signed-inverted-useSlope-useIntercept-hasPad-pad-padRangeLimit-numberOfEntries-bitsPerEntry-grayTable-entryMin-entryMax-topOfEntryRange-
-
applyWindowCenterAndWidthLogistic
public static final BufferedImage applyWindowCenterAndWidthLogistic(BufferedImage src, double center, double width, boolean signed, boolean inverted, double useSlope, double useIntercept, boolean hasPad, int pad, int padRangeLimit) - Parameters:
src-center-width-signed-inverted-useSlope-useIntercept-hasPad-pad-padRangeLimit-
-
applyWindowCenterAndWidthLinear
public static final BufferedImage applyWindowCenterAndWidthLinear(BufferedImage src, double center, double width, boolean signed, boolean inverted, double useSlope, double useIntercept, boolean hasPad, int pad, int padRangeLimit) - Parameters:
src-center-width-signed-inverted-useSlope-useIntercept-hasPad-pad-padRangeLimit-
-
applyWindowCenterAndWidthLinear
public static final BufferedImage applyWindowCenterAndWidthLinear(BufferedImage src, double center, double width, boolean signed, boolean inverted, double useSlope, double useIntercept, boolean hasPad, int pad, int padRangeLimit, boolean useExactCalculationInsteadOfDICOMStandardMethod) - Parameters:
src-center-width-signed-inverted-useSlope-useIntercept-hasPad-pad-padRangeLimit-useExactCalculationInsteadOfDICOMStandardMethod-
-
applyWindowCenterAndWidthWithPaletteColor
public static final 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) - Parameters:
src-center-width-signed-inverted-useSlope-useIntercept-hasPad-pad-padRangeLimit-largestGray-bitsPerEntry-numberOfEntries-redTable-greenTable-blueTable-
-
applyWindowCenterAndWidthLinearToColorImage
public static final BufferedImage applyWindowCenterAndWidthLinearToColorImage(BufferedImage src, double center, double width) - Parameters:
src-center-width-
-
establishStatisticalWindow
protected void establishStatisticalWindow() -
establishInitialWindowOrVOILUT
protected void establishInitialWindowOrVOILUT() -
deconstruct
public void deconstruct() -
deconstructAllSingleImagePanelsInContainer
-
finalize
- Throws:
Throwable
-
paintComponent
- Overrides:
paintComponentin classJComponent- Parameters:
g-
-
main
- Parameters:
arg-
-