Package loci.formats.dicom
Class DicomJSONProvider
java.lang.Object
loci.formats.dicom.DicomJSONProvider
- All Implemented Interfaces:
ITagProvider
Provide DICOM tags from a file containing JSON.
Formal JSON schema yet to be determined, but the idea is to accept a hierarchy
of tags of the form:
{
"BodyPartExamined": {
"Value": "BRAIN",
"VR": "CS",
"Tag": "(0018,0015)"
}
"ContributingEquipmentSequence": {
"VR": "SQ",
"Tag": "(0018,a001)",
"Sequence": {
"Manufacturer": {
"Value": "PixelMed",
"VR": "LO",
"Tag": "(0008,0070)"
},
"ContributionDateTime": {
"Value": "20210710234601.105+0000",
"VR": "DT",
"Tag": "(0018,a002)"
}
}
}
}
This is similar to JSON examples in https://github.com/QIICR/dcmqi/tree/master/doc/examples,
but allows for the VR (type) and tag to be explicitly stated, in addition to
the more human-readable description.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTags()Retrieve the tags defined by this provider.private IntegerGet the tag code corresponding to the given JSON object.private DicomVRGet the VR associated with the given tag code and JSON object.private voidreadSequence(org.json.JSONObject rootTag, DicomTag parent) voidreadTagSource(String location) Read tags from the given location.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
tags
-
-
Constructor Details
-
DicomJSONProvider
public DicomJSONProvider()
-
-
Method Details
-
readTagSource
Description copied from interface:ITagProviderRead tags from the given location. The interpretation of 'location' is implementation-dependent. This method must be called before retrieving tags.- Specified by:
readTagSourcein interfaceITagProvider- Throws:
IOException
-
getTags
Description copied from interface:ITagProviderRetrieve the tags defined by this provider.- Specified by:
getTagsin interfaceITagProvider
-
readSequence
-
lookupTag
Get the tag code corresponding to the given JSON object. If "Tag" is not a defined attribute, lookup the default for the object name in the dictionary. -
lookupVR
Get the VR associated with the given tag code and JSON object. If "VR" is not a defined attribute, lookup the default for the given tag code in the dictionary.
-