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,
85 unsigned int timePoints = 0,
unsigned int u1Size = 0);
134 ExtractSpecificWithSharedParent
141 ExtractMode mode = ExtractSharedAndSpecific )
const;
230 bool initPrivateTagIds(
bool newOrExisting);
232 void clearPrivateTags();
234 void createPrivateCreatorTag();
236 bool isPrivateTagId (
const TagId &tagId)
const;
241 TagInfo dimensionGroupTagInfo();
245 TagInfo defaultCreatorTagInfo();
248 void normalizeTagStructure(
TreePtr dimTree,
double tolerance,
bool compress );
252 void createDimensionSubtree(
TagPtr parentSeq,
int index);
254 void setDimensionsTag();
259 IndexVector indexVectorFromIndexes(
unsigned int z,
unsigned int t,
unsigned int u1 )
const;
267 bool checkGridPosition(
const IndexVector &gridPosition)
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
Returns 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).
const IndexVector & getGridExtent() const
Returns the extents of the logical grid (i.e., the size in each dimension).
Const_TreePtr tagTree() const
Returns a const pointer to the contained tag tree.
bool frameExists(const IndexVector &position) const
Returns true if frame at a given grid position exists.
bool privateTagsAreSet() const
Returns 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
Returns 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)
Makes sure all grid position specific tags are consistent: each tag shall exist either for each grid ...
int frameIndexForGridPosition(unsigned int z, unsigned int t=0, unsigned int u1=0) const
void setGridPositionSpecificTags(TreePtr tree, const IndexVector &gridPosition, bool skipInvalidPrivateTags=true)
Adds/replaces specific tags for a given grid position (no copy); if skipInvalidPrivateTags is false,...
Const_TagPtr tagForGridPosition(TagId tagId, unsigned int z, unsigned int t=0, unsigned int u1=0) const
void getEmptyFrames(std::vector< IndexVector > &positions) const
Fills positions vector with unoccupied logical grid positions, i.e., positions for which no frame dat...
boost::uint32_t getGridDimension() const
Returns 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 information.
Const_TagPtr sharedTag(TagId tagId, const std::string &privateCreatorArg, Vr privateVr=UN) const
Returns a const pointer to the specified shared tag with the given private creator and VR.
int frameIndexForGridPosition(const IndexVector &gridPosition) const
Returns the frame index of the original image for a given grid position.
TreePtr tagTree()
Returns a pointer to the contained tag tree.
void setSharedTags(TreePtr tree, bool handleFuncGroups=true)
Adds/replaces 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)
Constructor.
Const_TagPtr tagForGridPosition(TagId tagId, IndexVector gridPosition, const std::string &privateCreatorArg, Vr privateVr=UN) const
Returns a pointer to the specified tag for a given index vector or grid position.
TreePtr gridPositionTagTree(IndexVector gridPosition)
Returns a pointer to a specific dimension index tree.
void setTagForGridPosition(TagPtr tag, const IndexVector &gridPosition, const std::string &privateCreatorArg="", bool skipInvalidPrivateTags=true)
Adds/replaces specified tag for a given grid position (no copy); if skipInvalidPrivateTags is false,...
StructuredMF(TreePtr tree)
Constructor.
TagPtr sharedTag_rw(TagId tagId)
Returns a writable pointer to the specified shared tag.
TreePtr extractSharedTagTree() const
Extracts all DICOM tags valid for all frames (deep copy).
void setAlsoRegardEnhancedMultiFrameTags(bool flag)
void setFrameIndexForGridPosition(unsigned int frameIndex, const IndexVector &gridPosition)
Sets 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
Returns total number of frames.
StructuredMF(TreePtr sharedTagTree, unsigned int depth, unsigned int timePoints=0, unsigned int u1Size=0)
StructuredMF(TreePtr sharedTagTree, const IndexVector &gridExtent)
Constructor.
Class to carry meta information about a specific tag.
Class to dump a DCMTree DICOM message into a human-readable file.
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.