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 class
A 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 AttributeList
protected static AttributeTag[]
protected static AttributeTag[]
protected static AttributeTag[]
protected static AttributeTag[]
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeInstanceContext
(AttributeList srcList, boolean forSR) Create the composite context moduleAttribute
s with values from the suppliedAttributeList
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
boolean
Return theAttributeList
of all theAttribute
s in the context.int
hashCode()
void
void
putAll
(AttributeList srcList) void
SeeremoveAllButPatient
.static void
Remove the study, series, equipment, frame of reference and instance level modulesAttribute
s.void
static void
Remove the series, equipment, frame of reference and instance level modulesAttribute
s.static void
removeAllButSelected
(AttributeList list, CompositeInstanceContext.Selector selector) Remove the unselected modulesAttribute
s.void
Remove the unselected modulesAttribute
s.void
SeeremoveAllButSeries
.static void
Remove the patient, study, equipment, frame of reference and instance level modulesAttribute
s.void
SeeremoveAllButStudy
.static void
Remove the patient, series, equipment, frame of reference and instance level modulesAttribute
s.static void
removeAllSelected
(AttributeList list, CompositeInstanceContext.Selector selector) Remove the selected modulesAttribute
s.void
Remove the selected modulesAttribute
s.void
SeeremoveEquipment
.static void
removeEquipment
(AttributeList list) Remove the General Equipment moduleAttribute
s.void
static void
Remove the Frame of Reference moduleAttribute
s.void
SeeremoveInstance
.static void
removeInstance
(AttributeList list) Remove the SOP Common and General Image moduleAttribute
s.void
static void
removePatient
(AttributeList list) Remove the Patient and Clinical Trial Subject modulesAttribute
s.void
SeeremoveSeries
.static void
removeSeries
(AttributeList list) Remove the General Series and Clinical Trial Series modulesAttribute
s.void
static void
Remove the SR Document General Image moduleAttribute
s.void
SeeremoveStudy
.static void
removeStudy
(AttributeList list) Remove the General Study, Patient Study and Clinical Trial Study modulesAttribute
s.toString()
void
updateFromSource
(AttributeList srcList, boolean forSR) Add or replace all of the composite context moduleAttribute
s 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
Attribute
s with values from the suppliedAttributeList
.- Parameters:
srcList
- the list of attributes to use as the sourceforSR
- true if need to populate the SR Document General Module specificAttribute
s from their image equivalents
-
-
Method Details
-
getAttributeList
Return the
AttributeList
of all theAttribute
s in the context.- Returns:
- the
AttributeList
of all theAttribute
s 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
Attribute
s with values from the suppliedAttributeList
.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
Attribute
s 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 specificAttribute
s from their image equivalents
-
removePatient
Remove the Patient and Clinical Trial Subject modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeAllButPatient
Remove the study, series, equipment, frame of reference and instance level modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeAllButStudy
Remove the patient, series, equipment, frame of reference and instance level modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeAllButSeries
Remove the patient, study, equipment, frame of reference and instance level modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeAllButPatientAndStudy
Remove the series, equipment, frame of reference and instance level modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeStudy
Remove the General Study, Patient Study and Clinical Trial Study modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeSeries
Remove the General Series and Clinical Trial Series modules
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeEquipment
Remove the General Equipment module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeFrameOfReference
Remove the Frame of Reference module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeInstance
Remove the SOP Common and General Image module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeSRDocumentGeneral
Remove the SR Document General Image module
Attribute
s.- Parameters:
list
- the list of attributes to edit
-
removeAllButSelected
public static void removeAllButSelected(AttributeList list, CompositeInstanceContext.Selector selector) Remove the unselected modules
Attribute
s.- 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
Attribute
s.- 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
SeeAttribute
s.removeAllButSelected
.- Parameters:
selector
- the modules to keep
-
removeAllSelected
Remove the selected modules
SeeAttribute
s.removeAllSelected
.- Parameters:
selector
- the modules to remove
-
put
-
putAll
-
toString
-