DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DiLookupTable Class Reference

Class to handle color palette look-up tables. More...

+ Inheritance diagram for DiLookupTable:

List of all members.

Public Member Functions

 DiLookupTable (const DiDocument *docu, const DcmTagKey &descriptor, const DcmTagKey &data, const DcmTagKey &explanation, const EL_BitsPerTableEntry descripMode=ELM_UseValue, EI_Status *status=NULL)
 constructor
 DiLookupTable (const DiDocument *docu, const DcmTagKey &sequence, const DcmTagKey &descriptor, const DcmTagKey &data, const DcmTagKey &explanation, const EL_BitsPerTableEntry descripMode=ELM_UseValue, const unsigned long pos=0, unsigned long *card=NULL)
 constructor
 DiLookupTable (const DcmUnsignedShort &data, const DcmUnsignedShort &descriptor, const DcmLongString *explanation=NULL, const EL_BitsPerTableEntry descripMode=ELM_UseValue, const signed long first=-1, EI_Status *status=NULL)
 constructor
 DiLookupTable (Uint16 *buffer, const Uint32 count, const Uint16 bits)
 constructor
virtual ~DiLookupTable ()
 destructor
int invertTable (const int flag=0x1)
 invert all LUT values.
int mirrorTable (const int flag=0x1)
 mirror the order of all LUT entries.
DiLookupTablecreateInverseLUT () const
 create an inverse copy of the current LUT.
int compareLUT (const DcmUnsignedShort &data, const DcmUnsignedShort &descriptor)
 compares current LUT with specified LUT
virtual OFBool operator== (const DiBaseLUT &lut)
 compares current LUT with specified LUT
virtual OFBool operator== (const DiLookupTable &lut)
 compares current LUT with specified LUT

Protected Member Functions

void Init (const DiDocument *docu, DcmItem *item, const DcmTagKey &descriptor, const DcmTagKey &data, const DcmTagKey &explanation, const EL_BitsPerTableEntry descripMode=ELM_UseValue, EI_Status *status=NULL)
 initialize lookup table
void checkTable (unsigned long count, Uint16 bits, const EL_BitsPerTableEntry descripMode=ELM_UseValue, EI_Status *status=NULL)
 check (and possibly correct) lookup table for consistency
void checkBits (const Uint16 bits, const Uint16 rightBits, const Uint16 wrongBits=0, const EL_BitsPerTableEntry descripMode=ELM_UseValue)
 check (and possibly correct) value for bits per LUT entry.

Private Member Functions

 DiLookupTable (const DiLookupTable &)
DiLookupTableoperator= (const DiLookupTable &)

Private Attributes

int OriginalBitsAllocated
 number of bits originally allocated for a LUT entry
void * OriginalData
 pointer to original data buffer (where the LUT data is created from)

Detailed Description

Class to handle color palette look-up tables.


Constructor & Destructor Documentation

DiLookupTable::DiLookupTable ( const DiDocument docu,
const DcmTagKey descriptor,
const DcmTagKey data,
const DcmTagKey explanation,
const EL_BitsPerTableEntry  descripMode = ELM_UseValue,
EI_Status *  status = NULL 
)

constructor

Parameters:
docupointer to dataset (encapsulated)
descriptortag key containing the LUT descriptor
datatag key containing the LUT data
explanationtag key containing the LUT explanation
descripModemode specifying the use of the bits per table entry value
statuspointer to image status variable (optional)
DiLookupTable::DiLookupTable ( const DiDocument docu,
const DcmTagKey sequence,
const DcmTagKey descriptor,
const DcmTagKey data,
const DcmTagKey explanation,
const EL_BitsPerTableEntry  descripMode = ELM_UseValue,
const unsigned long  pos = 0,
unsigned long *  card = NULL 
)

constructor

Parameters:
docupointer to dataset (encapsulated)
sequencetag key containing the LUT sequence
descriptortag key containing the LUT descriptor
datatag key containing the LUT data
explanationtag key containing the LUT explanation
descripModemode specifying the use of the bits per table entry value
posposition in the LUT sequence which should be used (optional)
cardpointer to storage area where the number of sequence entries should be stored (optional)
DiLookupTable::DiLookupTable ( const DcmUnsignedShort data,
const DcmUnsignedShort descriptor,
const DcmLongString explanation = NULL,
const EL_BitsPerTableEntry  descripMode = ELM_UseValue,
const signed long  first = -1,
EI_Status *  status = NULL 
)

