Class to handle color palette look-up tables. More...
Public Member Functions | |
DiLookupTable (const DiDocument *docu, const DcmTagKey &descriptor, const DcmTagKey &data, const DcmTagKey &explanation, const OFBool ignoreDepth=OFFalse, EI_Status *status=NULL) | |
constructor | |
DiLookupTable (const DiDocument *docu, const DcmTagKey &sequence, const DcmTagKey &descriptor, const DcmTagKey &data, const DcmTagKey &explanation, const OFBool ignoreDepth=OFFalse, const unsigned long pos=0, unsigned long *card=NULL) | |
constructor | |
DiLookupTable (const DcmUnsignedShort &data, const DcmUnsignedShort &descriptor, const DcmLongString *explanation=NULL, const OFBool ignoreDepth=OFFalse, 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. | |
DiLookupTable * | createInverseLUT () 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, DcmObject *obj, const DcmTagKey &descriptor, const DcmTagKey &data, const DcmTagKey &explanation, const OFBool ignoreDepth=OFFalse, EI_Status *status=NULL) |
initialize lookup table | |
void | checkTable (unsigned long count, Uint16 bits, const OFBool ignoreDepth=OFFalse, 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 OFBool ignoreDepth=OFFalse) |
check (and possibly correct) value for bits per LUT entry. | |
Private Member Functions | |
DiLookupTable (const DiLookupTable &) | |
DiLookupTable & | operator= (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) |
Class to handle color palette look-up tables.
Definition at line 60 of file diluptab.h.
DiLookupTable::DiLookupTable | ( | const DiDocument * | docu, | |
const DcmTagKey & | descriptor, | |||
const DcmTagKey & | data, | |||
const DcmTagKey & | explanation, | |||
const OFBool | ignoreDepth = OFFalse , |
|||
EI_Status * | status = NULL | |||
) |
constructor
docu | pointer to dataset (encapsulated) | |
descriptor | tag key containing the LUT descriptor | |
data | tag key containing the LUT data | |
explanation | tag key containing the LUT explanation | |
ignoreDepth | ignore third value of LUT descriptor if OFTrue | |
status | pointer to image status variable (optional) |
DiLookupTable::DiLookupTable | ( | const DiDocument * | docu, | |
const DcmTagKey & | sequence, | |||
const DcmTagKey & | descriptor, | |||
const DcmTagKey & | data, | |||
const DcmTagKey & | explanation, | |||
const OFBool | ignoreDepth = OFFalse , |
|||
const unsigned long | pos = 0 , |
|||
unsigned long * | card = NULL | |||
) |
constructor
docu | pointer to dataset (encapsulated) | |
sequence | tag key containing the LUT sequence | |
descriptor | tag key containing the LUT descriptor | |
data | tag key containing the LUT data | |
explanation | tag key containing the LUT explanation | |
ignoreDepth | ignore third value of LUT descriptor if OFTrue | |
pos | position in the LUT sequence which should be used (optional) | |
card | pointer 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 OFBool | ignoreDepth = OFFalse , |
|||
const signed long | first = -1 , |
|||
EI_Status * | status = NULL | |||
) |
constructor
data | element containing the LUT data | |
descriptor | element containing the LUT descriptor | |
explanation | element containing the LUT explanation (optional) | |
ignoreDepth | ignore third value of LUT descriptor if OFTrue | |
first | expected value for "first input value mapped" (optional) | |
status | pointer to image status variable (optional) |
DiLookupTable::DiLookupTable | ( | Uint16 * | buffer, | |
const Uint32 | count, | |||
const Uint16 | bits | |||
) |
constructor
buffer | pointer to array with LUT entries | |
count | number of LUT entries | |
bits | number of bits per entry |
void DiLookupTable::checkBits | ( | const Uint16 | bits, | |
const Uint16 | rightBits, | |||
const Uint16 | wrongBits = 0 , |
|||
const OFBool | ignoreDepth = OFFalse | |||
) | [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.
bits | actual value for bits per entry | |
rightBits | right value (8 or 16) | |
wrongBits | wrong value (8 or 16) | |
ignoreDepth | ignore 'bits' value, determine depth automatically |
void DiLookupTable::checkTable | ( | unsigned long | count, | |
Uint16 | bits, | |||
const OFBool | ignoreDepth = OFFalse , |
|||
EI_Status * | status = NULL | |||
) | [protected] |
check (and possibly correct) lookup table for consistency
count | number of LUT entries | |
bits | bits per LUT entry | |
ignoreDepth | ignore 'bits' value, determine depth automatically | |
status | pointer to image status variable (optional) |
int DiLookupTable::compareLUT | ( | const DcmUnsignedShort & | data, | |
const DcmUnsignedShort & | descriptor | |||
) |
compares current LUT with specified LUT
data | element containing the LUT data | |
descriptor | element containing the LUT descriptor |
DiLookupTable* DiLookupTable::createInverseLUT | ( | ) | const |
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).
void DiLookupTable::Init | ( | const DiDocument * | docu, | |
DcmObject * | obj, | |||
const DcmTagKey & | descriptor, | |||
const DcmTagKey & | data, | |||
const DcmTagKey & | explanation, | |||
const OFBool | ignoreDepth = OFFalse , |
|||
EI_Status * | status = NULL | |||
) | [protected] |
initialize lookup table
docu | pointer to dataset (encapsulated) | |
obj | pointer to item in dataset where to start (maybe NULL) | |
descriptor | tag key containing the LUT descriptor | |
data | tag key containing the LUT data | |
explanation | tag key containing the LUT explanation | |
ignoreDepth | ignore third value of LUT descriptor if OFTrue | |
status | pointer 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)
flag | if 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. |
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)
flag | if 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. |
virtual OFBool DiLookupTable::operator== | ( | const DiLookupTable & | lut | ) | [virtual] |
compares current LUT with specified LUT
lut | LUT to be compared with the current one |
Reimplemented from DiBaseLUT.
virtual OFBool DiLookupTable::operator== | ( | const DiBaseLUT & | lut | ) | [virtual] |
compares current LUT with specified LUT
lut | LUT to be compared with the current one |