Package com.pixelmed.apps
Class IntegerScalingOfFloatingPointPixelData
- java.lang.Object
-
- com.pixelmed.apps.IntegerScalingOfFloatingPointPixelData
-
public class IntegerScalingOfFloatingPointPixelData extends java.lang.ObjectA class of static methods to interconvert floating point pixel data to scaled integer values.
-
-
Constructor Summary
Constructors Constructor Description IntegerScalingOfFloatingPointPixelData()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] arg)Read a DICOM image input format file and convert floating point pixel data to scaled integer values or vice versa.static voidperformIntegerScaling(java.lang.String inputFileName, java.lang.String outputFileName)Read a DICOM image with grayscale floating point PixelData and scale it to integer values sufficient to represent the dynamic range.static voidreportOnRoundTrip(double input, double slope, double intercept, java.lang.String message)static voidreverseIntegerScaling(java.lang.String inputFileName, java.lang.String outputFileName, boolean toDouble)Read a DICOM image with grayscale integer PixelData and scale it to single or double length floating point values based on the Rescale Slope and Intercept.
-
-
-
Method Detail
-
reportOnRoundTrip
public static void reportOnRoundTrip(double input, double slope, double intercept, java.lang.String message)
-
performIntegerScaling
public static void performIntegerScaling(java.lang.String inputFileName, java.lang.String outputFileName) throws DicomException, java.io.FileNotFoundException, java.io.IOExceptionRead 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 nameoutputFileName- the output file name- Throws:
DicomExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
reverseIntegerScaling
public static void reverseIntegerScaling(java.lang.String inputFileName, java.lang.String outputFileName, boolean toDouble) throws DicomException, java.io.FileNotFoundException, java.io.IOExceptionRead a DICOM image with grayscale integer PixelData and scale it to single or double length floating point values based on the Rescale Slope and Intercept.
- Parameters:
inputFileName- the input file nameoutputFileName- the output file nametoDouble- if true make double else float pixel values- Throws:
DicomExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
main
public static void main(java.lang.String[] arg)
Read a DICOM image input format file and convert floating point pixel data to scaled integer values or vice versa.
- Parameters:
arg- two or three parameters, an optional direction argument (toFloat|toInt, case insensitive, defaults to toInt), the inputFile, and the outputFile
-
-