constructor

Parameters:
dataelement containing the LUT data
descriptorelement containing the LUT descriptor
explanationelement containing the LUT explanation (optional)
descripModemode specifying the use of the bits per table entry value
firstexpected value for "first input value mapped" (optional)
statuspointer to image status variable (optional)
DiLookupTable::DiLookupTable ( Uint16 *  buffer,
const Uint32  count,
const Uint16  bits 
)

constructor

Parameters:
bufferpointer to array with LUT entries
countnumber of LUT entries
bitsnumber of bits per entry

Member Function Documentation

void DiLookupTable::checkBits ( const Uint16  bits,
const Uint16  rightBits,
const Uint16  wrongBits = 0,
const EL_BitsPerTableEntry  descripMode = ELM_UseValue 
) [protected]

check (and possibly correct) value for bits per LUT entry.

Be very lenient with the value stored in the LUT descriptor and therefore perform some addition (heuristical tests) to assume the most probable value.

Parameters:
bitsactual value for bits per entry
rightBitsright value (8 or 16)
wrongBitswrong value (8 or 16)
descripModemode specifying the use of the bits per table entry value
void DiLookupTable::checkTable ( unsigned long  count,
Uint16  bits,
const EL_BitsPerTableEntry  descripMode = ELM_UseValue,
EI_Status *  status = NULL 
) [protected]

check (and possibly correct) lookup table for consistency

Parameters:
countnumber of LUT entries
bitsbits per LUT entry
descripModemode specifying the use of the bits per table entry value
statuspointer to image status variable (optional)
int DiLookupTable::compareLUT ( const DcmUnsignedShort data,
const DcmUnsignedShort descriptor 
)

compares current LUT with specified LUT

Parameters:
dataelement containing the LUT data
descriptorelement containing the LUT descriptor
Returns:
true if LUTs are not equal (1 = invalid LUT / memory error, 2 = descriptor differs, 3 = data differs) false (0) otherwise

create an inverse copy of the current LUT.

(input values become output values and vice versa) This function is used for DICOM print (mainly 8<->12 bit).

Returns:
pointer to inverse LUT
void DiLookupTable::Init ( const DiDocument docu,
DcmItem item,
const DcmTagKey descriptor,
const DcmTagKey data,
const DcmTagKey explanation,
const EL_BitsPerTableEntry  descripMode = ELM_UseValue,
EI_Status *  status = NULL 
) [protected]

initialize lookup table

Parameters:
docupointer to dataset (encapsulated)
itempointer to item in dataset where to start (maybe NULL)
descriptortag key containing the LUT descriptor
datatag key containing the LUT data
explanationtag key containing the LUT explanation
descripModemode specifying the use of the bits per table entry value
statuspointer to image status variable (optional)
int DiLookupTable::invertTable ( const int  flag = 0x1)

invert all LUT values.

(new_value = max_value - old_value, e.g. used for presentation LUTs)

Parameters:
flagif bit 0 is set (0x1, default) the internal copy of the LUT data is modified or a copy of the original data is created (if not already existing), if bit 1 is set (0x2) the original LUT data is modified, a combination of both modes is also supported.
Returns:
status true if successful (0x1 if internal data modified, 0x2 if original data, 0x3 if both), false otherwise
int DiLookupTable::mirrorTable ( const int  flag = 0x1)

mirror the order of all LUT entries.

i.e. the last one becomes the first etc. (value[i] = value[last - i], e.g. used for presentation LUTs)

Parameters:
flagif bit 0 is set (0x1, default) the internal copy of the LUT data is modified or a copy of the original data is created (if not already existing), if bit 1 is set (0x2) the original LUT data is modified, a combination of both modes is also supported.
Returns:
status true if successful (0x1 if internal data modified, 0x2 if original data, 0x3 if both), false otherwise
virtual OFBool DiLookupTable::operator== ( const DiBaseLUT lut) [virtual]

compares current LUT with specified LUT

Parameters:
lutLUT to be compared with the current one
Returns:
OFTrue if LUTs are equal, OFFalse otherwise

Reimplemented from DiBaseLUT.

virtual OFBool DiLookupTable::operator== ( const DiLookupTable lut) [virtual]

compares current LUT with specified LUT

Parameters:
lutLUT to be compared with the current one
Returns:
OFTrue if LUTs are equal, OFFalse otherwise

The documentation for this class was generated from the following file:


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027