Class OtherByteAttributeMultipleCompressedFrames
- All Implemented Interfaces:
ByteFrameSource
A concrete class specializing Attribute
for
Other Byte (OB) attributes whose values are memory or file resident compressed pixel data frames.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
protected File[]
protected byte[][]
protected static final AttributeTag
protected static final AttributeTag
Fields inherited from class com.pixelmed.dicom.Attribute
valueLength, valueMultiplicity
-
Constructor Summary
ConstructorsConstructorDescriptionOtherByteAttributeMultipleCompressedFrames
(AttributeTag t, byte[] allframes) Construct an attribute from a single byte array containing all compressed frames.OtherByteAttributeMultipleCompressedFrames
(AttributeTag t, byte[][] frames) Construct an attribute from a set of compressed frames.Construct an attribute from a set of compressed frames. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getByteValuesForSelectedFrame
(int frameNumber) Get the value of this attribute as a byte array for one selected frame.File[]
getFiles()
Get the files for each frame.byte[][]
Get the byte arrays for each frame.long
getLengthOfEntireEncodedAttribute
(boolean explicit, boolean littleEndian) Get the length of the entire attribute when encoded, accounting for the characteristics of the Transfer Syntax and the need for even-length padding.int
Get the number of frames.byte[]
getVR()
Get the value representation of this attribute (OB).void
Remove any existing values, making the attribute empty (zero length).toString
(DicomDictionary dictionary) Dump the contents of the attribute as a human-readable string.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.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, getLengthOfBaseOfEncodedAttribute, getLengthOfEncodedValue, getLongValues, getLongValues, getLongValues, getOriginalStringValues, getPaddedVL, 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
-
allframes
protected byte[] allframes -
frames
protected byte[][] frames -
files
-
itemTag
-
sequenceDelimitationItemTag
-
-
Constructor Details
-
OtherByteAttributeMultipleCompressedFrames
Construct an attribute from a single byte array containing all compressed frames.
The VL is not required, since it is undefined by definition.
- Parameters:
t
- the tag of the attributeallframes
- the frames
-
OtherByteAttributeMultipleCompressedFrames
Construct an attribute from a set of compressed frames.
The VL is not required, since it is undefined by definition.
- Parameters:
t
- the tag of the attributeframes
- the frames
-
OtherByteAttributeMultipleCompressedFrames
Construct an attribute from a set of compressed frames.
The VL is not required, since it is undefined by definition.
- Parameters:
t
- the tag of the attributefiles
- the files containing the compressed bit streams
-
-
Method Details
-
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
- if no byte array or files containing the compressed bitstream have been supplied
-
getFrames
public byte[][] getFrames()Get the byte arrays for each frame.
- Returns:
- an array of byte arrays for each frame
-
getFiles
Get the files for each frame.
- Returns:
- an array of files for each frame
-
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
-
getNumberOfFrames
public int getNumberOfFrames()Get the number of frames.
- Returns:
- number of frames, or zero if all frames are in one fragment
-
toString
Description copied from class:Attribute
Dump the contents of the attribute as a human-readable string.
No new line is appended.
The result is of the form:
(0xgggg,0xeeee) Name VR=<XX> VL=<0xnnnn> <...>
For example:
(0x0018,0x0020) ScanningSequence VR=<CS> VL=<0x2> <GR>
-
removeValues
public void removeValues()Description copied from class:Attribute
Remove any existing values, making the attribute empty (zero length).
- Specified by:
removeValues
in classAttribute
-
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
-
getLengthOfEntireEncodedAttribute
public long getLengthOfEntireEncodedAttribute(boolean explicit, boolean littleEndian) throws DicomException Get the length of the entire attribute when encoded, accounting for the characteristics of the Transfer Syntax and the need for even-length padding.
- Overrides:
getLengthOfEntireEncodedAttribute
in classAttribute
- Parameters:
explicit
- true if the Transfer Syntax to be used for encoding is explicit VRlittleEndian
- true if the Transfer Syntax to be used for encoding is little endian- Returns:
- the length in bytes
- Throws:
DicomException
- if the VL is too long to be written in Explicit VR Transfer Syntax
-