public class DicomImageReader
extends javax.imageio.ImageReader
ImageReader capable of reading dicom images| Modifier | Constructor and Description |
|---|---|
|
DicomImageReader(javax.imageio.spi.ImageReaderSpi originatingProvider)
Constructs a
DicomImageReader and sets its
originatingProvider field to the supplied value. |
protected |
DicomImageReader(javax.imageio.spi.ImageReaderSpi originatingProvider,
com.archimed.dicom.iioplugin.pixel.PixelReaderFactory pixelReaderFactory,
com.archimed.dicom.iioplugin.transform.GrayscaleTransformationFactory transformationFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Allows any resources held by this object to be released.
|
static DicomImageReadParam |
getDefaultDicomImageReadParam()
Returns the default reader params as a
DicomImageReadParam object. |
javax.imageio.ImageReadParam |
getDefaultReadParam()
Returns the default reader params as a
DicomImageReadParam object. |
int |
getHeight(int imageIndex)
Returns the height in pixels of the given image within the input
source.
|
javax.imageio.metadata.IIOMetadata |
getImageMetadata(int imageIndex)
Returns null (not supported).
|
java.util.Iterator |
getImageTypes(int imageIndex)
Returns an
Iterator containing possible image
types to which the given image may be decoded, in the form of
ImageTypeSpecifierss. |
int |
getNumImages(boolean allowSearch)
Returns the number of images, available from the current input source.
|
javax.imageio.metadata.IIOMetadata |
getStreamMetadata()
Returns null (not supported).
|
int |
getWidth(int imageIndex)
Returns the width in pixels of the given image within the input
source.
|
java.awt.image.BufferedImage |
read(int imageIndex,
javax.imageio.ImageReadParam param)
Reads the image indexed by
imageIndex and returns
it as a complete BufferedImage, using a supplied
ImageReadParam. |
void |
setInput(java.lang.Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Sets the input source to use to the given
ImageInputStream or other Object. |
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, reset, setInput, setInput, setLocalepublic DicomImageReader(javax.imageio.spi.ImageReaderSpi originatingProvider)
DicomImageReader and sets its
originatingProvider field to the supplied value.originatingProvider - the ImageReaderSpi that is
invoking this constructor, or null (not used).protected DicomImageReader(javax.imageio.spi.ImageReaderSpi originatingProvider,
com.archimed.dicom.iioplugin.pixel.PixelReaderFactory pixelReaderFactory,
com.archimed.dicom.iioplugin.transform.GrayscaleTransformationFactory transformationFactory)
public int getNumImages(boolean allowSearch)
throws java.io.IOException
getNumImages in class javax.imageio.ImageReaderallowSearch - ignored, number of images is available from the image headerjava.lang.IllegalStateException - if the input source has not been set,
or if the input has been specified with seekForwardOnly
set to true.java.io.IOException - if an error occurs reading the
information from the input source.setInput(java.lang.Object, boolean, boolean)public int getWidth(int imageIndex)
throws java.io.IOException
getWidth in class javax.imageio.ImageReaderimageIndex - the index of the image to be queried (not used).int.java.lang.IllegalStateException - if the input source has not been set.java.io.IOException - if an error occurs reading the width
information from the input source.public int getHeight(int imageIndex)
throws java.io.IOException
getHeight in class javax.imageio.ImageReaderimageIndex - the index of the image to be queried (not used).int.java.lang.IllegalStateException - if the input source has not been set.java.io.IOException - if an error occurs reading the width
information from the input source.public java.util.Iterator getImageTypes(int imageIndex)
throws java.io.IOException
Iterator containing possible image
types to which the given image may be decoded, in the form of
ImageTypeSpecifierss. At least one legal image
type will be returned.
The first element of the iterator is the most "natural" type for decoding the image with as little loss as possible.
getImageTypes in class javax.imageio.ImageReaderimageIndex - the index of the image to be retrieved (not used).Iterator containing at least one
ImageTypeSpecifier representing suggested image
types for decoding the current given image.java.lang.IllegalStateException - if the input source has not been set.java.io.IOException - if an error occurs reading the format
information from the input source.ImageReadParam.setDestination(java.awt.image.BufferedImage),
ImageReadParam.setDestinationType(javax.imageio.ImageTypeSpecifier)public javax.imageio.metadata.IIOMetadata getStreamMetadata()
throws java.io.IOException
getStreamMetadata in class javax.imageio.ImageReaderjava.io.IOException - if an error occurs during reading.public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
throws java.io.IOException
getImageMetadata in class javax.imageio.ImageReaderjava.io.IOException - if an error occurs during reading.public java.awt.image.BufferedImage read(int imageIndex,
javax.imageio.ImageReadParam param)
throws java.io.IOException
imageIndex and returns
it as a complete BufferedImage, using a supplied
ImageReadParam.read in class javax.imageio.ImageReaderimageIndex - the index of the image to be retrieved.param - an ImageReadParam used to control
the reading process, or null (ignored)BufferedImage.java.lang.IllegalStateException - if the input source has not been
set or the input can't be decoded.java.lang.IndexOutOfBoundsException - if the supplied index is
out of bounds.java.io.IOException - if an error occurs during reading.public void setInput(java.lang.Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
ImageInputStream or other Object.setInput in class javax.imageio.ImageReaderinput - the ImageInputStream or other
Object to use for future decoding.seekForwardOnly - if true, images and metadata
may only be read in ascending order from this input source (ignored).ignoreMetadata - if true, metadata
may be ignored during reads.java.lang.IllegalArgumentException - if input is
not an instance of one of the classes returned by the
originating service provider's getInputTypes
method, or is not an ImageInputStream.ImageInputStream,
ImageReader.getInput(),
ImageReaderSpi.getInputTypes()public void dispose()
finalize) subsequent to a call to this method
will throw an IllegalStateException.
It is important for applications to call this method when they
know they will no longer be using this ImageReader.
Otherwise, the reader may continue to hold on to resources
indefinitely.
dispose in class javax.imageio.ImageReaderpublic javax.imageio.ImageReadParam getDefaultReadParam()
DicomImageReadParam object.
Changing this object will influence all subsequent reads.getDefaultReadParam in class javax.imageio.ImageReaderpublic static DicomImageReadParam getDefaultDicomImageReadParam()
DicomImageReadParam object.
Changing this object will influence all subsequent reads.