Class that contains helper functionality for the dcmseg module.
More...
|
static DcmIODTypes::Frame * | packBinaryFrame (Uint8 *pixelData, const Uint16 rows, const Uint16 columns) |
| Pack the given segmentation pixel data, provided "unpacked", into the packed format expected by DICOM. More...
|
|
static size_t | getBytesForBinaryFrame (const size_t &numPixels) |
| Compute the number of bytes required for a binary pixel data frame, given the number of pixels. More...
|
|
static DcmIODTypes::Frame * | unpackBinaryFrame (const DcmIODTypes::Frame *frame, Uint16 rows, Uint16 cols) |
| Unpacks a binary segmentation frame into a "sparse" pixel data frame where every resulting byte represents a single bit of the frame being either 0 (not set) or 1 (set). More...
|
|
static void | shiftRight (Uint8 *buf, size_t bufLen, Uint8 numBits) |
| Shifts the given memory block some defined number of bits to the right Bits that fall off the last byte are lost (i.e. More...
|
|
static void | shiftLeft (Uint8 *buf, size_t bufLen, Uint8 numBits) |
| Shifts the given memory block some defined number of bits to the left. More...
|
|
static OFString | debugByte2Bin (Uint8 b) |
| Dumps a byte as binary number to a string. More...
|
|
static void | debugDumpBin (Uint8 *buffer, size_t length, const char *what) |
| Dumps a memory block byte for byte to the debug log stream. More...
|
|
Class that contains helper functionality for the dcmseg module.
static OFString DcmSegUtils::debugByte2Bin |
( |
Uint8 |
b | ) |
|
|
static |
Dumps a byte as binary number to a string.
Only useful for debugging purposes.
- Parameters
-
- Returns
- A string containing b as a binary number
static void DcmSegUtils::debugDumpBin |
( |
Uint8 * |
buffer, |
|
|
size_t |
length, |
|
|
const char * |
what |
|
) |
| |
|
static |
Dumps a memory block byte for byte to the debug log stream.
Only useful for debugging purposes.
- Parameters
-
buffer | The address of the memory block to dump |
length | The length of memory to be dumped |
what | String describing what is dumped. |
static size_t DcmSegUtils::getBytesForBinaryFrame |
( |
const size_t & |
numPixels | ) |
|
|
static |
Compute the number of bytes required for a binary pixel data frame, given the number of pixels.
- Parameters
-
numPixels | The total number of pixels |
- Returns
- The number of bytes required to pack the data into a binary segmentation frame
static DcmIODTypes::Frame* DcmSegUtils::packBinaryFrame |
( |
Uint8 * |
pixelData, |
|
|
const Uint16 |
rows, |
|
|
const Uint16 |
columns |
|
) |
| |
|
static |
Pack the given segmentation pixel data, provided "unpacked", into the packed format expected by DICOM.
- Parameters
-
pixelData | Pixel data in unpacked format |
rows | Number of rows in the pixel data |
columns | The number of columns in the pixel data |
- Returns
- The frame data if successful, NULL if an error occurs
static void DcmSegUtils::shiftLeft |
( |
Uint8 * |
buf, |
|
|
size_t |
bufLen, |
|
|
Uint8 |
numBits |
|
) |
| |
|
static |
Shifts the given memory block some defined number of bits to the left.
Bits that fall off the first byte are lost (i.e. no "cycled" shift).
- Parameters
-
buf | The address of the memory buffer to shift |
bufLen | The length of the buf memory block in bytes |
numBits | The number of bits to shift. Must be 0 <= numBits <= 7. |
static void DcmSegUtils::shiftRight |
( |
Uint8 * |
buf, |
|
|
size_t |
bufLen, |
|
|
Uint8 |
numBits |
|
) |
| |
|
static |
Shifts the given memory block some defined number of bits to the right Bits that fall off the last byte are lost (i.e.
no "cycled" shift).
- Parameters
-
buf | The address of the memory buffer to shift |
bufLen | The length of the buf memory block in bytes |
numBits | The number of bits to shift. Must be 0 <= numBits <= 7. |
Unpacks a binary segmentation frame into a "sparse" pixel data frame where every resulting byte represents a single bit of the frame being either 0 (not set) or 1 (set).
- Parameters
-
frame | The input buffer with the frame in packed format |
rows | The rows of the frame |
cols | The cols of the frame |
- Returns
- The segmentation frame in unpacked format. NULL in case of error.
The documentation for this class was generated from the following file:
- dcmseg/include/dcmtk/dcmseg/segutils.h