DCMTK
Version 3.6.7
OFFIS DICOM Toolkit
|
Main interface class to access functional groups from DICOM Enhanced objects. 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... | |
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 | readSingleFG (DcmItem &fgItem, FunctionalGroups &groups) |
Read single functional group into the item provided. 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 | 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 aftewrards. 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... | |
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 aftewrards.
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 |
|
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).
|
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 |
|
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 |
|
protectedvirtual |
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 |
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 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.