public class DataElement extends TagValue
Modifier and Type | Field and Description |
---|---|
static int |
ITEM_TAG_ELEMENT |
static int |
ITEM_TAG_GROUP |
static int |
ITEMDELIM_TAG_ELEMENT |
static int |
ITEMDELIM_TAG_GROUP |
static int |
SEQDELIM_TAG_ELEMENT |
static int |
SEQDELIM_TAG_GROUP |
static int |
UNDEFINED_LENGTH_INT |
static long |
UNDEFINED_LENGTH_LONG |
Constructor and Description |
---|
DataElement() |
Modifier and Type | Method and Description |
---|---|
void |
addATValue(ATValue atValue)
adds a value to this data element as an ATValue object
Supported value representations:AT |
void |
addBigDecimal(java.math.BigDecimal bd)
adds a value to this data element as a BigDecimal object.
|
void |
addBulkDataReference(BulkDataReference bulkDataReference)
adds a BulkDataReference to the values of this DataElement.
|
void |
addByteArray(ByteArray byteArray) |
void |
addBytes(byte[] bytes)
adds a value to this data element as a byte array
Supported value representations:AE,AS,CS,DA,DS,DT,IS,LO,OB,OW,PN,SH,ST,TM,UI,UN,UT,UR,UC,OB_OW,LT |
void |
addDouble(java.lang.Double d)
adds a value to this data element as a Double
Supported value representations:FD |
void |
addDoubles(double[] doubles)
adds a value to this data element at the specified index as a double array
Supported value representations:OD |
void |
addFloat(java.lang.Float f)
adds a value to this data element as a Float
Supported value representations:FL |
void |
addFloats(float[] floats)
adds a value to this data element at the specified index as a float array
Supported value representations:OF |
void |
addInteger(java.lang.Integer i)
adds a value to this data element as a Integer
Supported value representations:UL,SL,US,SS,IS |
void |
addLong(java.lang.Long l)
adds a value to this data element as a Long
Supported value representations:UL,SL,US,SS,IS |
void |
addPersonName(Person p)
adds a value to this data element as Person object.
|
void |
addPersonName(Person p,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset)
adds a value to this data element as Person object.
|
void |
addSequenceItem(DicomObject item)
adds a value to this data element as a DicomObject.
|
void |
addShort(java.lang.Short sh)
adds a value to this data element as a Short
Supported value representations:UL,SL,US,SS,IS |
void |
addString(java.lang.String s)
adds a value to the data element.
|
void |
addString(java.lang.String s,
DicomCharset dicomCharset)
adds a value to the data element using the specified charset for encoding
into bytes.
|
void |
addValue(java.lang.Object object)
adds a value to the data element.see setValue for more information related to the class type
of the specified object.
|
void |
clear()
clears the data element.
|
java.lang.Object |
fromATValue(ATValue atValue) |
java.lang.Object |
fromByteArray(ByteArray byteArray) |
java.lang.Object |
fromBytes(byte[] bytes) |
java.lang.Object |
fromDicomObject(DicomObject dicomObject) |
java.lang.Object |
fromDouble(java.lang.Double d) |
java.lang.Object |
fromDoubles(double[] doubles) |
java.lang.Object |
fromFloat(java.lang.Float f) |
java.lang.Object |
fromFloats(float[] floats) |
ATValue |
getATValue(int index)
returns an ATValue representation of the value of a data element.
Supported value representations:AT |
java.math.BigDecimal |
getBigDecimal(int index)
returns a BigDecimal representation of the value of a data element.
Supported value representations:DS A BigDecimal will preserve the precision of the value encoded in the decimal string. |
BulkDataReference |
getBulkDataReference(int index)
returns the value of a DataElement as a bulk data reference.
|
ByteArray |
getByteArray(int index) |
byte[] |
getBytes(int index)
returns a byte array representation of the value of a data element.
Supported value representations: AE,AS,CS,DA,DS,DT,IS,LO,LT,OB,OW,PN,SH,ST,TM,UI,UN,UT,UR,UC |
java.lang.Double |
getDouble(int index)
returns a double representation of the value of a data element.
Supported value representations:FD |
double[] |
getDoubles(int index)
returns a double representation of the value of a data element.
Supported value representations:OD |
int |
getElement()
returns the element number of the data element.
|
java.lang.Float |
getFloat(int index)
returns a float representation of the value of a data element.
Supported value representations: FL |
float[] |
getFloats(int index)
returns a float representation of the value of a data element.
Supported value representations:OF |
int |
getGroup()
returns the group number of the data element.
|
java.lang.Integer |
getInteger(int index)
returns an java.lang.Integer representation of the value of a data element.
Supported value representations: IS,SL,US,SS,US_SS Note: when the VR type is US_SS (ILE file read), the read values will be stored as US. |
java.lang.Long |
getLong(int index)
returns a java.lang.Long representation of the value of a data element.
Supported value representations: IS,UL,SL,US,SS |
Person |
getPersonName(int index)
returns a Person representation of the value of a data element.
Supported value representations: PN |
DicomObject |
getSequenceItem(int index)
returns a DicomObject representation of the value of a data element.
|
java.lang.Short |
getShort(int index)
returns a java.lang.Short representation of the value of a data element.
Supported value representations: SS |
java.lang.String |
getString(int index)
returns getString(index,true);
|
java.lang.String |
getString(int index,
boolean trim)
returns a String representation of the values of a data element, with the optional
trimming of insignificant whitespace.
This method will return a suitable String representation for all value representations except SQ for which null will be returned. |
int |
getTag()
returns the DDict constant corresponding to the group,element pair
of this data element.
|
java.lang.Object |
getValue()
returns the value at index 0.
|
java.lang.Object |
getValue(int index)
returns the value at the specified index for this data element.
|
int |
getValueLength()
returns the 'Value Length' field of a Data Element an int.
|
long |
getValueLengthAsLong()
returns the 'Value Length' field of a Data Element as a long.
|
int |
getVR()
returns the value representation of the data element.
|
java.lang.Object |
removeValue(int index)
removes the value at the specified index and shift any subsequent values
to the left.
|
void |
setATValue(ATValue atValue,
int index)
sets the value in this data element at the specified index as an ATValue object
Supported value representations:AT |
void |
setBigDecimal(java.math.BigDecimal bd,
int index)
sets the value in this data element at the specified index as a BigDecimal object.
|
void |
setBulkDataReference(BulkDataReference bulkDataReference,
int index)
sets the value of this DataElement as a BulkDataReference.
|
void |
setByteArray(ByteArray byteArray,
int index) |
void |
setBytes(byte[] bytes,
int index)
sets the value in this data element at the specified index as a byte array
Supported value representations:AE,AS,CS,DA,DS,DT,IS,LO,OB,OW,PN,SH,ST,TM,UI,UN,UT,UR,UC,OB_OW,LT |
void |
setDouble(java.lang.Double d,
int index)
sets the value in this data element at the specified index as a Double
Supported value representations:FD |
void |
setDoubles(double[] doubles,
int index)
sets the value in this data element at the specified index as a double array
Supported value representations:OD |
void |
setFloat(java.lang.Float f,
int index)
sets the value in this data element at the specified index as a Float
Supported value representations:FL |
void |
setFloats(float[] floats,
int index)
sets the value in this data element at the specified index as a float array
Supported value representations:OF |
void |
setInteger(java.lang.Integer i,
int index)
sets the value in this data element at the specified index as a Integer
Supported value representations:UL,SL,US,SS,IS |
void |
setLong(java.lang.Long l,
int index)
sets the value in this data element at the specified index as a Long
Supported value representations:UL,SL,US,SS,IS |
void |
setPersonName(Person p,
int index)
sets the value at the specified index of this data element as Person object.
|
void |
setPersonName(Person p,
int index,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset)
sets the value at the specified index of this data element as Person object.
|
void |
setSequenceItem(DicomObject item,
int index)
sets the value in this data element as a DicomObject.
|
void |
setShort(java.lang.Short sh,
int index)
sets the value in this data element at the specified index as a Short
Supported value representations:UL,SL,US,SS,IS |
void |
setString(java.lang.String s,
int index)
sets the value at index using a String representation.
|
void |
setString(java.lang.String s,
int index,
DicomCharset dicomCharset)
sets the value at index making use of the specified dicomCharset for
encoding into bytes.
|
void |
setValue(java.lang.Object object,
int index)
sets the value at the specified index.
|
int |
size()
returns the size (or multiplicity) of the data element.
|
public static final int ITEM_TAG_GROUP
public static final int ITEM_TAG_ELEMENT
public static final int SEQDELIM_TAG_GROUP
public static final int SEQDELIM_TAG_ELEMENT
public static final int ITEMDELIM_TAG_GROUP
public static final int ITEMDELIM_TAG_ELEMENT
public static final int UNDEFINED_LENGTH_INT
public static final long UNDEFINED_LENGTH_LONG
public int getGroup()
public int getElement()
getElement
in class TagValue
public int getTag()
public int size()
public java.lang.Object getValue(int index)
public java.lang.Object getValue()
public void setValue(java.lang.Object object, int index)
object
- Objectindex
- inypublic void addValue(java.lang.Object object)
object
- Objectpublic int getVR()
public int getValueLength()
getValueLengthAsLong()
.public long getValueLengthAsLong()
public void clear()
public java.lang.Object removeValue(int index)
index
- intpublic java.lang.String getString(int index) throws DicomException
index
- intDicomException
- -public java.lang.String getString(int index, boolean trim)
index
- int the index of the valuetrim
- booleanpublic void setString(java.lang.String s, int index) throws DicomException
s
- Stringindex
- intDicomException
- -public void addString(java.lang.String s) throws DicomException
s
- StringDicomException
- -public void setString(java.lang.String s, int index, DicomCharset dicomCharset) throws DicomException
s
- Stringindex
- intdicomCharset
- DicomCharsetDicomException
- -public void addString(java.lang.String s, DicomCharset dicomCharset) throws DicomException
s
- StringdicomCharset
- DicomCharsetDicomException
public java.lang.Short getShort(int index) throws DicomException
index
- intDicomException
public void setShort(java.lang.Short sh, int index) throws DicomException
sh
- Shortindex
- intDicomException
- -public void addShort(java.lang.Short sh) throws DicomException
sh
- ShortDicomException
- -public java.lang.Integer getInteger(int index) throws DicomException
index
- intDicomException
public void setInteger(java.lang.Integer i, int index) throws DicomException
i
- Integerindex
- intDicomException
- -public void addInteger(java.lang.Integer i) throws DicomException
i
- IntegerDicomException
- -public java.lang.Long getLong(int index) throws DicomException
index
- intDicomException
public void setLong(java.lang.Long l, int index) throws DicomException
l
- Longindex
- intDicomException
- -public void addLong(java.lang.Long l) throws DicomException
l
- LongDicomException
- -public Person getPersonName(int index) throws DicomException
index
- intDicomException
public void setPersonName(Person p, int index) throws DicomException
p
- Personindex
- intDicomException
- -public void setPersonName(Person p, int index, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
p
- Personindex
- intsingleByteCharset
- DicomCharset charset for encoding of the single byte component groupideographicCharset
- DicomCharset charset for encoding of the ideographic component groupphoneticCharset
- DicomCharset charset for encoding of the phonetic component groupDicomException
- -public void addPersonName(Person p) throws DicomException
p
- PersonDicomException
- -public void addPersonName(Person p, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
p
- PersonsingleByteCharset
- DicomCharsetideographicCharset
- DicomCharsetphoneticCharset
- DicomCharsetDicomException
- -public ByteArray getByteArray(int index) throws DicomException
DicomException
public void setByteArray(ByteArray byteArray, int index) throws DicomException
DicomException
public void addByteArray(ByteArray byteArray) throws DicomException
DicomException
public java.lang.Object fromByteArray(ByteArray byteArray) throws DicomException
DicomException
public byte[] getBytes(int index) throws DicomException
index
- intDicomException
public void setBytes(byte[] bytes, int index) throws DicomException
bytes
- byte[]index
- intDicomException
- -public void addBytes(byte[] bytes) throws DicomException
bytes
- byte[]DicomException
- -public java.lang.Object fromBytes(byte[] bytes) throws DicomException
DicomException
public java.lang.Float getFloat(int index) throws DicomException
index
- intDicomException
public void setFloat(java.lang.Float f, int index) throws DicomException
f
- Floatindex
- intDicomException
- -public void addFloat(java.lang.Float f) throws DicomException
f
- FloatDicomException
- -public java.lang.Object fromFloat(java.lang.Float f) throws DicomException
DicomException
public java.lang.Double getDouble(int index) throws DicomException
index
- intDicomException
public void setDouble(java.lang.Double d, int index) throws DicomException
d
- Doubleindex
- intDicomException
- -public void addDouble(java.lang.Double d) throws DicomException
d
- DoubleDicomException
- -public java.lang.Object fromDouble(java.lang.Double d) throws DicomException
DicomException
public float[] getFloats(int index) throws DicomException
index
- intDicomException
public void setFloats(float[] floats, int index) throws DicomException
floats
- float[]index
- intDicomException
- -public void addFloats(float[] floats) throws DicomException
floats
- FloatDicomException
- -public java.lang.Object fromFloats(float[] floats) throws DicomException
DicomException
public double[] getDoubles(int index) throws DicomException
index
- intDicomException
public void setDoubles(double[] doubles, int index) throws DicomException
doubles
- double[]index
- intDicomException
- -public void addDoubles(double[] doubles) throws DicomException
doubles
- DoubleDicomException
- -public java.lang.Object fromDoubles(double[] doubles) throws DicomException
DicomException
public DicomObject getSequenceItem(int index) throws DicomException
index
- intDicomException
public void setSequenceItem(DicomObject item, int index) throws DicomException
item
- DicomObjectindex
- intDicomException
- -public void addSequenceItem(DicomObject item) throws DicomException
item
- DicomObjectDicomException
- -public java.lang.Object fromDicomObject(DicomObject dicomObject) throws DicomException
DicomException
public ATValue getATValue(int index) throws DicomException
index
- intDicomException
public void setATValue(ATValue atValue, int index) throws DicomException
atValue
- ATValueindex
- intDicomException
- -public void addATValue(ATValue atValue) throws DicomException
atValue
- ATValueDicomException
- -public java.lang.Object fromATValue(ATValue atValue) throws DicomException
DicomException
public java.math.BigDecimal getBigDecimal(int index) throws DicomException
index
- intDicomException
public void setBigDecimal(java.math.BigDecimal bd, int index) throws DicomException
bd
- BigDecimalindex
- intDicomException
- -public void addBigDecimal(java.math.BigDecimal bd) throws DicomException
bd
- BigDecimalDicomException
- -public BulkDataReference getBulkDataReference(int index) throws DicomException
index
- -DicomException
public void setBulkDataReference(BulkDataReference bulkDataReference, int index) throws DicomException
bulkDataReference
- bulkDataReferenceindex
- -DicomException
- -public void addBulkDataReference(BulkDataReference bulkDataReference) throws DicomException
bulkDataReference
- bulkDataReferenceDicomException
- -