com.pixelmed.display

## Class ImageEditUtilities

- java.lang.Object
- - com.pixelmed.display.ImageEditUtilities

    public class ImageEditUtilities
    extends java.lang.Object

A class of utility methods for editing image pixel data.

### Method Summary

Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### blackout

    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()`.

Parameters:
  `srcImg` - the image
  `list` - the attribute list corresponding image
  `shapes` - a `java.util.Vector` of `java.awt.Shape`, specifed in image-relative coordinates
Throws:
  `DicomException` - if something bad happens handling the attribute list

#### blackout

    public 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()`.

Parameters:
  `srcImg` - the image
  `list` - the attribute list corresponding image
  `shapes` - a `java.util.Vector` of `java.awt.Shape`, specifed in image-relative coordinates
  `burnInOverlays` - whether or not to burn in overlays
Throws:
  `DicomException` - if something bad happens handling the attribute list

#### blackout

    public 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()`.

Parameters:
  `srcImg` - the image
  `list` - the attribute list corresponding image
  `shapes` - a `java.util.Vector` of `java.awt.Shape`, specifed in image-relative coordinates
  `burnInOverlays` - whether or not to burn in overlays
  `usePixelPaddingValue` - whether or not to use any pixel paddding value
  `useSpecifiedBlackoutValue` - 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 true
Throws:
  `DicomException` - if something bad happens handling the attribute list

#### getOffsetIntoMatrix

    public static final int getOffsetIntoMatrix(int fixedOffset,
                          int row,
                          int column,
                          int height,
                          int width,
                          int rotation,
                          boolean horizontal_flip)

#### getOffsetIntoMatrix

    public static final int getOffsetIntoMatrix(int offset,
                          int row,
                          int column,
                          int width)

#### rotateAndFlip

    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()`.

Parameters:
  `srcImg` - the image
  `list` - the attribute list corresponding image
  `rotation` - multiple of 90 degrees
  `horizontal_flip` - whether or not to flip horizontally AFTER rotation
Throws:
  `DicomException` - if something bad happens handling the attribute list