Trispark JDT
2.50.13

com.archimed.dicom.iioplugin
Class DicomImageReader

java.lang.Object
  extended by javax.imageio.ImageReader
      extended by com.archimed.dicom.iioplugin.DicomImageReader

public class DicomImageReader
extends javax.imageio.ImageReader

An ImageReader capable of reading dicom images


Field Summary
 
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
 
Constructor Summary
  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)
           
 
Method Summary
 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.
 
Methods inherited from class javax.imageio.ImageReader
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, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DicomImageReader

public DicomImageReader(javax.imageio.spi.ImageReaderSpi originatingProvider)
Constructs a DicomImageReader and sets its originatingProvider field to the supplied value.

Parameters:
originatingProvider - the ImageReaderSpi that is invoking this constructor, or null (not used).

DicomImageReader

protected DicomImageReader(javax.imageio.spi.ImageReaderSpi originatingProvider,
                           com.archimed.dicom.iioplugin.pixel.PixelReaderFactory pixelReaderFactory,
                           com.archimed.dicom.iioplugin.transform.GrayscaleTransformationFactory transformationFactory)
Method Detail

getNumImages

public int getNumImages(boolean allowSearch)
                 throws java.io.IOException
Returns the number of images, available from the current input source.

Specified by:
getNumImages in class javax.imageio.ImageReader
Parameters:
allowSearch - ignored, number of images is available from the image header
Returns:
the number of images
Throws:
java.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.
See Also:
setInput(java.lang.Object, boolean, boolean)

getWidth

public int getWidth(int imageIndex)
             throws java.io.IOException
Returns the width in pixels of the given image within the input source.

Specified by:
getWidth in class javax.imageio.ImageReader
Parameters:
imageIndex - the index of the image to be queried (not used).
Returns:
the width of the image, as an int.
Throws:
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.

getHeight

public int getHeight(int imageIndex)
              throws java.io.IOException
Returns the height in pixels of the given image within the input source.

Specified by:
getHeight in class javax.imageio.ImageReader
Parameters:
imageIndex - the index of the image to be queried (not used).
Returns:
the width of the image, as an int.
Throws:
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.

getImageTypes

public java.util.Iterator getImageTypes(int imageIndex)
                                 throws java.io.IOException
Returns an 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.

Specified by:
getImageTypes in class javax.imageio.ImageReader
Parameters:
imageIndex - the index of the image to be retrieved (not used).
Returns:
an Iterator containing at least one ImageTypeSpecifier representing suggested image types for decoding the current given image.
Throws:
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.
See Also:
ImageReadParam.setDestination(java.awt.image.BufferedImage), ImageReadParam.setDestinationType(javax.imageio.ImageTypeSpecifier)

getStreamMetadata

public javax.imageio.metadata.IIOMetadata getStreamMetadata()
                                                     throws java.io.IOException
Returns null (not supported).

Specified by:
getStreamMetadata in class javax.imageio.ImageReader
Returns:
null
Throws:
java.io.IOException - if an error occurs during reading.

getImageMetadata

public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex)
                                                    throws java.io.IOException
Returns null (not supported).

Specified by:
getImageMetadata in class javax.imageio.ImageReader
Returns:
null
Throws:
java.io.IOException - if an error occurs during reading.

read

public java.awt.image.BufferedImage read(int imageIndex,
                                         javax.imageio.ImageReadParam param)
                                  throws java.io.IOException
Reads the image indexed by imageIndex and returns it as a complete BufferedImage, using a supplied ImageReadParam.

Specified by:
read in class javax.imageio.ImageReader
Parameters:
imageIndex - the index of the image to be retrieved.
param - an ImageReadParam used to control the reading process, or null (ignored)
Returns:
the desired portion of the image as a BufferedImage.
Throws:
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.

setInput

public void setInput(java.lang.Object input,
                     boolean seekForwardOnly,
                     boolean ignoreMetadata)
Sets the input source to use to the given ImageInputStream or other Object.

Overrides:
setInput in class javax.imageio.ImageReader
Parameters:
input - 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.
Throws:
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.
See Also:
ImageInputStream, ImageReader.getInput(), ImageReaderSpi.getInputTypes()

dispose

public void dispose()
Allows any resources held by this object to be released. The result of calling any other method (other than 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.

Overrides:
dispose in class javax.imageio.ImageReader

getDefaultReadParam

public javax.imageio.ImageReadParam getDefaultReadParam()
Returns the default reader params as a DicomImageReadParam object. Changing this object will influence all subsequent reads.

Overrides:
getDefaultReadParam in class javax.imageio.ImageReader

getDefaultDicomImageReadParam

public static DicomImageReadParam getDefaultDicomImageReadParam()
Returns the default reader params as a DicomImageReadParam object. Changing this object will influence all subsequent reads.


Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.