com.pixelmed.apps
Class IntegerScalingOfFloatingPointPixelData

java.lang.Object
  extended by com.pixelmed.apps.IntegerScalingOfFloatingPointPixelData

public class IntegerScalingOfFloatingPointPixelData
extends Object

A class of static methods to interconvert floating point pixel data to scaled integer values.


Constructor Summary
IntegerScalingOfFloatingPointPixelData()
           
 
Method Summary
static void main(String[] arg)
          Read a DICOM image input format file and convert floating point pixel data to scaled integer values.
static void performIntegerScaling(String inputFileName, String outputFileName)
          Read a DICOM image with grayscale floating point PixelData and scale it to integer values sufficient to represent the dynamic range.
static void reportOnRoundTrip(double input, double slope, double intercept, String message)
           
static void reverseIntegerScaling(String inputFileName, String outputFileName)
          Read a DICOM image with grayscale integer PixelData and scale it to floating point values based on the Rescale Slope and Intercept.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerScalingOfFloatingPointPixelData

public IntegerScalingOfFloatingPointPixelData()
Method Detail

reportOnRoundTrip

public static void reportOnRoundTrip(double input,
                                     double slope,
                                     double intercept,
                                     String message)

performIntegerScaling

public static void performIntegerScaling(String inputFileName,
                                         String outputFileName)
                                  throws DicomException,
                                         FileNotFoundException,
                                         IOException

Read a DICOM image with grayscale floating point PixelData and scale it to integer values sufficient to represent the dynamic range.

The dynamic range of the input is mapped to the full range of the short unsigned integer putput pixel values (0 to 65535)

The scaling values are recorded in Rescale Slope and Intercept.

Parameters:
inputFileName - the input file name
outputFileName - the output file name
Throws:
DicomException
FileNotFoundException
IOException

reverseIntegerScaling

public static void reverseIntegerScaling(String inputFileName,
                                         String outputFileName)
                                  throws DicomException,
                                         FileNotFoundException,
                                         IOException

Read a DICOM image with grayscale integer PixelData and scale it to floating point values based on the Rescale Slope and Intercept.

Parameters:
inputFileName - the input file name
outputFileName - the output file name
Throws:
DicomException
FileNotFoundException
IOException

main

public static void main(String[] arg)

Read a DICOM image input format file and convert floating point pixel data to scaled integer values.

Parameters:
arg - two or three parameters, an optional direction argument (toFloat|toInt, case insensitive, defaults to toFloat), the inputFile, and the outputFile