Class DicomJSONProvider

java.lang.Object
loci.formats.dicom.DicomJSONProvider
All Implemented Interfaces:
ITagProvider

public class DicomJSONProvider extends Object implements 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 Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • tags

      private List<DicomTag> tags
  • Constructor Details

    • DicomJSONProvider

      public DicomJSONProvider()
  • Method Details

    • readTagSource

      public void readTagSource(String location) throws IOException
      Description copied from interface: ITagProvider
      Read tags from the given location. The interpretation of 'location' is implementation-dependent. This method must be called before retrieving tags.
      Specified by:
      readTagSource in interface ITagProvider
      Throws:
      IOException
    • getTags

      public List<DicomTag> getTags()
      Description copied from interface: ITagProvider
      Retrieve the tags defined by this provider.
      Specified by:
      getTags in interface ITagProvider
    • readSequence

      private void readSequence(org.json.JSONObject rootTag, DicomTag parent)
    • lookupTag

      private Integer lookupTag(String tagKey, org.json.JSONObject tag)
      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

      private DicomVR lookupVR(Integer intTagCode, org.json.JSONObject tag)
      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.