Class DicomTag

java.lang.Object
loci.formats.dicom.DicomTag
All Implemented Interfaces:
Comparable<DicomTag>

public class DicomTag extends Object implements Comparable<DicomTag>
Represents a complete DICOM tag, including the dictionary attribute, actual VR, value, and any "child" tags (in the case of a sequence).
  • Field Details

    • parent

      public DicomTag parent
    • children

      public List<DicomTag> children
    • tag

      public int tag
    • attribute

      public DicomAttribute attribute
    • vr

      public DicomVR vr
    • key

      public String key
    • value

      public Object value
    • elementLength

      public int elementLength
    • start

      private long start
    • bigEndianTransferSyntax

      private boolean bigEndianTransferSyntax
    • oddLocations

      private boolean oddLocations
    • strategy

      public ResolutionStrategy strategy
  • Constructor Details

  • Method Details

    • getNextTag

      private int getNextTag(loci.common.RandomAccessInputStream in) throws FormatException, IOException
      Get the next 4 byte DICOM tag from the given input stream.
      Throws:
      FormatException
      IOException
    • getLength

      private int getLength(loci.common.RandomAccessInputStream in) throws IOException
      Get the length of the next value in the given input stream.
      Throws:
      IOException
    • getStringValue

      public String getStringValue()
      Get a string representation of the current value.
    • getNumberValue

      public Number getNumberValue()
      Get a number representation of the current value, or null if not a number.
    • getValueStartPointer

      public long getValueStartPointer()
      Get the file pointer at which the value starts (useful for sequences and byte streams).
    • getEndPointer

      public long getEndPointer()
      Get the file pointer at which the value ends (useful for sequences and byte streams).
    • lookupChild

      public DicomTag lookupChild(DicomAttribute attr)
      Find the first child tag with the given attribute, or null if one does not exist.
    • validate

      public boolean validate(List<DicomTag> tags)
      Check this tag against a list of existing tags. If this tag is a duplicate of an existing tag or otherwise deemed invalid, return false. Otherwise return true.
    • validateValue

      public void validateValue()
      Compare the value type to the VR. If the two types do not match, attempt to conver the value into the VR's type. Usually this means parsing numerical values from a String.
    • isPrivateContentCreator

      public boolean isPrivateContentCreator()
      See https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.8.html
      Returns:
      true if this is a private content creator tag
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(DicomTag o)
      Specified by:
      compareTo in interface Comparable<DicomTag>