Class OtherByteAttributeCompressedSeparateFramesOnDisk

java.lang.Object
com.pixelmed.dicom.Attribute
com.pixelmed.dicom.OtherAttributeOnDisk
com.pixelmed.dicom.OtherByteAttributeCompressedSeparateFramesOnDisk
All Implemented Interfaces:
ByteFrameSource

public class OtherByteAttributeCompressedSeparateFramesOnDisk extends OtherAttributeOnDisk implements ByteFrameSource

A concrete class specializing Attribute for Other Byte (OB) attributes whose compressed frames are not memory resident.

Though an instance of this class may be created using its constructors, there is also a factory class, AttributeFactory.

See Also:
  • Field Details

    • frameItemByteOffsets

      protected long[][] frameItemByteOffsets
    • frameItemLengths

      protected long[][] frameItemLengths
    • itemTag

      protected static final AttributeTag itemTag
    • sequenceDelimitationItemTag

      protected static final AttributeTag sequenceDelimitationItemTag
  • Constructor Details

    • OtherByteAttributeCompressedSeparateFramesOnDisk

      public OtherByteAttributeCompressedSeparateFramesOnDisk(AttributeTag t)

      Construct an (empty) attribute.

      Parameters:
      t - the tag of the attribute
    • OtherByteAttributeCompressedSeparateFramesOnDisk

      public OtherByteAttributeCompressedSeparateFramesOnDisk(AttributeTag t, File file, long[][] frameItemByteOffsets, long[][] frameItemLengths, boolean deleteFilesWhenNoLongerNeeded) throws IOException, DicomException

      Create an attribute from a file that contains tghe compressed frames.

      Parameters:
      t - the tag of the attribute
      file - the file
      frameItemByteOffsets - the byte offsets in the input stream of the start of the data for each item of each frame
      frameItemLengths - the lengths in bytes of each item of each frame, with any trailing padding after EOI marker removed (i.e., may be odd)
      deleteFilesWhenNoLongerNeeded - delete file when attribute goes out of scope
      Throws:
      IOException
      DicomException
    • OtherByteAttributeCompressedSeparateFramesOnDisk

      public OtherByteAttributeCompressedSeparateFramesOnDisk(AttributeTag t, DicomInputStream i, long[][] frameItemByteOffsets, long[][] frameItemLengths) throws IOException, DicomException

      Create an attribute from an input stream from which the encapsulated items have already been read.

      Parameters:
      t - the tag of the attribute
      i - the input stream
      frameItemByteOffsets - the byte offsets in the input stream of the start of the data for each item of each frame
      frameItemLengths - the lengths in bytes of each item of each frame
      Throws:
      IOException
      DicomException
  • Method Details

    • getPaddedVL

      public long getPaddedVL()
      Description copied from class: Attribute

      Get the value length of this attribute, accounting for the need for even-length padding.

      Overrides:
      getPaddedVL in class Attribute
      Returns:
      the value length (padded to an even length)
    • writeItemTag

      protected void writeItemTag(DicomOutputStream o, long length) throws IOException
      Throws:
      IOException
    • writeSequenceDelimitationItemTag

      protected void writeSequenceDelimitationItemTag(DicomOutputStream o) throws IOException
      Throws:
      IOException
    • write

      public void write(DicomOutputStream o) throws DicomException, IOException
      Description copied from class: Attribute

      Write the entire attribute (including values) to the output stream.

      Specified by:
      write in class Attribute
      Parameters:
      o -
      Throws:
      IOException
      DicomException
    • getByteValuesForSelectedFrame

      public byte[] getByteValuesForSelectedFrame(int frameNumber) throws DicomException

      Get the value of this attribute as a byte array for one selected frame.

      Specified by:
      getByteValuesForSelectedFrame in interface ByteFrameSource
      Parameters:
      frameNumber - from 0
      Returns:
      the values as an array of bytes
      Throws:
      DicomException - thrown if values cannot be read
    • getFrameItemLengths

      public long[][] getFrameItemLengths()
    • getNumberOfFrames

      public int getNumberOfFrames()

      Get the number of frames.

      Returns:
      number of frame
    • getVR

      public byte[] getVR()

      Get the value representation of this attribute (OB).

      Overrides:
      getVR in class Attribute
      Returns:
      'O','B' in ASCII as a two byte array; see ValueRepresentation