Package com.pixelmed.dicom
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 Summary
FieldsModifier and TypeFieldDescriptionprotected long[][]
protected long[][]
protected static final AttributeTag
protected static final AttributeTag
Fields inherited from class com.pixelmed.dicom.OtherAttributeOnDisk
byteOffset, deleteFilesWhenNoLongerNeeded, file
Fields inherited from class com.pixelmed.dicom.Attribute
valueLength, valueMultiplicity
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an (empty) attribute.OtherByteAttributeCompressedSeparateFramesOnDisk
(AttributeTag t, DicomInputStream i, long[][] frameItemByteOffsets, long[][] frameItemLengths) Create an attribute from an input stream from which the encapsulated items have already been read.OtherByteAttributeCompressedSeparateFramesOnDisk
(AttributeTag t, File file, long[][] frameItemByteOffsets, long[][] frameItemLengths, boolean deleteFilesWhenNoLongerNeeded) Create an attribute from a file that contains tghe compressed frames. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getByteValuesForSelectedFrame
(int frameNumber) Get the value of this attribute as a byte array for one selected frame.long[][]
int
Get the number of frames.long
Get the value length of this attribute, accounting for the need for even-length padding.byte[]
getVR()
Get the value representation of this attribute (OB).void
Write the entire attribute (including values) to the output stream.protected void
writeItemTag
(DicomOutputStream o, long length) protected void
Methods inherited from class com.pixelmed.dicom.OtherAttributeOnDisk
deleteFilesWhenNoLongerNeeded, finalize, getByteOffset, getFile, removeValues, setFile, setFile, toString
Methods inherited from class com.pixelmed.dicom.Attribute
addValue, addValue, addValue, addValue, addValue, addValue, addValue, getByteValues, getByteValues, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDoubleValues, getDoubleValues, getDoubleValues, getElement, getFloatValues, getFloatValues, getFloatValues, getGroup, getIntegerValues, getIntegerValues, getIntegerValues, getLengthOfEncodedValue, getLongValues, getLongValues, getLongValues, getOriginalStringValues, getShortValues, getSingleDoubleValueOrDefault, getSingleDoubleValueOrDefault, getSingleDoubleValueOrDefault, getSingleFloatValueOrDefault, getSingleFloatValueOrDefault, getSingleFloatValueOrDefault, getSingleIntegerValueOrDefault, getSingleIntegerValueOrDefault, getSingleIntegerValueOrDefault, getSingleLongValueOrDefault, getSingleLongValueOrDefault, getSingleLongValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getStringValues, getStringValues, getStringValues, getStringValues, getStringValues, getStringValues, getTag, getVL, getVM, getVRAsString, isValid, repairValues, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValues, setValues, setValues, setValues, setValues, setValues, setValues, toString, writeBase
-
Field Details
-
frameItemByteOffsets
protected long[][] frameItemByteOffsets -
frameItemLengths
protected long[][] frameItemLengths -
itemTag
-
sequenceDelimitationItemTag
-
-
Constructor Details
-
OtherByteAttributeCompressedSeparateFramesOnDisk
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 attributefile
- the fileframeItemByteOffsets
- the byte offsets in the input stream of the start of the data for each item of each frameframeItemLengths
- 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 attributei
- the input streamframeItemByteOffsets
- the byte offsets in the input stream of the start of the data for each item of each frameframeItemLengths
- 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 classAttribute
- Returns:
- the value length (padded to an even length)
-
writeItemTag
- Throws:
IOException
-
writeSequenceDelimitationItemTag
- Throws:
IOException
-
write
Description copied from class:Attribute
Write the entire attribute (including values) to the output stream.
- Specified by:
write
in classAttribute
- Parameters:
o
-- Throws:
IOException
DicomException
-
getByteValuesForSelectedFrame
Get the value of this attribute as a byte array for one selected frame.
- Specified by:
getByteValuesForSelectedFrame
in interfaceByteFrameSource
- 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 classAttribute
- Returns:
- 'O','B' in ASCII as a two byte array; see
ValueRepresentation
-