public class CompositeInstanceContext
extends java.lang.Object
A class for representing the attributes of general modules that describe the patient, study, series, instance and related "context" of the payload of a composite DICOM instance.
The purpose is to allow the context to be extracted from an existing object, stored, and then reused in new objects, either wholly or partially, by selectively removing modules for lower level information entities as appropriate. E.g.:
CompositeInstanceContext cic = new CompositeInstanceContext(srcList,false); cic.removeInstance(); cic.removeSeries(); cic.removeEquipment(); dstList.putAll(cic.getAttributeList());
Static methods are also provided for operating directly on an AttributeList.
| Modifier and Type | Field and Description |
|---|---|
protected static AttributeTag[] |
clinicalTrialSubjectModuleAttributeTags |
protected static AttributeTag[] |
frameOfReferenceModuleAttributeTags |
protected static AttributeTag[] |
generalEquipmentModuleAttributeTags |
protected static AttributeTag[] |
generalImageModuleAttributeTags |
protected static AttributeTag[] |
generalSeriesModuleAttributeTags |
protected static AttributeTag[] |
generalStudyModuleAttributeTags |
protected AttributeList |
list |
protected static AttributeTag[] |
patientModuleAttributeTags |
protected static AttributeTag[] |
patientStudyModuleAttributeTags |
protected static AttributeTag[] |
sopCommonModuleAttributeTags |
protected static AttributeTag[] |
srDocumentGeneralModuleAttributeTags |
| Constructor and Description |
|---|
CompositeInstanceContext() |
CompositeInstanceContext(AttributeList srcList)
Deprecated.
use
CompositeInstanceContext(AttributeList,boolean) instead |
CompositeInstanceContext(AttributeList srcList,
boolean forSR)
Create the composite context module
Attributes with values from the supplied AttributeList. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList,
AttributeTag tag) |
protected void |
createPerformedProcedureCodeSequenceIfAbsent(AttributeList srcList) |
protected void |
createReferencedRequestSequenceIfAbsent(AttributeList srcList) |
boolean |
equals(java.lang.Object o) |
AttributeList |
getAttributeList()
Return the
AttributeList of all the Attributes in the context. |
int |
hashCode() |
void |
put(Attribute a) |
void |
putAll(AttributeList srcList) |
void |
removeAllButPatient()
See
removeAllButPatient. |
static void |
removeAllButPatient(AttributeList list)
Remove the study, series, equipment, frame of reference and instance level module
Attributes. |
void |
removeAllButPatientAndStudy()
|
static void |
removeAllButPatientAndStudy(AttributeList list)
Remove the series, equipment, frame of reference and instance level module
Attributes. |
void |
removeEquipment()
See
removeEquipment. |
static void |
removeEquipment(AttributeList list)
Remove the General Equipment module
Attributes. |
void |
removeFrameOfReference()
|
static void |
removeFrameOfReference(AttributeList list)
Remove the Frame of Reference module
Attributes. |
void |
removeInstance()
See
removeInstance. |
static void |
removeInstance(AttributeList list)
Remove the SOP Common and General Image module
Attributes. |
void |
removePatient()
|
static void |
removePatient(AttributeList list)
Remove the Patient and Clinical Trial Subject module
Attributes. |
void |
removeSeries()
See
removeSeries. |
static void |
removeSeries(AttributeList list)
Remove the General Series module
Attributes. |
void |
removeSRDocumentGeneral()
|
static void |
removeSRDocumentGeneral(AttributeList list)
Remove the SR Document General Image module
Attributes. |
void |
removeStudy()
See
removeStudy. |
static void |
removeStudy(AttributeList list)
Remove the General Study and Patient Study module
Attributes. |
java.lang.String |
toString() |
void |
updateFromSource(AttributeList srcList)
Deprecated.
use
updateFromSource(AttributeList,boolean) instead |
void |
updateFromSource(AttributeList srcList,
boolean forSR)
Add or replace all of the composite context module
Attributes with values from the supplied AttributeList. |
protected AttributeList list
protected static AttributeTag[] patientModuleAttributeTags
protected static AttributeTag[] clinicalTrialSubjectModuleAttributeTags
protected static AttributeTag[] generalStudyModuleAttributeTags
protected static AttributeTag[] patientStudyModuleAttributeTags
protected static AttributeTag[] generalSeriesModuleAttributeTags
protected static AttributeTag[] generalEquipmentModuleAttributeTags
protected static AttributeTag[] frameOfReferenceModuleAttributeTags
protected static AttributeTag[] sopCommonModuleAttributeTags
protected static AttributeTag[] generalImageModuleAttributeTags
protected static AttributeTag[] srDocumentGeneralModuleAttributeTags
public CompositeInstanceContext()
public CompositeInstanceContext(AttributeList srcList, boolean forSR)
Create the composite context module Attributes with values from the supplied AttributeList.
forSR - true if need to populate the SR Document General Module specific Attributes from their image equivalentssrcList - public CompositeInstanceContext(AttributeList srcList)
CompositeInstanceContext(AttributeList,boolean) insteadCreate the composite context module Attributes with values from the supplied AttributeList.
Also populates the SR Document General Module specific Attributes from their image equivalents.
srcList - public AttributeList getAttributeList()
Return the AttributeList of all the Attributes in the context.
AttributeList of all the Attributes in the contextpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected void addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList, AttributeTag tag)
protected void createReferencedRequestSequenceIfAbsent(AttributeList srcList)
protected void createPerformedProcedureCodeSequenceIfAbsent(AttributeList srcList)
public void updateFromSource(AttributeList srcList, boolean forSR)
Add or replace all of the composite context module Attributes with values from the supplied AttributeList.
If an Attribute is empty or missing in the supplied list, the existing value in the context is left unchanged (not removed or emptied).
This is useful when building composite context from multiple input composite instances, in which optional Attributes are filled in some,
but not others, in order to accumulate the most information available.
srcList - forSR - true if need to populate the SR Document General Module specific Attributes from their image equivalentspublic void updateFromSource(AttributeList srcList)
updateFromSource(AttributeList,boolean) insteadAdd or replace all of the composite context module Attributes with values from the supplied AttributeList.
If an Attribute is empty or missing in the supplied list, the existing value in the context is left unchanged (not removed or emptied).
This is useful when building composite context from multiple input composite instances, in which optional Attributes are filled in some,
but not others, in order to accumulate the most information available.
Also populates the SR Document General Module specific Attributes from their image equivalents.
srcList - public static void removePatient(AttributeList list)
Remove the Patient and Clinical Trial Subject module Attributes.
list - public static void removeAllButPatient(AttributeList list)
Remove the study, series, equipment, frame of reference and instance level module Attributes.
list - public static void removeAllButPatientAndStudy(AttributeList list)
Remove the series, equipment, frame of reference and instance level module Attributes.
list - public static void removeStudy(AttributeList list)
Remove the General Study and Patient Study module Attributes.
list - public static void removeSeries(AttributeList list)
Remove the General Series module Attributes.
list - public static void removeEquipment(AttributeList list)
Remove the General Equipment module Attributes.
list - public static void removeFrameOfReference(AttributeList list)
Remove the Frame of Reference module Attributes.
list - public static void removeInstance(AttributeList list)
Remove the SOP Common and General Image module Attributes.
list - public static void removeSRDocumentGeneral(AttributeList list)
Remove the SR Document General Image module Attributes.
list - public void removePatient()
public void removeAllButPatient()
removeAllButPatient.public void removeAllButPatientAndStudy()
public void removeStudy()
removeStudy.public void removeSeries()
removeSeries.public void removeEquipment()
removeEquipment.public void removeFrameOfReference()
public void removeInstance()
removeInstance.public void removeSRDocumentGeneral()
public void put(Attribute a)
public void putAll(AttributeList srcList)
public java.lang.String toString()
toString in class java.lang.Object