DCMTK: DcmSegUtils Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
DcmSegUtils Class Reference

Class that contains helper functionality for the dcmseg module. More...

## Static Public Member Functions
static DcmIODTypes::Frame * | packBinaryFrame (const Uint8 *pixelData, const Uint16 rows, const Uint16 columns)
| Pack the given segmentation pixel data, provided "unpacked", into the packed format expected by DICOM.
static OFCondition | concatBinaryFrames (const OFVector< DcmIODTypes::Frame * > &frames, const Uint16 rows, const Uint16 cols, Uint8 *pixData, const size_t pixDataLength)
| Concatenate given frames into a single bit array.
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).
static OFString | debugByte2Bin (Uint8 b)
| Dumps a byte as binary number to a string.
static void | debugDumpBin (Uint8 *buffer, size_t length, const OFString &what, const OFBool raw)
| Dumps a memory block byte for byte to the debug log stream.

## Detailed Description

Class that contains helper functionality for the dcmseg module.

## Member Function Documentation

## ◆ concatBinaryFrames()

static OFCondition DcmSegUtils::concatBinaryFrames | ( | const OFVector< DcmIODTypes::Frame * > & | frames,
|  | const Uint16 | rows,
|  | const Uint16 | cols,
|  | Uint8 * | pixData,
|  | const size_t | pixDataLength )
| static

Concatenate given frames into a single bit array.

Parameters

  frames | The frames to concatenate. Each frame is expected to be in packed format (1 bit per pixel), with the last byte padded with 0s if necessary
  rows | The number of rows in the frames
  cols | The number of columns in the frames
  pixData | The buffer to store the concatenated frames. Must be pre-allocated and have a size of at least pixDataLength bytes. Bytes are set to 0 before concatenation.
  pixDataLength | The length of the pixData buffer in bytes

Returns
  EC_Normal if successful, an error code otherwise

## ◆ debugByte2Bin()

static OFString DcmSegUtils::debugByte2Bin | ( | Uint8 | b | ) |
| static

Dumps a byte as binary number to a string.

Only useful for debugging purposes.

Parameters

  b | The byte to dump

Returns
  A string containing b as a binary number

## ◆ debugDumpBin()

static void DcmSegUtils::debugDumpBin | ( | Uint8 * | buffer,
|  | size_t | length,
|  | const OFString & | what,
|  | const OFBool | raw )
| 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
  raw | If OFTrue, no additional information is added to the output, otherwise bytes are enumerated

## ◆ packBinaryFrame()

static DcmIODTypes::Frame * DcmSegUtils::packBinaryFrame | ( | const 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, i.e on byte per pixel, either 0 (not set) or non-0 (set)
  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

## ◆ unpackBinaryFrame()

static DcmIODTypes::Frame * DcmSegUtils::unpackBinaryFrame | ( | const DcmIODTypes::Frame * | frame,
|  | Uint16 | rows,
|  | Uint16 | cols )
| static

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

Generated on Wed Apr 30 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2