loci.formats.dicom

## Class DicomJSONProvider

- java.lang.Object
- - loci.formats.dicom.DicomJSONProvider

- All Implemented Interfaces:
    ITagProvider

      public class DicomJSONProvider
      extends java.lang.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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static org.slf4j.Logger` | `LOGGER`
    `private java.util.List<DicomTag>` | `tags`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DicomJSONProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<DicomTag>` | `getTags()` Retrieve the tags defined by this provider.
    `private java.lang.Integer` | `lookupTag(java.lang.String tagKey, org.json.JSONObject tag)` Get the tag code corresponding to the given JSON object.
    `private DicomVR` | `lookupVR(java.lang.Integer intTagCode, org.json.JSONObject tag)` Get the VR associated with the given tag code and JSON object.
    `private void` | `readSequence(org.json.JSONObject rootTag, DicomTag parent)`
    `void` | `readTagSource(java.lang.String location)` Read tags from the given location.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

    - #### tags

          private java.util.List<DicomTag> tags

  - ### Constructor Detail

    - #### DicomJSONProvider

          public DicomJSONProvider()

  - ### Method Detail

    - #### readTagSource

          public void readTagSource(java.lang.String location)
                             throws java.io.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:
        `java.io.IOException`

    - #### getTags

          public java.util.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 java.lang.Integer lookupTag(java.lang.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(java.lang.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.

Copyright © 2026 Open Microscopy Environment