Class StructuredReport
- java.lang.Object
-
- com.pixelmed.dicom.StructuredReport
-
- All Implemented Interfaces:
javax.swing.tree.TreeModel
public class StructuredReport extends java.lang.Object implements javax.swing.tree.TreeModelThe
StructuredReportclass implements aTreeModelto abstract the contents of a list of attributes representing a DICOM Structured Report as a tree in order to provide support for aStructuredReportBrowser.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:
ContentItem,ContentItemFactory,StructuredReportBrowser
-
-
Constructor Summary
Constructors Constructor Description StructuredReport(AttributeList list)Construct 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTreeModelListener(javax.swing.event.TreeModelListener tml)static java.util.VectorfindAllContainedSOPInstances(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).AttributeListgetAttributeList()Return the entire content tree of a structured report as anAttributeList.java.lang.ObjectgetChild(java.lang.Object node, int index)intgetChildCount(java.lang.Object parent)intgetIndexOfChild(java.lang.Object parent, java.lang.Object child)java.lang.ObjectgetRoot()booleanisLeaf(java.lang.Object node)static voidmain(java.lang.String[] arg)Dump the SR encoded in the file name on the console.voidremoveTreeModelListener(javax.swing.event.TreeModelListener tml)java.lang.StringtoString()Dump the entire tree as aString.voidvalueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)static java.lang.StringwalkTreeBuldingString(ContentItem node, java.lang.String location)Dump the tree starting at the specified node as aString.
-
-
-
Constructor Detail
-
StructuredReport
public StructuredReport(AttributeList list) throws DicomException
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
public StructuredReport(ContentItem root) throws DicomException
Construct an internal tree representation of a structured report from an existing root content item.
- Parameters:
root- the root content item- Throws:
DicomException
-
-
Method Detail
-
getChild
public java.lang.Object getChild(java.lang.Object node, int index)- Specified by:
getChildin interfacejavax.swing.tree.TreeModel- Parameters:
node-index-
-
getIndexOfChild
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)- Specified by:
getIndexOfChildin interfacejavax.swing.tree.TreeModel- Parameters:
parent-child-
-
getRoot
public java.lang.Object getRoot()
- Specified by:
getRootin interfacejavax.swing.tree.TreeModel
-
getChildCount
public int getChildCount(java.lang.Object parent)
- Specified by:
getChildCountin interfacejavax.swing.tree.TreeModel- Parameters:
parent-
-
isLeaf
public boolean isLeaf(java.lang.Object node)
- Specified by:
isLeafin interfacejavax.swing.tree.TreeModel- Parameters:
node-
-
valueForPathChanged
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)- Specified by:
valueForPathChangedin interfacejavax.swing.tree.TreeModel- Parameters:
path-newValue-
-
addTreeModelListener
public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
- Specified by:
addTreeModelListenerin interfacejavax.swing.tree.TreeModel- Parameters:
tml-
-
removeTreeModelListener
public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
- Specified by:
removeTreeModelListenerin interfacejavax.swing.tree.TreeModel- Parameters:
tml-
-
getAttributeList
public AttributeList 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
AttributeListof eachContentItemto represent the tree structure.- Returns:
- a
AttributeListrepresenting the content tree, or null if empty root.
-
walkTreeBuldingString
public static java.lang.String walkTreeBuldingString(ContentItem node, java.lang.String location)
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
Stringrepresenting the tree fragment
-
toString
public java.lang.String toString()
Dump the entire tree as a
String.- Overrides:
toStringin classjava.lang.Object- Returns:
- a multi-line
Stringrepresenting the tree
-
findAllContainedSOPInstances
public static java.util.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).
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
VectorofSpatialCoordinateAndImageReference
-
main
public static void main(java.lang.String[] arg)
Dump the SR encoded in the file name on the console.
- Parameters:
arg-
-
-