Class FileDicomSQ

All Implemented Interfaces:
Serializable, Cloneable

public class FileDicomSQ extends ModelSerialCloneable
This is a class for reading in a DICOM sequence tag. For more information about the DICOM sequence tag see the DICOM standard, Part 5, Section 7.5.

The sequence tag is encoded as follows:

  1. A group and element tag indicating that this is a sequence, followed by a length. The group and element tag are stored in the regular FileInfoDicom object. The length is stored there and also here. Often a sequence will have an undefined length, which is defined in FileDicom.
  2. A series of item tags. Each item tag is read in, the length of the entire item is stored, and the item is read in. The item is simply a series of DICOM tags with data in them. That information is stored in the class DicomItem.
  3. A tag indicating the end of the sequence.

    Given this encoding, the DicomSQ structure is set up as a Vector. The length variable is the length of the sequence as given in the header and NOT the length of the Vector. The Vector is a series of DicomItems. Each DicomItem is a set of tags.

Author:
Neva Cherniavsky
See Also:
  • Field Details

    • serialVersionUID

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

      private Vector<FileDicomSQItem> sequence
      Sequences are composed of items (DICOM items) and store in a vector object.
    • writeAsUnknownLength

      private boolean writeAsUnknownLength
      Whether the sequence should be written using an unknown length
  • Constructor Details

    • FileDicomSQ

      public FileDicomSQ()
      Creates a new DicomSQ object with initial length.
  • Method Details

    • addItem

      public final void addItem(FileDicomSQItem item)
      Add an item to the sequence vector.
      Parameters:
      item - item to add
    • finalize

      public void finalize()
      Prepares this class for cleanup.
      Overrides:
      finalize in class Object
    • getDataLength

      public int getDataLength()
      Returns the size of the data held in this sequence in number of bytes, including the number of bytes required to delimit each item. Always returns the exact number of bytes used for the current state of the sequence.
      Returns:
      the size of the data held in this sequence in number of bytes.
    • getItem

      public final FileDicomSQItem getItem(int index)
      Gets the specified item from the sequence vector.
      Parameters:
      index - index in the vector
      Returns:
      The specified item from the sequence.
    • getWritableLength

      public final int getWritableLength()
      Gets the length as read in by the header (possibly undefined).
      Returns:
      The length of the sequence as read in by the header
    • getSequenceDisplay

      public Vector<String> getSequenceDisplay()
      Gets a series of Strings that are the human readable version of the data.
      Returns:
      A list that contains the human readable form of the sequence data
    • getSequenceLength

      public final int getSequenceLength()
      Gets the length of the sequence vector.
      Returns:
      the sequence length
    • toString

      public String toString()
      Returns the word 'Sequence'.
      Overrides:
      toString in class Object
      Returns:
      The string 'Sequence' (without the quotes).
    • getSequence

      public Vector<FileDicomSQItem> getSequence()
    • doWriteAsUnknownLength

      public boolean doWriteAsUnknownLength()
      Whether the sequence should be written using an unknown length, can be set as a preference by user.
    • setWriteAsUnknownLength

      public void setWriteAsUnknownLength(boolean writeAsUnknownLength)
      Whether the sequence should be written using an unknown length, this includes adding a sequence delimitation item to the sequence.