Class CompositeInstanceContext
- Direct Known Subclasses:
DoseCompositeInstanceContext
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class to select which entities are copied or propagated or removed or not during operations on CompositeInstanceContext. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected AttributeListprotected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[]protected static AttributeTag[] -
Constructor Summary
ConstructorsConstructorDescriptionCompositeInstanceContext(AttributeList srcList, boolean forSR) Create the composite context moduleAttributes with values from the suppliedAttributeList. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidbooleanReturn theAttributeListof all theAttributes in the context.inthashCode()voidvoidputAll(AttributeList srcList) voidSeeremoveAllButPatient.static voidRemove the study, series, equipment, frame of reference and instance level modulesAttributes.voidstatic voidRemove the series, equipment, frame of reference and instance level modulesAttributes.static voidremoveAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector) Remove the unselected modulesAttributes.voidRemove the unselected modulesAttributes.voidSeeremoveAllButSeries.static voidRemove the patient, study, equipment, frame of reference and instance level modulesAttributes.voidSeeremoveAllButStudy.static voidRemove the patient, series, equipment, frame of reference and instance level modulesAttributes.static voidremoveAllSelected(AttributeList list, CompositeInstanceContext.Selector selector) Remove the selected modulesAttributes.voidRemove the selected modulesAttributes.voidSeeremoveEquipment.static voidremoveEquipment(AttributeList list) Remove the General Equipment moduleAttributes.voidstatic voidRemove the Frame of Reference moduleAttributes.voidSeeremoveInstance.static voidremoveInstance(AttributeList list) Remove the SOP Common and General Image moduleAttributes.voidstatic voidremovePatient(AttributeList list) Remove the Patient and Clinical Trial Subject modulesAttributes.voidSeeremoveSeries.static voidremoveSeries(AttributeList list) Remove the General Series and Clinical Trial Series modulesAttributes.voidstatic voidRemove the SR Document General Image moduleAttributes.voidSeeremoveStudy.static voidremoveStudy(AttributeList list) Remove the General Study, Patient Study and Clinical Trial Study modulesAttributes.toString()voidupdateFromSource(AttributeList srcList, boolean forSR) Add or replace all of the composite context moduleAttributes with values from the suppliedAttributeList.
-
Field Details
-
list
-
patientModuleAttributeTags
-
clinicalTrialSubjectModuleAttributeTags
-
generalStudyModuleAttributeTags
-
patientStudyModuleAttributeTags
-
clinicalTrialStudyModuleAttributeTags
-
generalSeriesModuleAttributeTags
-
clinicalTrialSeriesModuleAttributeTags
-
generalEquipmentModuleAttributeTags
-
frameOfReferenceModuleAttributeTags
-
sopCommonModuleAttributeTags
-
generalImageModuleAttributeTags
-
srDocumentGeneralModuleAttributeTags
-
-
Constructor Details
-
CompositeInstanceContext
public CompositeInstanceContext() -
CompositeInstanceContext
Create the composite context module
Attributes with values from the suppliedAttributeList.- Parameters:
forSR- true if need to populate the SR Document General Module specificAttributes from their image equivalentssrcList- the list of attributes to use as the source
-
-
Method Details
-
getAttributeList
Return the
AttributeListof all theAttributes in the context.- Returns:
- the
AttributeListof all theAttributes in the context
-
equals
-
hashCode
public int hashCode() -
addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged
protected void addOrReplaceIfNotEmptyOtherwiseLeaveUnchanged(AttributeList srcList, AttributeTag tag) -
createReferencedRequestSequenceIfAbsent
-
createPerformedProcedureCodeSequenceIfAbsent
-
updateFromSource
Add or replace all of the composite context module
Attributes with values from the suppliedAttributeList.If an
Attributeis 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.- Parameters:
srcList- the list of attributes to use as the sourceforSR- true if need to populate the SR Document General Module specificAttributes from their image equivalents
-
removePatient
Remove the Patient and Clinical Trial Subject modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeAllButPatient
Remove the study, series, equipment, frame of reference and instance level modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeAllButStudy
Remove the patient, series, equipment, frame of reference and instance level modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeAllButSeries
Remove the patient, study, equipment, frame of reference and instance level modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeAllButPatientAndStudy
Remove the series, equipment, frame of reference and instance level modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeStudy
Remove the General Study, Patient Study and Clinical Trial Study modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeSeries
Remove the General Series and Clinical Trial Series modules
Attributes.- Parameters:
list- the list of attributes to edit
-
removeEquipment
Remove the General Equipment module
Attributes.- Parameters:
list- the list of attributes to edit
-
removeFrameOfReference
Remove the Frame of Reference module
Attributes.- Parameters:
list- the list of attributes to edit
-
removeInstance
Remove the SOP Common and General Image module
Attributes.- Parameters:
list- the list of attributes to edit
-
removeSRDocumentGeneral
Remove the SR Document General Image module
Attributes.- Parameters:
list- the list of attributes to edit
-
removeAllButSelected
public static void removeAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector) Remove the unselected modules
Attributes.- Parameters:
list- the list of attributes to editselector- the modules to keep
-
removeAllSelected
public static void removeAllSelected(AttributeList list, CompositeInstanceContext.Selector selector) Remove the selected modules
Attributes.- Parameters:
list- the list of attributes to editselector- the modules to remove
-
removePatient
public void removePatient() -
removeAllButPatient
public void removeAllButPatient()SeeremoveAllButPatient. -
removeAllButStudy
public void removeAllButStudy()SeeremoveAllButStudy. -
removeAllButSeries
public void removeAllButSeries()SeeremoveAllButSeries. -
removeAllButPatientAndStudy
public void removeAllButPatientAndStudy() -
removeStudy
public void removeStudy()SeeremoveStudy. -
removeSeries
public void removeSeries()SeeremoveSeries. -
removeEquipment
public void removeEquipment()SeeremoveEquipment. -
removeFrameOfReference
public void removeFrameOfReference() -
removeInstance
public void removeInstance()SeeremoveInstance. -
removeSRDocumentGeneral
public void removeSRDocumentGeneral() -
removeAllButSelected
Remove the unselected modules
SeeAttributes.removeAllButSelected.- Parameters:
selector- the modules to keep
-
removeAllSelected
Remove the selected modules
SeeAttributes.removeAllSelected.- Parameters:
selector- the modules to remove
-
put
-
putAll
-
toString
-