Class FileDicomTagInfo

All Implemented Interfaces:
Serializable, Cloneable

public class FileDicomTagInfo extends ModelSerialCloneable
Information about a DICOM tag, stored in the DicomDictionary table once for each DICOM tag. This information is read in from the dicom dictionary on disk.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • DEFAULT_TAG_VERSION

      public static final String DEFAULT_TAG_VERSION
      The default DICOM version string to assign to tags.
      See Also:
    • key

      protected FileDicomKey key
      The DICOM tag 'group,element' key indicating what tag this information pertains to.
    • keyword

      protected String keyword
      The tag keyword (no spaces).
    • name

      protected String name
      The real world DICOM tag name.
    • valueMultiplicity

      protected int valueMultiplicity
      Allowed value multiplicity (vm) for this tag.
    • valueRepresentation

      protected FileDicomTagInfo.VR valueRepresentation
      DICOM value representation (vr) for this tag.
    • version

      protected String version
      Version of the tag. Usually '2' or '3', although some tags get strings like 'GEM' or 'TSH' when the tag is from a private manufacturer.
  • Constructor Details

    • FileDicomTagInfo

      public FileDicomTagInfo(FileDicomKey dicomKey, FileDicomTagInfo.VR vr, int vm, String keyword, String name)
      Constructor that takes all the information needed about the tag except for the value and DICOM revision number (which we assume to be 3).
      Parameters:
      dicomKey - The group and element which uniquely define this tag
      vr - the value representation
      vm - the value multiplicity
      keyword - the keyword (no spaces)
      name - the real world name
      See Also:
    • FileDicomTagInfo

      public FileDicomTagInfo(FileDicomKey dicomKey, String version, FileDicomTagInfo.VR vr, int vm, String keyword, String name)
      Constructor that takes all the information needed about the tag except for the value and DICOM revision number.
      Parameters:
      dicomKey - The group and element which uniquely define this tag
      version - the DICOM revision (version) number (eg. '3' or 'GEM')
      vr - the value representation
      vm - the value multiplicity
      keyword - the keyword (no spaces)
      name - the real world name
    • FileDicomTagInfo

      public FileDicomTagInfo(int group, int element, FileDicomTagInfo.VR vr, int vm, String keyword, String name)
      Constructor that takes all the information needed about the tag except for the value and DICOM revision number.
      Parameters:
      group - the integer group word (in hexadecimal)
      element - the integer element word (in hexadecimal)
      vr - the value representation
      vm - the value multiplicity
      keyword - the keyword (no spaces)
      name - the real world name
      See Also:
    • FileDicomTagInfo

      public FileDicomTagInfo(int group, int element, String version, FileDicomTagInfo.VR vr, int vm, String keyword, String name)
      Constructor that takes all the information needed about the tag except for the value.
      Parameters:
      group - the integer group word (in hexadecimal)
      element - the integer element word (in hexadecimal)
      version - the DICOM revision (version) number (eg. '3' or 'GEM')
      vr - the value representation
      vm - the value multiplicity
      keyword - the keyword (no spaces)
      name - the real world name
  • Method Details

    • getType

      public static final DicomType getType(FileDicomTagInfo.VR vr)
      Accessor that returns the type of tag, depending on a value representation value. This allows the reader to read in the tags properly.
      Parameters:
      vr - value representation
      Returns:
      the type (int, double, short, String, or unknown)
    • equals

      public boolean equals(Object obj)
      Tests whether a tag info object contains the same information as this tag info object.
      Overrides:
      equals in class Object
      Parameters:
      obj - A object (hopefully a non-null FileDicomTagInfo, but not required).
      Returns:
      Whether all of the tag info (key, keyword, name, vm, vr, version) in the other tag is the same as this one. False if the tag is null or not a FileDicomTagInfo.
    • getKey

      public FileDicomKey getKey()
      Return the dicom tag key ('group,element') that this information object describes.
      Returns:
      The dicom tag key described by this information object.
    • getKeyword

      public final String getKeyword()
      Returns the keyword for this tag, a word with no spaces.
      Returns:
      the keyword
    • getName

      public final String getName()
      Accessor that returns the real world name of this tag. For private tags, the name is the value.
      Returns:
      the name of this tag
    • getType

      public final FileDicomTagInfo.VR getType()
      Accessor that returns the type of tag, depending on the value representation. This allows the reader to read in the tags properly. This method will be so much simpler when (if) the tags are seperated out as individual classes.
      Returns:
      the type (int, double, short, String, or unknown)
    • getValueMultiplicity

      public final int getValueMultiplicity()
      Accessor that returns the value multiplicity of the tag. The value multiplicity is how many instances of this value representation (VR) there can be in one tag.
      Returns:
      the value multiplicity
    • getValueRepresentation

      public final FileDicomTagInfo.VR getValueRepresentation()
      Accessor that returns the value representation of the tag. The value representation allows the reader the read and interpret the tag properly. Because private tags are not unique, the VR is null and they may be read and/or displayed improperly.
      Returns:
      the value representation
    • getVersion

      public final String getVersion()
      Accessor that returns the DICOM version of the tag. Although not needed to understand a value, it is important to the dictionary.
      Returns:
      the String that is the DICOM version.
    • getVersionNumber

      public final int getVersionNumber() throws NumberFormatException
      Accessor to the DICOM version number for this tag. Returns it as a number so numerical comparisons (greater-than, equality, etc) can be made. Also, throws a NumberFormatException for private tags.
      Returns:
      the version number.
      Throws:
      NumberFormatException - when a tag is a Private Tag.
    • hashCode

      public final int hashCode()
      Returns the unique identifier's hash code.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
    • setKey

      public final void setKey(FileDicomKey key)
      Sets the dicom tag's key. This is only used to specify the values of wild card tags stored in the DicomDictionary
      Parameters:
      vr - the value representation
    • setValueRepresentation

      public final void setValueRepresentation(FileDicomTagInfo.VR vr)
      Sets the value representation; used only for explicit vr.
      Parameters:
      vr - the value representation
    • toString

      public final String toString()
      Return information about the tag, in string form.
      Overrides:
      toString in class Object
      Returns:
      A tag information string.
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object