DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Public Attributes | List of all members
FGInterface::ThreadedFGReader Struct Reference

Threaded functional group reader, used to read per-frame functional groups in parallel. More...

Inheritance diagram for FGInterface::ThreadedFGReader:

## Public Member Functions
void | init (OFVector< DcmItem * > *perFrameItems, OFMutex *perFrameItemsMutex, PerFrameGroups *m_frameResultGroups, OFMutex *frameResultGroupsMutex, Uint32 startFrame, Uint32 endFrame, OFMutex *errorMutex, OFConditionConst *errorOccurred, FGInterface *fgInterfacePtr)
| Initialize the thread. More...
| ThreadedFGReader ()
| Default constructor.
| ~ThreadedFGReader ()
| Destructor.
void | run ()
| Run method, called by OFThread::start() This method will read the functional groups for the frames assigned to this thread from the input vector and store them in the output vector. More...
Public Member Functions inherited from OFThread
| OFThread ()
| default constructor. More...
virtual | ~OFThread ()
| destructor. More...
int | start ()
| adds a new thread of control to the current process. More...
int | join ()
| blocks the calling thread until the thread referenced by the OFThread object terminates. More...
unsigned long | threadID ()
| returns the thread identifier of the thread referenced by the OFThread object, if the thread has already been started. More...
OFBool | equal (unsigned long tID)
| checks if the given thread ID matches the thread ID of the thread referenced by this object. More...

## Public Attributes
OFVector< DcmItem * > * | m_perFrameItems
| Input vector of per-frame items, one item per frame containing all functional groups for that frame.
OFMutex * | m_perFrameItemsMutex
| Mutex to protect the input vector.
PerFrameGroups * | m_frameResultGroups
| Output vector of per-frame functional groups, one item per frame containing all functional groups for that frame.
OFMutex * | m_frameResultGroupsMutex
| Mutex to protect the output vector.
Uint32 | m_startFrame
| Start frame this thread should handle (inclusive, starts with 0) (i.e. the first frame this thread handles is m_startFrame)
Uint32 | m_endFrame
| End frame this thread should handle (exclusive, i.e. the last frame this thread handles is m_endFrame - 1)
OFMutex * | m_errorMutex
| Mutex to protect error output.
OFConditionConst * | m_errorOccurred
| Pointer to a condition variable that is set if an error occurs during reading. More...
FGInterface * | m_fgInterfacePtr
| Pointer to the FGInterface instance to read from. More...

## Additional Inherited Members
Static Public Member Functions inherited from OFThread
static void | errorstr (OFString &description, int code)
| converts any of the error codes returned by the methods of this class into a textual description, which is written into the string object. More...
Static Public Attributes inherited from OFThread
static const int | busy
| this constant is returned by the join() method if another thread is already waiting for termination of the thread referenced by the OFThread object. More...
Static Protected Member Functions inherited from OFThread
static void | thread_exit ()
| terminates the calling thread, in a similar way that exit() terminates the calling process. More...
static unsigned long | self ()
| returns the thread ID of the calling thread. More...

## Detailed Description

Threaded functional group reader, used to read per-frame functional groups in parallel.

Each thread gets assigned some frames and reads the functional groups for those frames from the input vector. The results are stored in the output vector, which is protected by a mutex.

## Member Function Documentation

## ◆ init()

void FGInterface::ThreadedFGReader::init | ( | OFVector< DcmItem * > * | perFrameItems,
|  | OFMutex * | perFrameItemsMutex,
|  | PerFrameGroups * | m_frameResultGroups,
|  | OFMutex * | frameResultGroupsMutex,
|  | Uint32 | startFrame,
|  | Uint32 | endFrame,
|  | OFMutex * | errorMutex,
|  | OFConditionConst * | errorOccurred,
|  | FGInterface * | fgInterfacePtr
| ) |  |

Initialize the thread.

Parameters

  perFrameItems | Input vector of per-frame items, one item per frame containing all functional groups for that frame.
  perFrameItemsMutex | Mutex to protect the input vector
  m_frameResultGroups | Output vector of per-frame functional groups, one item per frame (index = frame number) containing all functional groups for that frame.
  frameResultGroupsMutex | Mutex to protect the output vector
  startFrame | Start frame this thread should handle (inclusive, starts with 0)
  endFrame | End frame this thread should handle (exclusive, i.e. the last frame this thread handles is m_endFrame - 1)
  errorMutex | Mutex to protect error output
  errorOccurred | Pointer to a condition variable that is set if an error occurs during reading. The main thread can check this variable to see if an error occurred.
  fgInterfacePtr | Pointer to the FGInterface instance; used to access its readSingleFG() method

## ◆ run()

void FGInterface::ThreadedFGReader::run | ( |  | ) |
| virtual

Run method, called by OFThread::start() This method will read the functional groups for the frames assigned to this thread from the input vector and store them in the output vector.

It will stop in case of an error and set the error condition variable to indicate that an error occurred.

Implements OFThread.

## Member Data Documentation

## ◆ m_errorOccurred

OFConditionConst* FGInterface::ThreadedFGReader::m_errorOccurred

Pointer to a condition variable that is set if an error occurs during reading.

This is used to signal the main thread that an error occurred during reading. The main thread can then check the error condition variable to see if an error occurred and handle it accordingly.

## ◆ m_fgInterfacePtr

FGInterface* FGInterface::ThreadedFGReader::m_fgInterfacePtr

Pointer to the FGInterface instance to read from.

This is used to access the FGInterface methods for reading functional groups. It is set by the init() method and used in the run() method to read each functional group

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

- dcmfg/include/dcmtk/dcmfg/fginterface.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1