uk.ac.essex.common.image
Class DicomImage

java.lang.Object
  extended by com.sun.media.jai.codecimpl.SimpleRenderedImage
      extended by uk.ac.essex.common.image.DicomImage
All Implemented Interfaces:
java.awt.image.RenderedImage

public class DicomImage
extends com.sun.media.jai.codecimpl.SimpleRenderedImage

A class defines the decoded 12-bit DICOM image. This class contains a single-tile short-type image in a little-endian file format. A list of primary medical image parameters such as image width, image height, image position, image orientation, and etc are decoded and stored in this class. Note that this simple DICOM decoder may not support some of the DICOM images. In this case, the user should extend the functionality of this class or write their own DICOM decoder.


Field Summary
 
Fields inherited from class com.sun.media.jai.codecimpl.SimpleRenderedImage
colorModel, height, minX, minY, properties, sampleModel, sources, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
DicomImage(java.lang.String fileName)
          Constructor.
 
Method Summary
 java.awt.image.Raster computeTile(int tileX, int tileY)
          Create the single tile of this image.
 int getMaximum()
          Return the maximum pixel value in this image.
 int getMinimum()
          Return the minimum pixel value of this image.
 double getPixelSizeX()
          Return the pixel size in X-direction, in mm.
 double getPixelSizeY()
          Return the pixel size in Y-direction, in mm.
 java.awt.image.Raster getTile(int tileX, int tileY)
          Get the tile.
 
Methods inherited from class com.sun.media.jai.codecimpl.SimpleRenderedImage
copyData, getBounds, getColorModel, getData, getData, getHeight, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getPropertyNames, getSampleModel, getSources, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, tileXToX, tileXToX, tileYToY, tileYToY, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DicomImage

public DicomImage(java.lang.String fileName)
Constructor. It accepts the name of a DICOM image file, loads the tag data and parses some of the important tags into instance variables, load the data into a short-type buffer and creates the sample model for this image.

Method Detail

getPixelSizeX

public double getPixelSizeX()
Return the pixel size in X-direction, in mm.


getPixelSizeY

public double getPixelSizeY()
Return the pixel size in Y-direction, in mm.


getMaximum

public int getMaximum()
Return the maximum pixel value in this image.


getMinimum

public int getMinimum()
Return the minimum pixel value of this image.


getTile

public java.awt.image.Raster getTile(int tileX,
                                     int tileY)
Get the tile. As for after reading, this image only have one tile. So for the other tile position, an exception is thrown.

Throws:
java.lang.IllegalArgumentException - When the tile position is not (0, 0).

computeTile

public java.awt.image.Raster computeTile(int tileX,
                                         int tileY)
Create the single tile of this image. The provided tile position is ignored. The sample model of the tile ratser is the sample model of this image. The location of the tile ratser is set to (0, 0).