public class OtherWordAttributeOnDisk extends OtherAttributeOnDisk
A concrete class specializing Attribute
for
Other Word (OW) attributes whose values are not memory resident.
Though an instance of this class may be created
using its constructors, there is also a factory class, AttributeFactory
.
Attribute
,
AttributeFactory
,
AttributeList
,
OtherByteAttributeOnDisk
Modifier and Type | Field and Description |
---|---|
protected boolean |
bigEndian |
byteOffset, deleteFilesWhenNoLongerNeeded, file
valueLength, valueMultiplicity
Constructor and Description |
---|
OtherWordAttributeOnDisk(AttributeTag t)
Construct an (empty) attribute.
|
OtherWordAttributeOnDisk(AttributeTag t,
boolean bigEndian)
Construct an (empty) attribute.
|
OtherWordAttributeOnDisk(AttributeTag t,
long vl,
DicomInputStream i,
long byteOffset)
Read an attribute from an input stream.
|
OtherWordAttributeOnDisk(AttributeTag t,
java.lang.Long vl,
DicomInputStream i,
java.lang.Long byteOffset)
Read an attribute from an input stream.
|
Modifier and Type | Method and Description |
---|---|
short[] |
getShortValues()
Get the values of this attribute as a short array.
|
short[] |
getShortValuesForSelectedFrame(int frameNumber,
int numberOfFrames)
Get the value of this attribute as a short array for one selected frame.
|
short[][] |
getShortValuesPerFrame(int numberOfFrames)
Get the values of this attribute as multiple short arrays, one per frame.
|
byte[] |
getVR()
Get the value representation of this attribute (OW).
|
boolean |
isBigEndian()
Is the data on disk byte order big endian ?
|
void |
write(DicomOutputStream o)
Write the entire attribute (including values) to the output stream.
|
deleteFilesWhenNoLongerNeeded, finalize, getByteOffset, getFile, removeValues, setFile, setFile, toString
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, getPaddedVL, 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
public OtherWordAttributeOnDisk(AttributeTag t)
Construct an (empty) attribute.
Any file set later will be expected to be little endian.t
- the tag of the attributepublic OtherWordAttributeOnDisk(AttributeTag t, boolean bigEndian)
Construct an (empty) attribute.
Any file set later will be expected to be in the specified byte order.t
- the tag of the attributebigEndian
- big endian, false if little endianpublic OtherWordAttributeOnDisk(AttributeTag t, long vl, DicomInputStream i, long byteOffset) throws java.io.IOException, DicomException
Read an attribute from an input stream.
t
- the tag of the attributevl
- the value length of the attributei
- the input streambyteOffset
- the byte offset in the input stream of the start of the datajava.io.IOException
DicomException
public OtherWordAttributeOnDisk(AttributeTag t, java.lang.Long vl, DicomInputStream i, java.lang.Long byteOffset) throws java.io.IOException, DicomException
Read an attribute from an input stream.
t
- the tag of the attributevl
- the value length of the attributei
- the input streambyteOffset
- the byte offset in the input stream of the start of the datajava.io.IOException
DicomException
public short[] getShortValues() throws DicomException
Get the values of this attribute as a short array.
This allocates a new array of sufficient length, which may fail if it is too large,
and defeats the point of leaving the values on disk in the first place. However, it
is a fallback for when the caller does not want to go to the trouble of creating a
MappedByteBuffer
from which to get a ShortBuffer
from the file,
or more likely is not even aware that the attribute values have been left on disk, because
AttributeFactory
silently created an instance of this
class rather than an in-memory OtherWordAttribute
.
getShortValues
in class Attribute
DicomException
- thrown if values cannot be readpublic short[] getShortValuesForSelectedFrame(int frameNumber, int numberOfFrames) throws DicomException
Get the value of this attribute as a short array for one selected frame.
This allocates a new array of sufficient length, which may fail if it is too large,
and defeats the point of leaving the values on disk in the first place. However, it
is a fallback for when the caller does not want to go to the trouble of creating a
MappedByteBuffer
from which to get a ShortBuffer
from the file,
or more likely is not even aware that the attribute values have been left on disk, because
AttributeFactory
silently created an instance of this
class rather than an in-memory OtherWordAttribute
.
frameNumber
- from 0numberOfFrames
- the number of framesDicomException
- thrown if values cannot be readpublic short[][] getShortValuesPerFrame(int numberOfFrames) throws DicomException
Get the values of this attribute as multiple short arrays, one per frame.
Caller needs to supply the number for frames so that pixel data can be split across per-frame arrays (since not necessarily known when this attribute was created or read.
This allocates new arrays of sufficient length, which may fail if they are too large,
and defeats the point of leaving the values on disk in the first place. However, it
is a fallback for when the caller does not want to go to the trouble of creating a
MappedByteBuffer
from which to get a ShortBuffer
from the file,
or more likely is not even aware that the attribute values have been left on disk.
numberOfFrames
- the number of framesDicomException
- thrown if values cannot be readpublic byte[] getVR()
Get the value representation of this attribute (OW).
getVR
in class Attribute
ValueRepresentation
public boolean isBigEndian()
Is the data on disk byte order big endian ?
public void write(DicomOutputStream o) throws DicomException, java.io.IOException
Attribute
Write the entire attribute (including values) to the output stream.
write
in class Attribute
o
- java.io.IOException
DicomException