Key Object Reports and accessing image references

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
canonrad
Posts: 8
Joined: Thu, 2006-03-09, 22:35
Location: USA
Contact:

Key Object Reports and accessing image references

#1 Post by canonrad »

If I have a key Object report or any SR, is there a way to parse out the image references? DSRDocument tree has the gotoNamedNode function, but I didn't think image references had names. I thought about using getNextNode of goToNext, but there is no guarantee that the node would be an image node.
Any suggestions?
Lance
http://osirixmac.com

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

You could e.g. use iterate() and then check the value type using getValueType().

The following code snippet from the dcmsr module shows how this approach basically works:

Code: Select all

void DSRDocumentTree::unmarkAllContentItems()
{
    DSRTreeNodeCursor cursor(getRoot());
    if (cursor.isValid())
    {
        DSRDocumentTreeNode *node = NULL;
        /* iterate over all nodes */
        do {
            node = OFstatic_cast(DSRDocumentTreeNode *, cursor.getNode());
            if (node != NULL)
                node->setMark(OFFalse);
        } while (cursor.iterate());
    }
}
Also see examples section in the documentation for how to access the content tree of an SR document.

Btw, I guess it could be useful to write a wrapper class for accessing Key Object Selection Documents or to write a new helper function similar to gotoNamedNode() that allows for going to nodes of a particular value type. This shouldn't be too difficult.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest