com.pixelmed.dicom
Class VOITransform

java.lang.Object
  extended by com.pixelmed.dicom.VOITransform

public class VOITransform
extends Object

A transformation constructed from a DICOM attribute list that extracts those attributes that define the VOI LUT transformation, specifically the window center and width attributes.

Looks first for a per-frame functional group FrameVOILUTSequence then looks in the shared functional groups, otherwise tries to find the Window Center and Width values in the top level of the dataset.

Note that multiple transformations (for each frame) may be present and are supported (specifically, Window Center and Width are multi-valued attributes).


Constructor Summary
VOITransform(AttributeList list)
           
 
Method Summary
 int getBitsPerEntry(int frame, int transform)
          Get the number of bits per LUT entry of the particular transform available for a particular frame.
 double getCenter(int frame, int transform)
          Get the window center of the particular transform available for a particular frame.
 int getEntryMaximum(int frame, int transform)
          Get the maximum LUT entry value of the particular transform available for a particular frame.
 int getEntryMinimum(int frame, int transform)
          Get the minimum LUT entry value of the particular transform available for a particular frame.
 String getExplanation(int frame, int transform)
          Get the explanation of a particular transform available for a particular frame.
 int getFirstValueMapped(int frame, int transform)
          Get the first value mapped of the particular transform available for a particular frame.
 short[] getLUTData(int frame, int transform)
          Get the LUT data of the particular transform available for a particular frame.
 int getNumberOfEntries(int frame, int transform)
          Get the number of LUT entries of the particular transform available for a particular frame.
 int getNumberOfTransforms(int frame)
          Get the number of transforms available for a particular frame.
 int getTopOfEntryRange(int frame, int transform)
          Get the top of the LUT entry range of values of the particular transform available for a particular frame.
protected  com.pixelmed.dicom.VOITransform.SingleVOITransforms getTransformsForFrame(int frame)
          Get the transforms available for a particular frame.
 double getWidth(int frame, int transform)
          Get the window width of the particular transform available for a particular frame.
 boolean isLUTTransform(int frame, int transform)
          Is the particular transform for a particular frame a LUT transformation.
 boolean isWindowTransform(int frame, int transform)
          Is the particular transform for a particular frame a window transformation.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VOITransform

public VOITransform(AttributeList list)
Parameters:
list -
Method Detail

getTransformsForFrame

protected com.pixelmed.dicom.VOITransform.SingleVOITransforms getTransformsForFrame(int frame)
Get the transforms available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
Returns:
the transforms available for the frame, null if none

getNumberOfTransforms

public int getNumberOfTransforms(int frame)
Get the number of transforms available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
Returns:
the number of transforms available for the frame, 0 if none

isWindowTransform

public boolean isWindowTransform(int frame,
                                 int transform)
Is the particular transform for a particular frame a window transformation.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
Returns:
true if is a window transform

isLUTTransform

public boolean isLUTTransform(int frame,
                              int transform)
Is the particular transform for a particular frame a LUT transformation.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
Returns:
true if is a LUT transform

getWidth

public double getWidth(int frame,
                       int transform)
Get the window width of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the window width, or 0 if none

getCenter

public double getCenter(int frame,
                        int transform)
Get the window center of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the window center, or 0 if none

getNumberOfEntries

public int getNumberOfEntries(int frame,
                              int transform)
Get the number of LUT entries of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the number of LUT entries, or 0 if none

getFirstValueMapped

public int getFirstValueMapped(int frame,
                               int transform)
Get the first value mapped of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the first value mapped, or 0 if none

getBitsPerEntry

public int getBitsPerEntry(int frame,
                           int transform)
Get the number of bits per LUT entry of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the number of bits per LUT entry, or 0 if none

getEntryMinimum

public int getEntryMinimum(int frame,
                           int transform)
Get the minimum LUT entry value of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the minimum LUT entry value, or 0 if none

getEntryMaximum

public int getEntryMaximum(int frame,
                           int transform)
Get the maximum LUT entry value of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the maximum LUT entry value, or 0 if none

getTopOfEntryRange

public int getTopOfEntryRange(int frame,
                              int transform)
Get the top of the LUT entry range of values of the particular transform available for a particular frame. This is the lowest power of two minus one that is greater than or equally to the maximum LUT entry value, and less than or equal to the maximum specified by bits per entry.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the top of the LUT entry range, or 0 if none

getLUTData

public short[] getLUTData(int frame,
                          int transform)
Get the LUT data of the particular transform available for a particular frame.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the LUT data, or null if none

getExplanation

public String getExplanation(int frame,
                             int transform)

Get the explanation of a particular transform available for a particular frame.

The explanation is derived from WindowCenterWidthExplanation.

Parameters:
frame - numbered from zero; needed to select which transform if frame-specific
transform - numbered from zero; needed to select which transform if more than one for that frame
Returns:
the explanation, or zero length string if none

toString

public final String toString()
Overrides:
toString in class Object