public class ImageEditUtilities
extends java.lang.Object
A class of utility methods for editing image pixel data.
Modifier and Type | Method and Description |
---|---|
static void |
blackout(SourceImage srcImg,
AttributeList list,
java.util.Vector shapes)
Blackout specified regions in an image, for example to remove burned in identification.
|
static void |
blackout(SourceImage srcImg,
AttributeList list,
java.util.Vector shapes,
boolean burnInOverlays)
Blackout specified regions in an image, for example to remove burned in identification.
|
static void |
blackout(SourceImage srcImg,
AttributeList list,
java.util.Vector shapes,
boolean burnInOverlays,
boolean usePixelPaddingValue,
boolean useSpecifiedBlackoutValue,
int specifiedBlackoutValue)
Blackout specified regions in an image, for example to remove burned in identification.
|
static int |
getOffsetIntoMatrix(int offset,
int row,
int column,
int width) |
static int |
getOffsetIntoMatrix(int fixedOffset,
int row,
int column,
int height,
int width,
int rotation,
boolean horizontal_flip) |
static void |
rotateAndFlip(SourceImage srcImg,
AttributeList list,
int rotation,
boolean horizontal_flip)
Rotate an image in 90 degree increments, optionally followed by a horizontal flip.
|
public static void blackout(SourceImage srcImg, AttributeList list, java.util.Vector shapes) throws DicomException
Blackout specified regions in an image, for example to remove burned in identification.
Overlays are not burned in.
The replacement pixel value is the smallest possible pixel value based on signedness and bit depth.
The accompanying attribute list will be updated with new Pixel Data and related Image Pixel Module attributes.
Note that original PhotometricInterpretation will be retained; care should be taken by the caller
to change this as appropriate, e.g., from YBR_FULL_422 if read as JPEG to RGB if written as uncompressed.
See, for example, AttributeList.correctDecompressedImagePixelModule()
.
srcImg
- the imagelist
- the attribute list corresponding imageshapes
- a java.util.Vector
of java.awt.Shape
, specifed in image-relative coordinatesDicomException
- if something bad happens handling the attribute listpublic static void blackout(SourceImage srcImg, AttributeList list, java.util.Vector shapes, boolean burnInOverlays) throws DicomException
Blackout specified regions in an image, for example to remove burned in identification.
Overlays may be burned in (and their corresponding attribues removed from the AttributeList).
The replacement pixel value is the smallest possible pixel value based on signedness and bit depth.
The accompanying attribute list will be updated with new Pixel Data and related Image Pixel Module attributes.
Note that original PhotometricInterpretation will be retained; care should be taken by the caller
to change this as appropriate, e.g., from YBR_FULL_422 if read as JPEG to RGB if written as uncompressed.
See, for example, AttributeList.correctDecompressedImagePixelModule()
.
srcImg
- the imagelist
- the attribute list corresponding imageshapes
- a java.util.Vector
of java.awt.Shape
, specifed in image-relative coordinatesburnInOverlays
- whether or not to burn in overlaysDicomException
- if something bad happens handling the attribute listpublic static void blackout(SourceImage srcImg, AttributeList list, java.util.Vector shapes, boolean burnInOverlays, boolean usePixelPaddingValue, boolean useSpecifiedBlackoutValue, int specifiedBlackoutValue) throws DicomException
Blackout specified regions in an image, for example to remove burned in identification.
Overlays may be burned in (and their corresponding attribues removed from the AttributeList).
The replacement pixel value may be constrained to a specific value (typically zero), rather than the using the pixel padding value, if present, or the default, which is the smallest possible pixel value based on signedness and bit depth.
The accompanying attribute list will be updated with new Pixel Data and related Image Pixel Module attributes.
Note that original PhotometricInterpretation will be retained; care should be taken by the caller
to change this as appropriate, e.g., from YBR_FULL_422 if read as JPEG to RGB if written as uncompressed.
See, for example, AttributeList.correctDecompressedImagePixelModule()
.
srcImg
- the imagelist
- the attribute list corresponding imageshapes
- a java.util.Vector
of java.awt.Shape
, specifed in image-relative coordinatesburnInOverlays
- whether or not to burn in overlaysusePixelPaddingValue
- whether or not to use any pixel paddding valueuseSpecifiedBlackoutValue
- whether or not to use the specifiedBlackoutValue or the default based on signedness and bit depth (overrides usePixelPaddingValue)specifiedBlackoutValue
- the value used to replace blacked out pixel values, only used if useSpecifiedBlackoutValue is trueDicomException
- if something bad happens handling the attribute listpublic static final int getOffsetIntoMatrix(int fixedOffset, int row, int column, int height, int width, int rotation, boolean horizontal_flip)
public static final int getOffsetIntoMatrix(int offset, int row, int column, int width)
public static void rotateAndFlip(SourceImage srcImg, AttributeList list, int rotation, boolean horizontal_flip) throws DicomException
Rotate an image in 90 degree increments, optionally followed by a horizontal flip.
The accompanying attribute list will be updated with new Pixel Data and related Image Pixel Module attributes.
Note that original PhotometricInterpretation will be retained; care should be taken by the caller
to change this as appropriate, e.g., from YBR_FULL_422 if read as JPEG to RGB if written as uncompressed.
See, for example, AttributeList.correctDecompressedImagePixelModule()
.
srcImg
- the imagelist
- the attribute list corresponding imagerotation
- multiple of 90 degreeshorizontal_flip
- whether or not to flip horizontally AFTER rotationDicomException
- if something bad happens handling the attribute list