public class RemapUIDs
extends java.lang.Object
A class to read a map of Study, Series, SOP Instance and Frame of Reference UIDs pairs, and then remap occurences in a set of DICOM files to the other member of the pair.
Useful, for example, when UIDs have been changed, annotations made, and there is a need to apply the annotations back to the originals.
UIDMapByMatchingPixelData
,
MergeCompositeContext
Modifier and Type | Class and Description |
---|---|
protected class |
RemapUIDs.OurMediaImporter |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
ourAETitle |
Constructor and Description |
---|
RemapUIDs(java.lang.String uidmapFileName,
java.lang.String srcFolderName,
java.lang.String dstFolderName)
Change UIDs based on UID map file.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] arg)
Change UIDs based on UID map file.
|
static void |
remapUIDs(AttributeList list,
java.util.Set<java.lang.String> setOfCanonicalUIDs,
java.util.Map<java.lang.String,java.lang.String> mapOfOtherUIDToCanonicalUID)
Change all non-canonical UIDs that can be mapped to a canonical UID.
|
public RemapUIDs(java.lang.String uidmapFileName, java.lang.String srcFolderName, java.lang.String dstFolderName) throws java.io.FileNotFoundException, java.io.IOException, DicomException
Change UIDs based on UID map file.
The order of UIDs in the map file is important, the first of tab-separated multiple UIDs in one line being the canonical UID to which the others on the line are remapped.
uidmapFileName
- srcFolderName
- dstFolderName
- java.io.FileNotFoundException
java.io.IOException
DicomException
public static void main(java.lang.String[] arg)
Change UIDs based on UID map file.
The order of UIDs in the map file is important, the first of tab-separated multiple UIDs in one line being the canonical UID to which the others on the line are remapped.
arg
- uidmapFileName srcFolderName dstFolderNamepublic static void remapUIDs(AttributeList list, java.util.Set<java.lang.String> setOfCanonicalUIDs, java.util.Map<java.lang.String,java.lang.String> mapOfOtherUIDToCanonicalUID)
Change all non-canonical UIDs that can be mapped to a canonical UID.
Leaves canonical UIDs, SOP Classes and anything unrecognized alone.
Recursively descends into sequences to process nested UIDs too.
list
- setOfCanonicalUIDs
- mapOfOtherUIDToCanonicalUID
-