13#ifndef DCM_TREE_STRUCTURED_MF_H
14#define DCM_TREE_STRUCTURED_MF_H
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
61 privateGroupId = 0x0041,
64 dimensionSequenceOffset = 2,
134 ExtractSpecificWithSharedParent
141 ExtractMode mode = ExtractSharedAndSpecific )
const;
232 void clearPrivateTags();
234 void createPrivateCreatorTag();
236 bool isPrivateTagId (
const TagId &tagId)
const;
241 TagInfo dimensionGroupTagInfo();
245 TagInfo defaultCreatorTagInfo();
254 void setDimensionsTag();
259 IndexVector indexVectorFromIndexes(
unsigned int z,
unsigned int t,
unsigned int u1 )
const;
281 TagId _creatorId, _privateBaseId, _dimensionsId, _dimensionSequenceId, _frameIndexId;
284 bool _alsoRegardEnhancedMultiFrameTags{};
289 #pragma warning (pop)
Support for structured multi-frame (SMF) DICOM objects.
Const_TagPtr sharedTag(TagId tagId) const
Get a const pointer to the specified shared tag.
void setTagForGridPosition(TagPtr tag, unsigned int z, unsigned int t=0, unsigned int u1=0, const std::string &privateCreatorArg="")
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 positi...
Const_TreePtr tagTree() const
Return a const pointer to the contained tag tree.
bool frameExists(const IndexVector &position) const
Return true if frame at a given grid position exists.
bool privateTagsAreSet() const
Return true if the internal private tags have been initialized.
void setGridPositionSpecificTags(TreePtr tree, unsigned int z, unsigned int t=0, unsigned int u1=0)
Const_TagPtr tagForGridPosition(TagId tagId, IndexVector gridPosition) const
Get a pointer to the specified tag for a given grid position.
StatusCode
Status code constants.
@ NO_PER_FRAME_TAGS
A per-frame tag list is empty.
@ INCONSISTENT_PER_FRAME_TAGS
The per-frame tag lists define different sets of tags.
void setFrameIndexForGridPosition(unsigned int frameIndex, unsigned int z, unsigned int t=0, unsigned int u1=0)
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 p...
int frameIndexForGridPosition(unsigned int z, unsigned int t=0, unsigned int u1=0) const
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 the...
Const_TagPtr tagForGridPosition(TagId tagId, unsigned int z, unsigned int t=0, unsigned int u1=0) const
const IndexVector & getGridExtent() const
Get the extents of the logical grid (i.e. the size in each dimension)
void getEmptyFrames(std::vector< IndexVector > &positions) const
Fill positions vector with unoccupied logical grid positions, i.e.
boost::uint32_t getGridDimension() const
Get the dimension of the logical grid (i.e. the number of dimensions)
TreePtr extractTagTreeForGridPosition(unsigned int z, unsigned int t=0, unsigned int u1=0, ExtractMode mode=ExtractSharedAndSpecific) const
static std::string privateCreator
Private creator string used for storing the StructuredMF info.
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.
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 ...
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)
std::vector< unsigned int > IndexVector
Index vector type, ordered as (z, t, u1, u2, ...)
Const_TagPtr tagForGridPosition(TagId tagId, const std::string &privateCreatorArg, Vr privateVr, unsigned int z, unsigned int t=0, unsigned int u1=0) const
StructuredMF(Const_TreePtr tree)
ctor - gets the tree of the DICOM tags for the SMF Use this constructor to access an existing SMF obj...
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.
TreePtr gridPositionTagTree(IndexVector gridPosition)
Get a pointer to a specific dimension index tree Create the tree with basic sequence structures if it...
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 the...
StructuredMF(TreePtr tree)
ctor - gets the tree of the DICOM tags for the SMF Use this constructor to access an existing writabl...
TagPtr sharedTag_rw(TagId tagId)
Get a writable pointer to the specified shared tag.
TreePtr extractSharedTagTree() const
Extract all DICOM tags valid for all frames (deep copy)
void setAlsoRegardEnhancedMultiFrameTags(bool flag)
void setFrameIndexForGridPosition(unsigned int frameIndex, const IndexVector &gridPosition)
Set frame index of original image (for MF data only)
bool alsoRegardEnhancedMultiFrameTags() const
ExtractMode
Constants for extracting DICOM tags for a given index vector.
@ ExtractSharedAndSpecific
Shared and frame-specific tags are copied to new tree.
@ ExtractSpecific
Only frame-specific tags are copied to new tree.
unsigned int getNumberOfFrames() const
Get total number of frames.
StructuredMF(TreePtr sharedTagTree, unsigned int depth, unsigned int timePoints=0, unsigned int u1Size=0)
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...
Class to carry meta-information about a specific tag.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
class to dump a DCMTree dicom message into a human readable file this class could be used as a starte...
boost::shared_ptr< const Tag > Const_TagPtr
boost::shared_ptr< const Tree > Const_TreePtr
boost::shared_ptr< Tag > TagPtr
shared-pointer to tag
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree