com.pixelmed.display
Class SourceImage

java.lang.Object
  extended by com.pixelmed.display.SourceImage

public class SourceImage
extends Object

A class that encapsulates the pixel data and features and values from an image source (such as a DICOM image), usually for the purpose of displaying it.

See Also:
SingleImagePanel

Field Summary
protected  com.pixelmed.display.SourceImage.BufferedImageSource bufferedImageSource
           
protected  MappedByteBuffer memoryMappedByteBuffer
           
protected  FileChannel memoryMappedFileChannel
           
protected  FileInputStream memoryMappedFileInputStream
           
protected static int memoryMapperNumberOfRetries
           
protected static int memoryMapperRetriesBeforeSleeping
           
protected static int memoryMapperSleepTimeBetweenRetries
           
 
Constructor Summary
SourceImage(AttributeList list)
          Construct an image from a single or multi-frame DICOM image from a list of DICOM attributes.
SourceImage(DicomInputStream i)
          Construct an image from a single or multi-frame DICOM image from an input stream (such as from a file or the network).
SourceImage(InputStream i, int w, int h, int depth)
          Construct a single-frame image from an unsigned raw image (no header) on an input stream with the specified width, height and bit depth.
SourceImage(InputStream i, int w, int h, int depth, int frames)
          Construct a multi-frame image from an unsigned raw image (no header) on an input stream with the specified width, height and bit depth.
SourceImage(String filename)
          Construct an image from a single or multi-frame DICOM image from a file.
 
Method Summary
protected static void clean(Object object)
           
 void close()
           
protected  void finalize()
           
 int getBackgroundValue()
           
 BufferedImage getBufferedImage()
           
 BufferedImage getBufferedImage(int i)
           
protected  ByteBuffer getByteBufferFromOtherAttributeOnDisk(OtherAttributeOnDisk oad)
          Get a memory mapped file buffer for value of the specified attribute.
 Dimension getDimension()
           
 DisplayShutter getDisplayShutter()
           
 int getHeight()
           
 int getMaskValue()
           
 double getMaximum()
           
 double getMinimum()
           
 ModalityTransform getModalityTransform()
           
 int getNumberOfBufferedImages()
           
 int getNumberOfFrames()
           
 Overlay getOverlay()
           
 int getPadRangeLimit()
           
 int getPadValue()
           
 int getPaletteColorBitsPerEntry()
           
 short[] getPaletteColorBlueTable()
           
 int getPaletteColorFirstValueMapped()
           
 short[] getPaletteColorGreenTable()
           
 int getPaletteColorLargestGray()
           
 int getPaletteColorNumberOfEntries()
           
 short[] getPaletteColorRedTable()
           
 RealWorldValueTransform getRealWorldValueTransform()
           
protected  ShortBuffer getShortBufferFromOtherWordAttributeOnDisk(OtherWordAttributeOnDisk oad)
          Get a memory mapped file buffer for value of the specified attribute.
 SUVTransform getSUVTransform()
           
 String getTitle()
           
 VOITransform getVOITransform()
           
 int getWidth()
           
 boolean isGrayscale()
           
 boolean isInverted()
           
 boolean isPadded()
           
 boolean isSigned()
           
 boolean isYBR()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferedImageSource

protected com.pixelmed.display.SourceImage.BufferedImageSource bufferedImageSource

memoryMappedFileInputStream

protected FileInputStream memoryMappedFileInputStream

memoryMappedFileChannel

protected FileChannel memoryMappedFileChannel

memoryMappedByteBuffer

protected MappedByteBuffer memoryMappedByteBuffer

memoryMapperNumberOfRetries

protected static int memoryMapperNumberOfRetries

memoryMapperSleepTimeBetweenRetries

protected static int memoryMapperSleepTimeBetweenRetries

memoryMapperRetriesBeforeSleeping

protected static int memoryMapperRetriesBeforeSleeping
Constructor Detail

SourceImage

public SourceImage(InputStream i,
                   int w,
                   int h,
                   int depth)
            throws IOException

Construct a single-frame image from an unsigned raw image (no header) on an input stream with the specified width, height and bit depth.

