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

  • Constructor Details

    • DicomTag

      public DicomTag(DicomAttribute attribute)
    • DicomTag

      public DicomTag(DicomAttribute attribute, DicomVR vr)
    • DicomTag

      public DicomTag(int tag, DicomVR vr)
    • DicomTag

      public DicomTag(loci.common.RandomAccessInputStream in, boolean bigEndian, long location, boolean oddLocations) throws loci.formats.FormatException, IOException
      Read a complete tag and value from the given input stream.
      Throws:
      loci.formats.FormatException
      IOException
    • DicomTag

      public DicomTag(loci.common.RandomAccessInputStream in, boolean bigEndian, long location, boolean oddLocations, boolean readValue) throws loci.formats.FormatException, IOException
      Read a complete tag and optionally a value from the given input stream.
      Throws:
      loci.formats.FormatException
      IOException
  • Method Details

    • 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>