DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FGInterface Class Reference

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 FGBaseget (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 FGBaseget (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 FunctionalGroupsgetPerFrame (const Uint32 frameNo) const
 Return all per-frame functional groups, e.g. to iterate over them. More...
 
const FunctionalGroupsgetShared () 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...
 

Protected Member Functions

virtual FGBasegetShared (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 FGBasegetPerFrame (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 FunctionalGroupsgetOrCreatePerFrameGroups (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.
 

Detailed Description

Main interface class to access functional groups from DICOM Enhanced objects.

Allows reading, modifying and writing functional groups back and forth from DICOM datasets.

Member Function Documentation

◆ addPerFrame()

virtual OFCondition FGInterface::addPerFrame ( const Uint32  frameNo,
const FGBase group 
)
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.

Parameters
frameNoThe frame number this group should be added for (starts from 0)
groupThe group to be added. The group is copied when adding, so the ownership stays with the caller, no matter what the method returns.
Returns
EC_Normal, if adding was successful, error otherwise

◆ addShared()

virtual OFCondition FGInterface::addShared ( const FGBase group)
virtual

Add functional group that should be shared for all frames.

This will delete all per-frame groups of the same type if existing.

Parameters
groupThe group to be added. The group is copied.
Returns
EC_Normal, if adding was successful, error otherwise

◆ check()

virtual OFBool FGInterface::check ( )
virtual

Checks the functional groups for consistency.

Returns
OFTrue, if check consistency is ok, error otherwise

◆ convertSharedToPerFrame()

virtual OFCondition FGInterface::convertSharedToPerFrame ( const DcmFGTypes::E_FGType  fgType)
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.

Parameters
fgTypeThe type of functional group to convert
Returns
EC_Normal if conversion worked out, FG_EC_NoSuchGroup if such a group does not exist and other error otherwise. In the last case the functional groups may be left in invalid state, but that should only happen for fatal errors like exhausted memory.

◆ deleteFrame()

size_t FGInterface::deleteFrame ( const Uint32  frameNo)

Deletes all functional groups for a specific frame.

Parameters
frameNoThe frame number whose functional groups should be deleted. First frame is frame 0.
Returns
Number of per-frame groups deleted for this frame

◆ deletePerFrame() [1/2]

virtual OFBool FGInterface::deletePerFrame ( const Uint32  frameNo,
const DcmFGTypes::E_FGType  fgType 
)
virtual

Deletes per-frame functional group of the given type for a specific frame.

Parameters
frameNoThe frame number for the functional group of interest. First frame is frame 0.
fgTypeThe type of functional group to delete
Returns
OFTrue if group existed and could be deleted, OFFalse (group did not exist) otherwise

◆ deletePerFrame() [2/2]

size_t FGInterface::deletePerFrame ( const DcmFGTypes::E_FGType  fgType)

Deletes per-frame functional group for all frames.

Parameters
fgTypeThe type of functional group to delete
Returns
Number of per-frame groups deleted (usually equal to number of frames)

◆ deleteShared()

virtual OFBool FGInterface::deleteShared ( const DcmFGTypes::E_FGType  fgType)
virtual

Deletes a shared functional group of the given type.

Parameters
fgTypeThe type of functional group to delete
Returns
OFTrue if group existed and could be deleted, OFFalse (group did not exist) otherwise

◆ get() [1/2]

virtual FGBase* FGInterface::get ( const Uint32  frameNo,
const DcmFGTypes::E_FGType  fgType 
)
virtual

Get specific functional group for a frame, no matter whether it is stored per frame or shared.

Parameters
frameNoThe frame number the functional group should apply to (starts with 0)
fgTypeThe type of functional group to look for
Returns
The functional group if found, NULL otherwise

◆ get() [2/2]

virtual FGBase* FGInterface::get ( const Uint32  frameNo,
const DcmFGTypes::E_FGType  fgType,
OFBool isPerFrame 
)
virtual

Get specific functional group for a frame, no matter whether it is stored per frame or shared.

Parameters
frameNoThe frame number of group of interest (starts from 0)
fgTypeThe type of functional group to look for
isPerFrameIf OFTrue, the group found was found as per-frame, otherwise it is a shared functional group
Returns
The functional group if found, error otherwise

◆ getNumberOfFrames()

virtual size_t FGInterface::getNumberOfFrames ( )
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).

Returns
Number of frames

◆ getOrCreatePerFrameGroups()

virtual FunctionalGroups* FGInterface::getOrCreatePerFrameGroups ( const Uint32  frameNo)
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 ,... .

Parameters
frameNoThe frame number to get/create per-frame groups for
Returns
The functional groups if found/created, NULL in case of error

◆ getPerFrame() [1/2]

const FunctionalGroups* FGInterface::getPerFrame ( const Uint32  frameNo) const

Return all per-frame functional groups, e.g. to iterate over them.

Parameters
frameNoThe frame number of the groups of interest (starts from 0)
Returns
The per-frame functional groups for the given frame

◆ getPerFrame() [2/2]

virtual FGBase* FGInterface::getPerFrame ( const Uint32  frameNo,
const DcmFGTypes::E_FGType  fgType 
)
protectedvirtual

Get per-frame functional group.

Parameters
frameNoThe frame number of the group
fgTypeThe type of the group
Returns
The functional group or NULL if not existent

◆ getShared() [1/2]

const FunctionalGroups* FGInterface::getShared ( ) const

Return all shared functional groups, e.g. to iterate over them.

Returns
The shared functional groups

◆ getShared() [2/2]

virtual FGBase* FGInterface::getShared ( const DcmFGTypes::E_FGType  fgType)
protectedvirtual

Get shared functional group based on its type.

Parameters
fgTypeThe type of functional group
Returns
The functional group or NULL if not existent

◆ insertPerFrame()

virtual OFCondition FGInterface::insertPerFrame ( const Uint32  frameNo,
FGBase group,
const OFBool  replaceExisting = OFTrue 
)
protectedvirtual

Insert per-frame functional group.

Parameters
frameNoThe frame number the group should be added for
groupThe functional group to be inserted
replaceExistingIf OFTrue, an existing per-frame functional group will be deleted, otherwise the old group is not overwritten
Returns
EC_Normal if insertion worked, FG_EC_DoubledFG if group exists and is not overwritten, other error code for other cases

◆ insertShared()

virtual OFCondition FGInterface::insertShared ( FGBase group,
const OFBool  replaceExisting = OFTrue 
)
protectedvirtual

Insert shared functional group.

Parameters
groupThe functional group to be inserted
replaceExistingIf OFTrue, an existing shared functional group will be deleted, otherwise the old group is not overwritten
Returns
EC_Normal if insertion worked, FG_EC_DoubledFG if group exists and is not overwritten, other error code for other cases

◆ read()

virtual OFCondition FGInterface::read ( DcmItem dataset)
virtual

Read enhanced multi-frame information from DICOM item, usually DcmDataset, i.e. must contain Shared and Per-frame Functional Group Sequences.

Parameters
datasetThe item to read from
Returns
EC_Normal if reading was successful, error otherwise

◆ readPerFrameFG()

virtual OFCondition FGInterface::readPerFrameFG ( DcmItem dataset)
protectedvirtual

Read Per-Frame Functional Group Sequence from given item.

Parameters
datasetThe item to read from
Returns
EC_Normal if reading was successful, error otherwise

◆ readSharedFG()

virtual OFCondition FGInterface::readSharedFG ( DcmItem dataset)
protectedvirtual

Read Shared Functional Group Sequence from given item.

Parameters
datasetThe item to read from
Returns
EC_Normal if reading was successful, error otherwise

◆ readSingleFG()

virtual OFCondition FGInterface::readSingleFG ( DcmItem fgItem,
FunctionalGroups groups 
)
protectedvirtual

Read single functional group into the item provided.

Parameters
fgItemThe item to read from
groupsThe resulting group after reading
Returns
EC_Normal if reading was successful, error otherwise

◆ write()

virtual OFCondition FGInterface::write ( DcmItem dataset)
virtual

Write enhanced multi-frame information to DICOM item, usually DcmDataset, i.e. writes Shared and Per-frame Functional Group Sequences.

Parameters
datasetThe item to write to
Returns
EC_Normal if successful, error otherwise

◆ writePerFrameFG()

virtual OFCondition FGInterface::writePerFrameFG ( DcmItem dataset)
protectedvirtual

Write Per-Frame Functional Group Sequence to given item.

Parameters
datasetThe item to write to
Returns
EC_Normal if writing was successful, error otherwise

◆ writeSharedFG()

virtual OFCondition FGInterface::writeSharedFG ( DcmItem dataset)
protectedvirtual

Write Shared Functional Group Sequence to given item.

Parameters
datasetThe item to write to
Returns
EC_Normal if writing was successful, error otherwise

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


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13