Parameters:
i - the input stream
w - image width
h - image height
depth - bit depth
Throws:
IOException

SourceImage

public SourceImage(InputStream i,
                   int w,
                   int h,
                   int depth,
                   int frames)
            throws IOException

Construct a multi-frame image from an unsigned raw image (no header) on an input stream with the specified width, height and bit depth.

Parameters:
i - the input stream
w - image width
h - image height
depth - bit depth
frames - number of frames
Throws:
IOException

SourceImage

public SourceImage(String filename)
            throws IOException,
                   DicomException

Construct an image from a single or multi-frame DICOM image from a file.

Parameters:
filename -
Throws:
IOException
DicomException

SourceImage

public SourceImage(DicomInputStream i)
            throws IOException,
                   DicomException

Construct an image from a single or multi-frame DICOM image from an input stream (such as from a file or the network).

Parameters:
i - the input stream
Throws:
IOException
DicomException

SourceImage

public SourceImage(AttributeList list)
            throws DicomException

Construct an image from a single or multi-frame DICOM image from a list of DICOM attributes.

Parameters:
list - the list of attributes that include the description and values of the pixel data
Throws:
DicomException
Method Detail

clean

protected static void clean(Object object)
                     throws Exception
Throws:
Exception

close

public void close()
           throws Throwable
Throws:
Throwable

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getByteBufferFromOtherAttributeOnDisk

protected ByteBuffer getByteBufferFromOtherAttributeOnDisk(OtherAttributeOnDisk oad)
                                                    throws DicomException,
                                                           IOException

Get a memory mapped file buffer for value of the specified attribute.

Parameters:
oad - the attribute on disk to memory map
Throws:
DicomException
IOException

getShortBufferFromOtherWordAttributeOnDisk

protected ShortBuffer getShortBufferFromOtherWordAttributeOnDisk(OtherWordAttributeOnDisk oad)
                                                          throws DicomException,
                                                                 IOException

Get a memory mapped file buffer for value of the specified attribute.

Parameters:
oad - the attribute on disk to memory map
Throws:
DicomException
IOException

getBufferedImage

public BufferedImage getBufferedImage()

getBufferedImage

public BufferedImage getBufferedImage(int i)

getNumberOfBufferedImages

public int getNumberOfBufferedImages()

getWidth

public int getWidth()

getHeight

public int getHeight()

getDimension

public Dimension getDimension()

getMinimum

public double getMinimum()
Returns:
the minimum pixel value, excluding any pixels in the padding value range

getMaximum

public double getMaximum()
Returns:
the maximum pixel value, excluding any pixels in the padding value range

getMaskValue

public int getMaskValue()

isSigned

public boolean isSigned()

isInverted

public boolean isInverted()

isPadded

public boolean isPadded()

getPadValue

public int getPadValue()

getPadRangeLimit

public int getPadRangeLimit()

getBackgroundValue

public int getBackgroundValue()

isGrayscale

public boolean isGrayscale()

isYBR

public boolean isYBR()

getTitle

public String getTitle()

getNumberOfFrames

public int getNumberOfFrames()

getPaletteColorLargestGray

public int getPaletteColorLargestGray()

getPaletteColorFirstValueMapped

public int getPaletteColorFirstValueMapped()

getPaletteColorNumberOfEntries

public int getPaletteColorNumberOfEntries()

getPaletteColorBitsPerEntry

public int getPaletteColorBitsPerEntry()

getPaletteColorRedTable

public short[] getPaletteColorRedTable()

getPaletteColorGreenTable

public short[] getPaletteColorGreenTable()

getPaletteColorBlueTable

public short[] getPaletteColorBlueTable()

getSUVTransform

public SUVTransform getSUVTransform()

getRealWorldValueTransform

public RealWorldValueTransform getRealWorldValueTransform()

getModalityTransform

public ModalityTransform getModalityTransform()

getVOITransform

public VOITransform getVOITransform()

getDisplayShutter

public DisplayShutter getDisplayShutter()

getOverlay

public Overlay getOverlay()