Class StructuredReport
- All Implemented Interfaces:
TreeModel
The StructuredReport
class implements a
TreeModel
to abstract the contents of a list of attributes
representing a DICOM Structured Report as
a tree in order to provide support for a StructuredReportBrowser
.
For details of some of the methods implemented here see javax.swing.tree.TreeModel
.
A main method is provided for testing that reads a DICOM file containing an SR and dumps its contents in a human-readable form to System.err.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an internal tree representation of a structured report from a list of DICOM attributes.StructuredReport
(ContentItem root) Construct an internal tree representation of a structured report from an existing root content item. -
Method Summary
Modifier and TypeMethodDescriptionvoid
static Vector
findAllContainedSOPInstances
(ContentItem root, ContentItem item) Find all coordinate and image references within content items of the sub-tree rooted at the specified node (which may be the root).Return the entire content tree of a structured report as anAttributeList
.int
getChildCount
(Object parent) int
getIndexOfChild
(Object parent, Object child) getRoot()
boolean
static void
Dump the SR encoded in the file name on the console.void
toString()
Dump the entire tree as aString
.void
valueForPathChanged
(TreePath path, Object newValue) static String
walkTreeBuldingString
(ContentItem node, String location) Dump the tree starting at the specified node as aString
.
-
Constructor Details
-
StructuredReport
Construct an internal tree representation of a structured report from a list of DICOM attributes.
- Parameters:
list
- the list of attributes in which the structured report is encoded- Throws:
DicomException
-
StructuredReport
Construct an internal tree representation of a structured report from an existing root content item.
- Parameters:
root
- the root content item- Throws:
DicomException
-
-
Method Details
-
getChild
-
getIndexOfChild
- Specified by:
getIndexOfChild
in interfaceTreeModel
- Parameters:
parent
-child
-
-
getRoot
-
getChildCount
- Specified by:
getChildCount
in interfaceTreeModel
- Parameters:
parent
-
-
isLeaf
-
valueForPathChanged
- Specified by:
valueForPathChanged
in interfaceTreeModel
- Parameters:
path
-newValue
-
-
addTreeModelListener
- Specified by:
addTreeModelListener
in interfaceTreeModel
- Parameters:
tml
-
-
removeTreeModelListener
- Specified by:
removeTreeModelListener
in interfaceTreeModel
- Parameters:
tml
-
-
getAttributeList
Return the entire content tree of a structured report as an
AttributeList
.Has the side effect of creating (or replacing) the ContentSequence attributes of the
AttributeList
of eachContentItem
to represent the tree structure.- Returns:
- a
AttributeList
representing the content tree, or null if empty root.
-
walkTreeBuldingString
Dump the tree starting at the specified node as a
String
.- Parameters:
node
-location
- the dotted numeric string describing the location of the starting node- Returns:
- a multi-line
String
representing the tree fragment
-
toString
Dump the entire tree as a
String
. -
findAllContainedSOPInstances
Find all coordinate and image references within content items of the sub-tree rooted at the specified node (which may be the root).
The annotation of the reference is derived from the value of the Concept Name of the parent (and its parent, if a NUM content item).
- Parameters:
root
- the root node, for dereferencing by-reference relationshipsitem
- the node to start searching from- Returns:
- a
Vector
ofSpatialCoordinateAndImageReference
-
main
Dump the SR encoded in the file name on the console.
- Parameters:
arg
-
-