|
DCMTK
Version 3.7.0
OFFIS DICOM Toolkit
|
Main interface class to access functional groups from DICOM Enhanced objects. More...
Classes | |
| struct | ThreadedFGReader |
| Threaded functional group reader, used to read per-frame functional groups in parallel. More... | |
| struct | ThreadedFGWriter |
| Threaded functional group writer, used to write per-frame functional groups in parallel. More... | |
Public Types | |
| typedef OFMap< Uint32, FunctionalGroups * > | PerFrameGroups |
| Type representing per-frame functional groups, i.e. a number of functional groups assigned to each frame. | |
| typedef FunctionalGroups::iterator | iterator |
| Iterator type for iterating over functional groups. | |
| typedef FunctionalGroups::const_iterator | const_iterator |
| Const iterator type for iterating over functional groups. | |
Public Member Functions | |
| FGInterface () | |
| Constructor, constructs empty sets of per-frame and shared functional groups. | |
| virtual | ~FGInterface () |
| Virtual destructor, frees memory. | |
| virtual void | clear () |
| Delete all functional groups (shared and per-frame) | |
| virtual OFBool | check () |
| Checks the functional groups for consistency. More... | |
| virtual size_t | getNumberOfFrames () |
| Returns number of frames. More... | |
| virtual OFCondition | read (DcmItem &dataset) |
| Read enhanced multi-frame information from DICOM item, usually DcmDataset, i.e. must contain Shared and Per-frame Functional Group Sequences. More... | |
| virtual OFCondition | write (DcmItem &dataset) |
| Write enhanced multi-frame information to DICOM item, usually DcmDataset, i.e. writes Shared and Per-frame Functional Group Sequences. More... | |
| virtual FGBase * | get (const Uint32 frameNo, const DcmFGTypes::E_FGType fgType) |
| Get specific functional group for a frame, no matter whether it is stored per frame or shared. More... | |
| virtual FGBase * | get (const Uint32 frameNo, const DcmFGTypes::E_FGType fgType, OFBool &isPerFrame) |
| Get specific functional group for a frame, no matter whether it is stored per frame or shared. More... | |
| const FunctionalGroups * | getPerFrame (const Uint32 frameNo) const |
| Return all per-frame functional groups, e.g. to iterate over them. More... | |
| const FunctionalGroups * | getShared () const |
| Return all shared functional groups, e.g. to iterate over them. More... | |
| virtual OFCondition | addShared (const FGBase &group) |
| Add functional group that should be shared for all frames. More... | |
| virtual OFCondition | addPerFrame (const Uint32 frameNo, const FGBase &group) |
| Add functional group for given frame. More... | |
| virtual OFBool | deleteShared (const DcmFGTypes::E_FGType fgType) |
| Deletes a shared functional group of the given type. More... | |
| virtual OFBool | deletePerFrame (const Uint32 frameNo, const DcmFGTypes::E_FGType fgType) |
| Deletes per-frame functional group of the given type for a specific frame. More... | |
| size_t | deletePerFrame (const DcmFGTypes::E_FGType fgType) |
| Deletes per-frame functional group for all frames. More... | |
| size_t | deleteFrame (const Uint32 frameNo) |
| Deletes all functional groups for a specific frame. More... | |
| virtual void | setCheckOnWrite (const OFBool doCheck) |
| If enabled, functional group structure is checked before actual writing is performed in the write() method. More... | |
| virtual OFBool | getCheckOnWrite () |
| Returns whether functional group structure is checked before actual writing is performed in the write() method. More... | |
| virtual void | setUseThreads (const Uint32 numThreads) |
| Sets the maximum number of threads to be used for reading and writing per-frame functional groups. More... | |
| virtual Uint32 | getUseThreads () const |
| Returns the number of threads to be used for writing per-frame functional groups. More... | |
Protected Member Functions | |
| virtual FGBase * | getShared (const DcmFGTypes::E_FGType fgType) |
| Get shared functional group based on its type. More... | |
| virtual OFCondition | insertShared (FGBase *group, const OFBool replaceExisting=OFTrue) |
| Insert shared functional group. More... | |
| virtual FGBase * | getPerFrame (const Uint32 frameNo, const DcmFGTypes::E_FGType fgType) |
| Get per-frame functional group. More... | |
| virtual OFCondition | insertPerFrame (const Uint32 frameNo, FGBase *group, const OFBool replaceExisting=OFTrue) |
| Insert per-frame functional group. More... | |
| virtual FunctionalGroups * | getOrCreatePerFrameGroups (const Uint32 frameNo) |
| Get existing per-frame group or create it for the given frame. More... | |
| virtual OFCondition | readSharedFG (DcmItem &dataset) |
| Read Shared Functional Group Sequence from given item. More... | |
| virtual OFCondition | readPerFrameFG (DcmItem &dataset) |
| Read Per-Frame Functional Group Sequence from given item. More... | |
| virtual OFCondition | writeSharedFG (DcmItem &dataset) |
| Write Shared Functional Group Sequence to given item. More... | |
| virtual OFCondition | writePerFrameFG (DcmItem &dataset) |
| Write Per-Frame Functional Group Sequence to given item. More... | |
| virtual OFCondition | writePerFrameFGParallel (DcmItem &dataset, const Uint32 numThreads) |
| Write Per-Frame Functional Group Sequence to given item in parallel. More... | |
| virtual OFCondition | writePerFrameFGSequential (DcmItem &dataset) |
| Write Per-Frame Functional Group Sequence to given item in sequential mode, i.e. no extra threads are used. More... | |
| virtual OFCondition | convertSharedToPerFrame (const DcmFGTypes::E_FGType fgType) |
| Convert a shared functional group to a per-frame one by copying the shared one into a per-frame one for each frame and deleting the shared one afterwards. More... | |
| virtual Uint32 | findAdequateNumberOfThreads (const Uint32 numFrames, const Uint32 userThreadSetting) |
| Find an adequate number of threads to use for reading and writing per-frame functional groups. More... | |
Static Protected Member Functions | |
| static OFCondition | readSingleFG (DcmItem &fgItem, FunctionalGroups &groups) |
| Read single functional group into the item provided. More... | |
Private Attributes | |
| FunctionalGroups | m_shared |
| Shared functional groups. | |
| PerFrameGroups | m_perFrame |
| Link from frame number (map key) to the list of functional groups (value) relevant for the frame. | |
| OFBool | m_checkOnWrite |
| If enabled, functional group structure is checked on write(). More... | |
| Uint32 | m_numThreads |
| Maximum number of threads to use for reading and writing per-frame functional groups, default is 1 thread (sequential writing). More... | |
Main interface class to access functional groups from DICOM Enhanced objects.
Allows reading, modifying and writing functional groups back and forth from DICOM datasets.
|
virtual |
Add functional group for given frame.
If there is already a shared functional group with identical values, the call returns without errors, too. If there is a shared group that differs, the shared group is converted to be "per-frame" for all frames and then the given group is inserted for the frame specified by the user. If a per-frame functional group of the same type already exists it is overwritten.
| frameNo | The frame number this group should be added for (starts from 0) |
| group | The group to be added. The group is copied when adding, so the ownership stays with the caller, no matter what the method returns. |
|
virtual |
Add functional group that should be shared for all frames.
This will delete all per-frame groups of the same type if existing.
| group | The group to be added. The group is copied. |
|
virtual |
Checks the functional groups for consistency.
The following checks are performed:
|
protectedvirtual |
Convert a shared functional group to a per-frame one by copying the shared one into a per-frame one for each frame and deleting the shared one afterwards.
| fgType | The type of functional group to convert |
| size_t FGInterface::deleteFrame | ( | const Uint32 | frameNo | ) |
Deletes all functional groups for a specific frame.
| frameNo | The frame number whose functional groups should be deleted. First frame is frame 0. |
| size_t FGInterface::deletePerFrame | ( | const DcmFGTypes::E_FGType | fgType | ) |
Deletes per-frame functional group for all frames.
| fgType | The type of functional group to delete |
|
virtual |
Deletes per-frame functional group of the given type for a specific frame.
| frameNo | The frame number for the functional group of interest. First frame is frame 0. |
| fgType | The type of functional group to delete |
|
virtual |
Deletes a shared functional group of the given type.
| fgType | The type of functional group to delete |
|
protectedvirtual |
Find an adequate number of threads to use for reading and writing per-frame functional groups.
The number is adjusted to the number of frames, i.e. there will be no more threads used than one fifth the number of frames (so that each thread must at least handle 5 frames, since otherwise the overhead of starting threads would be too high).
| numFrames | The number of frames to read/write |
| userThreadSetting | The user-defined number of threads to use |
|
virtual |
Get specific functional group for a frame, no matter whether it is stored per frame or shared.
| frameNo | The frame number the functional group should apply to (starts with 0) |
| fgType | The type of functional group to look for |
|
virtual |
Get specific functional group for a frame, no matter whether it is stored per frame or shared.
| frameNo | The frame number of group of interest (starts from 0) |
| fgType | The type of functional group to look for |
| isPerFrame | If OFTrue, the group found was found as per-frame, otherwise it is a shared functional group |
|
virtual |
Returns whether functional group structure is checked before actual writing is performed in the write() method.
|
virtual |
Returns number of frames.
Computed by number of per-frame functional group items (i.e. the Number of Frames attribute is not taken into account).
Referenced by FrameSorterIdentity::sort(), and FrameSorterIPP::sort().
|
protectedvirtual |
Get existing per-frame group or create it for the given frame.
Note that the per-frame groups do not have to be created "in order", i.e. one could add groups in order 3,5,1 ,... .
| frameNo | The frame number to get/create per-frame groups for |
| const FunctionalGroups* FGInterface::getPerFrame | ( | const Uint32 | frameNo | ) | const |
Return all per-frame functional groups, e.g. to iterate over them.
| frameNo | The frame number of the groups of interest (starts from 0) |
|
protectedvirtual |
Get per-frame functional group.
| frameNo | The frame number of the group |
| fgType | The type of the group |
| const FunctionalGroups* FGInterface::getShared | ( | ) | const |
Return all shared functional groups, e.g. to iterate over them.
|
protectedvirtual |
Get shared functional group based on its type.
| fgType | The type of functional group |
|
virtual |
Returns the number of threads to be used for writing per-frame functional groups.
|
protectedvirtual |
Insert per-frame functional group.
| frameNo | The frame number the group should be added for |
| group | The functional group to be inserted |
| replaceExisting | If OFTrue, an existing per-frame functional group will be deleted, otherwise the old group is not overwritten |
|
protectedvirtual |
Insert shared functional group.
| group | The functional group to be inserted |
| replaceExisting | If OFTrue, an existing shared functional group will be deleted, otherwise the old group is not overwritten |
|
virtual |
Read enhanced multi-frame information from DICOM item, usually DcmDataset, i.e. must contain Shared and Per-frame Functional Group Sequences.
| dataset | The item to read from |
|
protectedvirtual |
Read Per-Frame Functional Group Sequence from given item.
| dataset | The item to read from |
|
protectedvirtual |
Read Shared Functional Group Sequence from given item.
| dataset | The item to read from |
|
staticprotected |
Read single functional group into the item provided.
| fgItem | The item to read from |
| groups | The resulting group after reading |
|
virtual |
If enabled, functional group structure is checked before actual writing is performed in the write() method.
Checking might be time consuming on functional groups with many frames, though disabling might result in invalid functional group structures. Disabling should only be done if the user knows that the functional groups are valid, wants to to adapt the functional groups manually after calling write() or knows what he's doing otherwise.
Per default, checking is enabled.
| doCheck | If OFTrue, checking will be performed. If OFFalse, no checks are performed. |
|
virtual |
Sets the maximum number of threads to be used for reading and writing per-frame functional groups.
| numThreads | The maximum number of threads to use The number of threads will be adjusted to the number of frames, i.e. there will be no more threads used than one fifth the number of frames (so that each thread must at least handle 10 frames, since otherwise the overhead of starting threads would be too high). The number is adjusted on the fly. |
|
virtual |
Write enhanced multi-frame information to DICOM item, usually DcmDataset, i.e. writes Shared and Per-frame Functional Group Sequences.
| dataset | The item to write to |
|
protectedvirtual |
Write Per-Frame Functional Group Sequence to given item.
| dataset | The item to write to |
|
protectedvirtual |
Write Per-Frame Functional Group Sequence to given item in parallel.
| dataset | The item to write to |
| numThreads | The maximum number of threads to use |
|
protectedvirtual |
Write Per-Frame Functional Group Sequence to given item in sequential mode, i.e. no extra threads are used.
| dataset | The item to write to |
|
protectedvirtual |
Write Shared Functional Group Sequence to given item.
| dataset | The item to write to |
|
private |
If enabled, functional group structure is checked on write().
Otherwise, checks are skipped.
|
private |
Maximum number of threads to use for reading and writing per-frame functional groups, default is 1 thread (sequential writing).
The number provided by the user will be adjusted to the number of frames, i.e. there will be not more threads used than one fifth the number of frames (so that each thread must at least handle number is adjusted on the fly.