public class Convert2PNG extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TRANSFORM_NONE
Deprecated.
|
static int |
TRANSFORM_SCALE_BY_HEIGHT
Deprecated.
|
static int |
TRANSFORM_SCALE_BY_PERCENT
Deprecated.
|
static int |
TRANSFORM_SCALE_BY_WIDTH
Deprecated.
|
Constructor and Description |
---|
Convert2PNG() |
Modifier and Type | Method and Description |
---|---|
static java.io.ByteArrayOutputStream |
DICOM2PNGStream(java.io.InputStream iStream,
int frameIndex)
Reads an input DICOM file and returns the desired frame as a PNG-encoded memory stream.
|
static java.io.ByteArrayOutputStream |
DICOM2PNGStream(StorageInputStream dcmStream,
int frameIndex)
Reads an input DICOM file and returns the desired frame as a PNG-encoded memory stream.
|
static java.io.ByteArrayOutputStream |
DICOM2PNGStream(StorageInputStream dcmStream,
int frameIndex,
int transformType,
int transformParam1,
float transformParam2)
Deprecated.
|
static java.io.ByteArrayOutputStream |
DICOM2ScaledPNGStream(java.io.InputStream inStream,
int frameIndex,
int width,
int height)
Reads an input DICOM file, scales it to fit in the given dimensions and returns the
desired frame as a PNG-encoded memory stream.
|
static java.io.ByteArrayOutputStream |
DICOM2ScaledPNGStream(StorageInputStream dcmStream,
int frameIndex,
int width,
int height)
Reads an input DICOM file, scales it to fit in the given dimensions and returns the
desired frame as a PNG-encoded memory stream.
|
static int |
getNumberOfFrames(StorageInputStream dcmFile)
Retrieve the number of frames from an input DICOM file.
|
static java.awt.image.BufferedImage |
scaleImage(java.awt.image.BufferedImage image,
int width,
int height)
Resize a BufferedImage to fit the specified dimensions, while preserving the original image aspect ratio.
|
static java.awt.image.BufferedImage |
scaleImageByHeight(java.awt.image.BufferedImage image,
int height)
Resize a BufferedImage to the specified height, preserving the original image aspect ratio.
|
static java.awt.image.BufferedImage |
scaleImageByPercent(java.awt.image.BufferedImage image,
float percent)
Resize a BufferedImage based on the specified percentage, preserving the original image aspect ratio.
|
static java.awt.image.BufferedImage |
scaleImageByWidth(java.awt.image.BufferedImage image,
int width)
Resize a BufferedImage to the specified width, preserving the original image aspect ratio.
|
@Deprecated public static final int TRANSFORM_NONE
@Deprecated public static final int TRANSFORM_SCALE_BY_WIDTH
@Deprecated public static final int TRANSFORM_SCALE_BY_HEIGHT
@Deprecated public static final int TRANSFORM_SCALE_BY_PERCENT
public Convert2PNG()
@Deprecated public static java.io.ByteArrayOutputStream DICOM2PNGStream(StorageInputStream dcmStream, int frameIndex, int transformType, int transformParam1, float transformParam2)
dcmStream
- The Dicoogle storage input Stream for the DICOM File.frameIndex
- the index of the frame wanted (zero based).transformType
- the transform to execute.transformParam1
- the param used on width and height based scales.transformParam2
- the param used on percentage based scales.public static java.io.ByteArrayOutputStream DICOM2PNGStream(StorageInputStream dcmStream, int frameIndex) throws java.io.IOException
dcmStream
- The Dicoogle storage input Stream for the DICOM File.frameIndex
- the index of the frame wanted (starting with #0).java.io.IOException
- if the I/O operations on the images failpublic static java.io.ByteArrayOutputStream DICOM2PNGStream(java.io.InputStream iStream, int frameIndex) throws java.io.IOException
iStream
- an input stream for the DICOM File.frameIndex
- the index of the frame wanted (starting with #0).java.io.IOException
- if the I/O operations on the images failpublic static java.io.ByteArrayOutputStream DICOM2ScaledPNGStream(java.io.InputStream inStream, int frameIndex, int width, int height) throws java.io.IOException
inStream
- The Dicoogle storage input Stream for the DICOM File.frameIndex
- the index of the frame wanted (starting with #0).width
- the maximum width of the resulting imageheight
- the maximum height of the resulting imagejava.io.IOException
- if the I/O operations on the images failpublic static java.io.ByteArrayOutputStream DICOM2ScaledPNGStream(StorageInputStream dcmStream, int frameIndex, int width, int height) throws java.io.IOException
dcmStream
- The Dicoogle storage input Stream for the DICOM File.frameIndex
- the index of the frame wanted (starting with #0).width
- the maximum width of the resulting imageheight
- the maximum height of the resulting imagejava.io.IOException
- if the I/O operations on the images failpublic static int getNumberOfFrames(StorageInputStream dcmFile)
dcmFile
- The Dicoogle storage input Stream for the DICOM File.public static java.awt.image.BufferedImage scaleImageByWidth(java.awt.image.BufferedImage image, int width)
image
- the original image to scale.width
- the target width.public static java.awt.image.BufferedImage scaleImageByHeight(java.awt.image.BufferedImage image, int height)
image
- the original image to scale.height
- the target height.public static java.awt.image.BufferedImage scaleImageByPercent(java.awt.image.BufferedImage image, float percent)
image
- the original image to scale.percent
- the percentage to scale to, 1.0 is original, 0.5 is half, 2.0 is double, etc.public static java.awt.image.BufferedImage scaleImage(java.awt.image.BufferedImage image, int width, int height)
image
- the original image to scale.width
- the maximum width of the targetheight
- the maximum height of the targetjava.lang.IllegalArgumentException
- on bad width and height dimensionsjava.lang.NullPointerException
- on null image