public class MergeCompositeContext
extends java.lang.Object
A class containing an application for merging the patient composite context of multiple instances for consistency.
Patient identity is determined by being within the same study (having the same Study Instance UID), or referencing each others SOP Instance UIDs.
It is assumed that one patient's instances can only cross-reference those of the same patient and not other patients. If there are no instance cross-references, then no commonality can be established across studies and no contexts are merged across studies.
There is no assumption that any particular patient entity level key is the same (e.g., Patient ID).
Various known dummy values are treated as if they were zero length or absent if conflicting with non-dummy values.
Modifier and Type | Class and Description |
---|---|
class |
MergeCompositeContext.Group |
protected class |
MergeCompositeContext.OurFirstPassMediaImporter |
protected class |
MergeCompositeContext.OurSecondPassMediaImporter |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
dstFolderName |
protected java.util.Set<MergeCompositeContext.Group> |
groups |
protected java.util.Map<java.lang.String,MergeCompositeContext.Group> |
mapOfSOPInstanceUIDToGroup |
protected java.util.Map<java.lang.String,java.lang.String> |
mapOfSOPInstanceUIDToStudyInstanceUID |
protected java.util.Map<java.lang.String,MergeCompositeContext.Group> |
mapOfStudyInstanceUIDToGroup |
protected int |
nextSequenceNumber |
protected java.lang.String |
ourAETitle |
Constructor and Description |
---|
MergeCompositeContext(java.lang.String[] srcs,
java.lang.String dstFolderName,
MessageLogger logger)
Merge the patient composite context of multiple instances for consistency.
|
MergeCompositeContext(java.lang.String src,
java.lang.String dstFolderName,
MessageLogger logger)
Merge the patient composite context of multiple instances for consistency.
|
Modifier and Type | Method and Description |
---|---|
protected MergeCompositeContext.Group |
addToGroups(AttributeList list) |
protected java.lang.String |
dumpGroups() |
protected boolean |
isNonZeroLengthDummyValue(java.lang.String value) |
static void |
main(java.lang.String[] arg)
Merge the patient composite context of multiple instances for consistency.
|
protected void |
mergeGroups(MergeCompositeContext.Group g1,
MergeCompositeContext.Group g2) |
protected CompositeInstanceContext |
mergePatientContext(MergeCompositeContext.Group group,
CompositeInstanceContext newContext) |
protected java.lang.String dstFolderName
protected java.util.Set<MergeCompositeContext.Group> groups
protected java.util.Map<java.lang.String,MergeCompositeContext.Group> mapOfSOPInstanceUIDToGroup
protected java.util.Map<java.lang.String,java.lang.String> mapOfSOPInstanceUIDToStudyInstanceUID
protected java.util.Map<java.lang.String,MergeCompositeContext.Group> mapOfStudyInstanceUIDToGroup
protected int nextSequenceNumber
protected java.lang.String ourAETitle
public MergeCompositeContext(java.lang.String[] srcs, java.lang.String dstFolderName, MessageLogger logger) throws java.io.IOException, DicomException
Merge the patient composite context of multiple instances for consistency.
srcs
- source folders or DICOMDIRsdstFolderName
- destination folderlogger
- logger to send progress, warnings and errorsjava.io.IOException
- if there is a problem reading or writingDicomException
- if there is a problem parsing or extracting required contentpublic MergeCompositeContext(java.lang.String src, java.lang.String dstFolderName, MessageLogger logger) throws java.io.IOException, DicomException
Merge the patient composite context of multiple instances for consistency.
src
- source folder or DICOMDIRdstFolderName
- destination folderlogger
- logger to send progress, warnings and errorsjava.io.IOException
- if there is a problem reading or writingDicomException
- if there is a problem parsing or extracting required contentprotected MergeCompositeContext.Group addToGroups(AttributeList list) throws DicomException
DicomException
protected java.lang.String dumpGroups()
protected boolean isNonZeroLengthDummyValue(java.lang.String value)
public static void main(java.lang.String[] arg)
Merge the patient composite context of multiple instances for consistency.
The files are processed in the order in which they are specified on the command line, and when there is a conflict, the first values are used. This can be used to make sure that all PatientIDs, for example are coerced to those first specified.
For example, if a folder of images for multiple patients is specified first, and then a folder of structured reports or presentation states referencing (some of) those images but with different patient level identifiers is specified second, then the latter (the reports or presentation states) will be cooerced to have the same patient context as the former (the images).
arg
- array of 2 or more strings - one or more source folder or DICOMDIR (to merge and use as a source of context),
and a destination folderprotected void mergeGroups(MergeCompositeContext.Group g1, MergeCompositeContext.Group g2)
protected CompositeInstanceContext mergePatientContext(MergeCompositeContext.Group group, CompositeInstanceContext newContext)