MeVisLab Toolbox Reference
|
Support for structured multi-frame (SMF) DICOM objects. More...
#include <DCMTree_StructuredMF.h>
Public Types | |
enum | { privateGroupId = 0x0041 , dimensionsOffset = 1 , dimensionSequenceOffset = 2 , frameIndexOffset = 3 } |
typedef std::vector< unsigned int > | IndexVector |
Index vector type, ordered as (z, t, u1, u2, ...) | |
Public Member Functions | |
StructuredMF (Const_TreePtr tree) | |
ctor - gets the tree of the DICOM tags for the SMF Use this constructor to access an existing SMF object. | |
StructuredMF (TreePtr tree) | |
ctor - gets the tree of the DICOM tags for the SMF Use this constructor to access an existing writable SMF object The DICOM tags in the new object can be freely modified | |
StructuredMF (TreePtr sharedTagTree, const IndexVector &gridExtent) | |
ctor - create a DICOM SMF object from the tree of common tags, the extent of the logical grid and the tag id's associated with the individual grid dimensions. | |
StructuredMF (TreePtr sharedTagTree, unsigned int depth, unsigned int timePoints=0, unsigned int u1Size=0) | |
Const_TreePtr | tagTree () const |
Return a const pointer to the contained tag tree. | |
TreePtr | tagTree () |
Return a pointer to the contained tag tree. | |
void | setSharedTags (TreePtr tree, bool handleFuncGroups=true) |
Add/replace shared tags with the given tag tree (no copy) | |
Access shared tags | |
TagPtr | sharedTag_rw (TagId tagId) |
Get a writable pointer to the specified shared tag. | |
Const_TagPtr | sharedTag (TagId tagId) const |
Get a const pointer to the specified shared tag. | |
Const_TagPtr | sharedTag (TagId tagId, const std::string &privateCreatorArg, Vr privateVr=UN) const |
Get a const pointer to the specified shared tag with the given private creator and VR. | |
TreePtr | extractSharedTagTree () const |
Extract all DICOM tags valid for all frames (deep copy) | |
Relation between logical grid and DICOM multi-frame structure | |
boost::uint32_t | getGridDimension () const |
Get the dimension of the logical grid (i.e. the number of dimensions) | |
const IndexVector & | getGridExtent () const |
Get the extents of the logical grid (i.e. the size in each dimension) | |
unsigned int | getNumberOfFrames () const |
Get total number of frames. | |
bool | frameExists (const IndexVector &position) const |
Return true if frame at a given grid position exists. | |
void | getEmptyFrames (std::vector< IndexVector > &positions) const |
Fill positions vector with unoccupied logical grid positions, i.e. | |
TreePtr | gridPositionTagTree (IndexVector gridPosition) |
Get a pointer to a specific dimension index tree Create the tree with basic sequence structures if it does not exist but it does not copy tags. | |
Activate support for reading native enhanced multi-frame tags | |
This requires that a native frame index is set (with setFrameIndexForGridPosition) in the per-frame data of the StructuredMF | |
void | setAlsoRegardEnhancedMultiFrameTags (bool flag) |
bool | alsoRegardEnhancedMultiFrameTags () const |
bool | privateTagsAreSet () const |
Return true if the internal private tags have been initialized. | |
Static Public Attributes | |
static std::string | privateCreator |
Private creator string used for storing the StructuredMF info. | |
Access all tags valid for a given grid position | |
enum | ExtractMode { ExtractSharedAndSpecific , ExtractSpecific , ExtractSpecificWithSharedParent } |
Constants for extracting DICOM tags for a given index vector. More... | |
Const_TagPtr | tagForGridPosition (TagId tagId, IndexVector gridPosition) const |
Get a pointer to the specified tag for a given grid position. | |
Const_TagPtr | tagForGridPosition (TagId tagId, unsigned int z, unsigned int t=0, unsigned int u1=0) const |
Const_TagPtr | tagForGridPosition (TagId tagId, IndexVector gridPosition, const std::string &privateCreatorArg, Vr privateVr=UN) const |
Get a pointer to the specified tag for a given index vector or grid position. | |
Const_TagPtr | tagForGridPosition (TagId tagId, const std::string &privateCreatorArg, Vr privateVr, unsigned int z, unsigned int t=0, unsigned int u1=0) const |
int | frameIndexForGridPosition (const IndexVector &gridPosition) const |
Get the frame index of the original image for a given grid position Returns -1 if the slice does not belong to a multi-frame or if the grid position is out of bounds. | |
int | frameIndexForGridPosition (unsigned int z, unsigned int t=0, unsigned int u1=0) const |
TreePtr | extractTagTreeForGridPosition (IndexVector gridPosition, ExtractMode mode=ExtractSharedAndSpecific) const |
Extract all DICOM tags for a given index vector (deep copy) Returns a null pointer if the grid position is out of bounds. | |
TreePtr | extractTagTreeForGridPosition (unsigned int z, unsigned int t=0, unsigned int u1=0, ExtractMode mode=ExtractSharedAndSpecific) const |
void | setTagForGridPosition (TagPtr tag, const IndexVector &gridPosition, const std::string &privateCreatorArg="", bool skipInvalidPrivateTags=true) |
Add/replace specified tag for a given grid position (no copy); if skipInvalidPrivateTags is false then private tags without creator will throw exceptions, otherwise (in true case) they will be skipped without exception. | |
void | setTagForGridPosition (TagPtr tag, unsigned int z, unsigned int t=0, unsigned int u1=0, const std::string &privateCreatorArg="") |
void | setGridPositionSpecificTags (TreePtr tree, const IndexVector &gridPosition, bool skipInvalidPrivateTags=true) |
Add/replace specific tags for a given grid position (no copy); if skipInvalidPrivateTags is false then private tags without creator will throw exceptions, otherwise (in true case) they will be skipped without exception. | |
void | setGridPositionSpecificTags (TreePtr tree, unsigned int z, unsigned int t=0, unsigned int u1=0) |
void | setFrameIndexForGridPosition (unsigned int frameIndex, const IndexVector &gridPosition) |
Set frame index of original image (for MF data only) | |
void | setFrameIndexForGridPosition (unsigned int frameIndex, unsigned int z, unsigned int t=0, unsigned int u1=0) |
Check validity of SMF object | |
enum | StatusCode { OK = 0 , NO_PER_FRAME_TAGS , AMBIGUOUS_TAG , INCONSISTENT_PER_FRAME_TAGS , NUM_STATUS_CODES } |
Status code constants. More... | |
void | normalizeTagStructure (double tolerance=0.0, bool compress=true) |
Make sure all grid position specific tags are consistent: each tag shall exist either for each grid position or as shared tag if compress is true, per frame tags that have the same value for all frames will be replaced by a shared tag. | |
Support for structured multi-frame (SMF) DICOM objects.
An SMF object contains DICOM tags of multiple images that are organized in a multi-dimensional grid (dimensions are depth, time points, and an arbitrary number of user defined dimensions) The grid is represented by hierarchical sequences (one level for each dimension), the highest dimension being at the root level.
Shared tag 1 ... Shared tag N Dimension info tag = 3 \ 2 Dimension sequence -> item 1 - time point 1 specific tags
Definition at line 49 of file DCMTree_StructuredMF.h.
typedef std::vector<unsigned int> DCMTree::StructuredMF::IndexVector |
Index vector type, ordered as (z, t, u1, u2, ...)
Definition at line 54 of file DCMTree_StructuredMF.h.
Enumerator | |
---|---|
privateGroupId | The (fixed) private group in which the StructuredMF info is stored. |
dimensionsOffset | Element offset for number of dimensions. |
dimensionSequenceOffset | Element offset for dimension sequence. |
frameIndexOffset | Element offset for frame index. |
Definition at line 60 of file DCMTree_StructuredMF.h.
Constants for extracting DICOM tags for a given index vector.
Definition at line 131 of file DCMTree_StructuredMF.h.
Status code constants.
Definition at line 167 of file DCMTree_StructuredMF.h.
DCMTree::StructuredMF::StructuredMF | ( | Const_TreePtr | tree | ) |
ctor - gets the tree of the DICOM tags for the SMF Use this constructor to access an existing SMF object.
Make sure that the DICOM tags defining the SMF structure are not modified during the lifetime of this object.
DCMTree::StructuredMF::StructuredMF | ( | TreePtr | tree | ) |
ctor - gets the tree of the DICOM tags for the SMF Use this constructor to access an existing writable SMF object The DICOM tags in the new object can be freely modified
DCMTree::StructuredMF::StructuredMF | ( | TreePtr | sharedTagTree, |
const IndexVector & | gridExtent ) |
ctor - create a DICOM SMF object from the tree of common tags, the extent of the logical grid and the tag id's associated with the individual grid dimensions.
DCMTree::StructuredMF::StructuredMF | ( | TreePtr | sharedTagTree, |
unsigned int | depth, | ||
unsigned int | timePoints = 0, | ||
unsigned int | u1Size = 0 ) |
|
inline |
Definition at line 222 of file DCMTree_StructuredMF.h.
TreePtr DCMTree::StructuredMF::extractSharedTagTree | ( | ) | const |
Extract all DICOM tags valid for all frames (deep copy)
TreePtr DCMTree::StructuredMF::extractTagTreeForGridPosition | ( | IndexVector | gridPosition, |
ExtractMode | mode = ExtractSharedAndSpecific ) const |
Extract all DICOM tags for a given index vector (deep copy) Returns a null pointer if the grid position is out of bounds.
TreePtr DCMTree::StructuredMF::extractTagTreeForGridPosition | ( | unsigned int | z, |
unsigned int | t = 0, | ||
unsigned int | u1 = 0, | ||
ExtractMode | mode = ExtractSharedAndSpecific ) const |
bool DCMTree::StructuredMF::frameExists | ( | const IndexVector & | position | ) | const |
Return true if frame at a given grid position exists.
int DCMTree::StructuredMF::frameIndexForGridPosition | ( | const IndexVector & | gridPosition | ) | const |
Get the frame index of the original image for a given grid position Returns -1 if the slice does not belong to a multi-frame or if the grid position is out of bounds.
int DCMTree::StructuredMF::frameIndexForGridPosition | ( | unsigned int | z, |
unsigned int | t = 0, | ||
unsigned int | u1 = 0 ) const |
void DCMTree::StructuredMF::getEmptyFrames | ( | std::vector< IndexVector > & | positions | ) | const |
Fill positions vector with unoccupied logical grid positions, i.e.
positions for which no frame data has been set.
boost::uint32_t DCMTree::StructuredMF::getGridDimension | ( | ) | const |
Get the dimension of the logical grid (i.e. the number of dimensions)
All frames in a structured multi-frame (SMF) object are located at different positions in a logical, multi-dimensional grid. By convention, this grid has a spatial dimension (z), a time dimension (t), and optionally additional user dimensions (u1, u2, ...).
const IndexVector & DCMTree::StructuredMF::getGridExtent | ( | ) | const |
Get the extents of the logical grid (i.e. the size in each dimension)
TreePtr DCMTree::StructuredMF::gridPositionTagTree | ( | IndexVector | gridPosition | ) |
Get a pointer to a specific dimension index tree Create the tree with basic sequence structures if it does not exist but it does not copy tags.
Make sure all grid position specific tags are consistent: each tag shall exist either for each grid position or as shared tag if compress is true, per frame tags that have the same value for all frames will be replaced by a shared tag.
bool DCMTree::StructuredMF::privateTagsAreSet | ( | ) | const |
Return true if the internal private tags have been initialized.
Definition at line 221 of file DCMTree_StructuredMF.h.
References mlrange_cast().
void DCMTree::StructuredMF::setFrameIndexForGridPosition | ( | unsigned int | frameIndex, |
const IndexVector & | gridPosition ) |
Set frame index of original image (for MF data only)
DCMTree::Exception | if the grid position is out of bounds |
void DCMTree::StructuredMF::setFrameIndexForGridPosition | ( | unsigned int | frameIndex, |
unsigned int | z, | ||
unsigned int | t = 0, | ||
unsigned int | u1 = 0 ) |
void DCMTree::StructuredMF::setGridPositionSpecificTags | ( | TreePtr | tree, |
const IndexVector & | gridPosition, | ||
bool | skipInvalidPrivateTags = true ) |
Add/replace specific tags for a given grid position (no copy); if skipInvalidPrivateTags is false then private tags without creator will throw exceptions, otherwise (in true case) they will be skipped without exception.
DCMTree::Exception | if the grid position is out of bounds |
void DCMTree::StructuredMF::setGridPositionSpecificTags | ( | TreePtr | tree, |
unsigned int | z, | ||
unsigned int | t = 0, | ||
unsigned int | u1 = 0 ) |
Add/replace shared tags with the given tag tree (no copy)
void DCMTree::StructuredMF::setTagForGridPosition | ( | TagPtr | tag, |
const IndexVector & | gridPosition, | ||
const std::string & | privateCreatorArg = "", | ||
bool | skipInvalidPrivateTags = true ) |
Add/replace specified tag for a given grid position (no copy); if skipInvalidPrivateTags is false then private tags without creator will throw exceptions, otherwise (in true case) they will be skipped without exception.
If the private creator for the private tag does not exist yet, it will also be set.
DCMTree::Exception | if the grid position is out of bounds |
void DCMTree::StructuredMF::setTagForGridPosition | ( | TagPtr | tag, |
unsigned int | z, | ||
unsigned int | t = 0, | ||
unsigned int | u1 = 0, | ||
const std::string & | privateCreatorArg = "" ) |
Const_TagPtr DCMTree::StructuredMF::sharedTag | ( | TagId | tagId | ) | const |
Get a const pointer to the specified shared tag.
Const_TagPtr DCMTree::StructuredMF::sharedTag | ( | TagId | tagId, |
const std::string & | privateCreatorArg, | ||
Vr | privateVr = UN ) const |
Get a const pointer to the specified shared tag with the given private creator and VR.
Get a writable pointer to the specified shared tag.
Returns only tags which are found by using the TagSelector "Owned". Parent tags are omitted.
Const_TagPtr DCMTree::StructuredMF::tagForGridPosition | ( | TagId | tagId, |
const std::string & | privateCreatorArg, | ||
Vr | privateVr, | ||
unsigned int | z, | ||
unsigned int | t = 0, | ||
unsigned int | u1 = 0 ) const |
Const_TagPtr DCMTree::StructuredMF::tagForGridPosition | ( | TagId | tagId, |
IndexVector | gridPosition ) const |
Get a pointer to the specified tag for a given grid position.
Returns a null pointer if no tag is found or the grid position is out of bounds
Const_TagPtr DCMTree::StructuredMF::tagForGridPosition | ( | TagId | tagId, |
IndexVector | gridPosition, | ||
const std::string & | privateCreatorArg, | ||
Vr | privateVr = UN ) const |
Get a pointer to the specified tag for a given index vector or grid position.
If the tag is a private tag, the private creator is used for the lookup, and the vr is set if not known. Returns a null pointer if no tag is found or the grid position is out of bounds
Const_TagPtr DCMTree::StructuredMF::tagForGridPosition | ( | TagId | tagId, |
unsigned int | z, | ||
unsigned int | t = 0, | ||
unsigned int | u1 = 0 ) const |
TreePtr DCMTree::StructuredMF::tagTree | ( | ) |
Return a pointer to the contained tag tree.
Const_TreePtr DCMTree::StructuredMF::tagTree | ( | ) | const |
Return a const pointer to the contained tag tree.
|
static |
Private creator string used for storing the StructuredMF info.
Definition at line 57 of file DCMTree_StructuredMF.h.