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::FramepackBinaryFrame (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::FrameunpackBinaryFrame (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
framesThe 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
rowsThe number of rows in the frames
colsThe number of columns in the frames
pixDataThe 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.
pixDataLengthThe 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
bThe 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
bufferThe address of the memory block to dump
lengthThe length of memory to be dumped
whatString describing what is dumped
rawIf 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
pixelDataPixel data in unpacked format, i.e on byte per pixel, either 0 (not set) or non-0 (set)
rowsNumber of rows in the pixel data
columnsThe 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
frameThe input buffer with the frame in packed format
rowsThe rows of the frame
colsThe 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:


Generated on Fri Mar 21 2025 for DCMTK Version 3.6.9 by Doxygen 1.9.8