public class DicomObject extends GroupList
Java Type | DICOM Type |
setShort/addShort | UL,SL,US,SS,IS |
setATValue/addATValue | AT |
setInteger/addInteger | UL,SL,US,SS,IS |
setLong/addLong | UL,SL,US,SS,IS |
setFloat/addFloat | FL |
setDouble/addDouble | FD |
setBigDecimal/addBigDecimal | DS |
setBytes/addBytes | AE,AS,CS,DA,DS,DT,IS,LO,OB,OW,OL,PN,SH,ST,TM,UI,UN,UT,UR,UC,OB_OW |
setFloats/addFloats | OF |
setDoubles/addDoubles | OD |
setString/addString | LT,ST,UT,UR,UC,LO,SH,AE,CT,DT,TM,UI,AS,PN,DA,DS,FL,IS,SS,US,US_SS,SL,UL,FD,OB,OW,OB_OW,OL,UN |
setPersonName/addPersonName | PN |
setSequenceItem/addSequenceItem | SQ |
Java Type | DICOM Type |
getShort | SS |
getATValue | AT |
getInteger | SL,US,SS,IS |
getLong | UL,SL,US,SS,IS |
getFloat | FL |
getDouble | FD |
getBigDecimal | DS |
getBytes | AE,AS,CS,DA,DS,DT,IS,LO,LT,OB,OW,OL,PN,SH,ST,TM,UI,UN,UT,UR,UC |
getFloats | OF |
getDoubles | OD |
getString | all DICOM Value Representations except SQ |
getPersonName | PN |
getSequenceItem | SQ |
Constructor and Description |
---|
DicomObject()
Constructs an empty DicomObject
|
Modifier and Type | Method and Description |
---|---|
void |
addATValue_ge(int group,
int element,
ATValue atValue) |
void |
addATValue(int dname,
ATValue atValue) |
void |
addBigDecimal_ge(int group,
int element,
java.math.BigDecimal bd) |
void |
addBigDecimal_ge(int group,
int element,
java.lang.String creator,
java.math.BigDecimal bd) |
void |
addBigDecimal(int dname,
java.math.BigDecimal bd) |
void |
addBulkDataReference_ge(int group,
int element,
BulkDataReference bulkDataReference)
|
void |
addBulkDataReference_ge(int group,
int element,
java.lang.String creator,
BulkDataReference bulkDataReference) |
void |
addBulkDataReference(int dname,
BulkDataReference bulkDataReference)
|
void |
addByteArray_ge(int group,
int element,
ByteArray byteArray) |
void |
addByteArray_ge(int group,
int element,
java.lang.String creator,
ByteArray byteArray) |
void |
addByteArray(int dname,
ByteArray byteArray) |
void |
addBytes_ge(int group,
int element,
byte[] bytes) |
void |
addBytes_ge(int group,
int element,
java.lang.String creator,
byte[] bytes) |
void |
addBytes(int dname,
byte[] bytes) |
void |
addDouble_ge(int group,
int element,
java.lang.Double d) |
void |
addDouble_ge(int group,
int element,
java.lang.String creator,
java.lang.Double d) |
void |
addDouble(int dname,
java.lang.Double d) |
void |
addDoubles_ge(int group,
int element,
double[] doubles) |
void |
addDoubles_ge(int group,
int element,
java.lang.String creator,
double[] doubles) |
void |
addDoubles(int dname,
double[] doubles) |
void |
addFloat_ge(int group,
int element,
java.lang.Float f) |
void |
addFloat_ge(int group,
int element,
java.lang.String creator,
java.lang.Float f) |
void |
addFloat(int dname,
java.lang.Float f) |
void |
addFloats_ge(int group,
int element,
float[] floats) |
void |
addFloats_ge(int group,
int element,
java.lang.String creator,
float[] floats) |
void |
addFloats(int dname,
float[] floats) |
void |
addInteger_ge(int group,
int element,
java.lang.Integer i) |
void |
addInteger_ge(int group,
int element,
java.lang.String creator,
java.lang.Integer i) |
void |
addInteger(int dname,
java.lang.Integer i) |
void |
addLong_ge(int group,
int element,
java.lang.Long l) |
void |
addLong_ge(int group,
int element,
java.lang.String creator,
java.lang.Long l) |
void |
addLong(int dname,
java.lang.Long l) |
void |
addPersonName_ge(int group,
int element,
Person person) |
void |
addPersonName_ge(int group,
int element,
Person person,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset)
adds a Person value to a PN data element.
|
void |
addPersonName_ge(int group,
int element,
java.lang.String creator,
Person person) |
void |
addPersonName_ge(int group,
int element,
java.lang.String creator,
Person person,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset) |
void |
addPersonName(int dname,
Person person) |
void |
addPersonName(int dname,
Person person,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset)
adds a Person value to a PN data element.
|
void |
addSequenceItem_ge(int group,
int element,
DicomObject dicomObject) |
void |
addSequenceItem_ge(int group,
int element,
java.lang.String creator,
DicomObject dicomObject) |
void |
addSequenceItem(int dname,
DicomObject item) |
void |
addShort_ge(int group,
int element,
java.lang.Short sh) |
void |
addShort_ge(int group,
int element,
java.lang.String creator,
java.lang.Short sh) |
void |
addShort(int dname,
java.lang.Short sh) |
void |
addString_ge(int group,
int element,
java.lang.String s) |
void |
addString_ge(int group,
int element,
java.lang.String creator,
java.lang.String s) |
void |
addString(int dname,
java.lang.String s) |
void |
append_ge(int g,
int e,
java.lang.Object o)
Does the same as
append(dname, o) using a (group, element) - pair instead of 'dname' |
void |
append_ge(int group,
int element,
java.lang.String creator,
java.lang.Object o) |
void |
append(int dname,
java.lang.Object o)
This methods takes an Object 'o', converts it to the appropriate Java type and
appends it after the last value of the data element with name 'dname'.
|
long |
calculateOffset(int seq,
int i,
int transferSyntax,
boolean sequenceUndefined,
boolean grouplens)
This method calculates the offset of the 'i'th item of sequence 'seq', starting from the very first
byte of the Dicom file.
|
java.util.List |
deleteItem_ge(int g,
int e)
Does the same as
deleteItem(dname) using a (group, element) - pair instead of 'dname' |
java.lang.Object |
deleteItem_ge(int g,
int e,
int i)
Does the same as
deleteItem(dname, i) using a (group, element) - pair instead of 'dname' |
java.util.List |
deleteItem_ge(int group,
int element,
java.lang.String creator) |
java.lang.Object |
deleteItem_ge(int group,
int element,
java.lang.String creator,
int index) |
java.util.List |
deleteItem(int dname)
Deletes the data element named 'dname' from this DicomObject and returns the values
of that data element as a List.
|
java.lang.Object |
deleteItem(int dname,
int i)
Deletes the value at index 'i' from the data element called 'dname'
The elements with a higher index are all shifted downwards.
|
DicomCharset[] |
dicomCharsets()
returns the specific character sets specified in the SpecificCharacterSet
data element as an array of DicomCharset objects that applies to this DicomObject.
|
void |
dumpVRs(java.io.OutputStream os)
prints all data elements in this DicomObject to an OutputStream in a nice,
orderly fashion.
|
void |
dumpVRs(java.io.OutputStream os,
boolean metainfo)
prints all data elements in this DicomObject to an OutputStream in a nice,
orderly fashion.
|
void |
dumpVRs(java.io.OutputStream os,
int maxdescription,
int maxvalue,
int indentsize,
boolean metainfo,
boolean grouplengths)
prints all data elements in this DicomObject to an OutputStream in a nice,
orderly fashion.
|
java.lang.Object |
get_ge(int g,
int e)
Does the same as
get(dname) using a (group, element) - pair instead of 'dname'. |
java.lang.Object |
get_ge(int g,
int e,
int i)
Does the same as
get(dname, i) using a (group, element) - pair instead of 'dname' |
java.lang.Object |
get_ge(int group,
int element,
java.lang.String creator) |
java.lang.Object |
get_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.Object |
get(int dname)
This method finds the first value of the data element named 'dname'
and returns it as its default Java type.
|
java.lang.Object |
get(int dname,
int i)
This method finds the value at index 'i' of the data element named 'dname'
and returns it as its default Java type.
|
ATValue |
getATValue_ge(int group,
int element,
int index) |
ATValue |
getATValue(int dname,
int index) |
java.math.BigDecimal |
getBigDecimal_ge(int group,
int element,
int index) |
java.math.BigDecimal |
getBigDecimal_ge(int group,
int element,
java.lang.String creator,
int index) |
java.math.BigDecimal |
getBigDecimal(int dname,
int index) |
BulkDataReference |
getBulkDataReference_ge(int group,
int element,
int index)
|
BulkDataReference |
getBulkDataReference_ge(int group,
int element,
java.lang.String creator,
int index)
|
BulkDataReference |
getBulkDataReference(int dname,
int index)
|
ByteArray |
getByteArray_ge(int group,
int element,
int index) |
ByteArray |
getByteArray_ge(int group,
int element,
java.lang.String creator,
int index) |
ByteArray |
getByteArray(int dname,
int index) |
byte[] |
getBytes_ge(int group,
int element,
int index) |
byte[] |
getBytes_ge(int group,
int element,
java.lang.String creator,
int index) |
byte[] |
getBytes(int dname,
int index) |
DataElement |
getDataElement(int dname)
returns the tag value as a DataElement for the specified DDict constant
or null if this object does not contain such a DataElement.
|
DataElement |
getDataElement(int group,
int element)
returns the tag value as a DataElement for the specified
group and element number or null if this object does not
contain such a DataElement.
|
DataElement |
getDataElement(int group,
int element,
java.lang.String creator) |
java.lang.Double |
getDouble_ge(int group,
int element,
int index) |
java.lang.Double |
getDouble_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.Double |
getDouble(int dname,
int index) |
double[] |
getDoubles_ge(int group,
int element,
int index) |
double[] |
getDoubles_ge(int group,
int element,
java.lang.String creator,
int index) |
double[] |
getDoubles(int dname,
int index) |
DicomObject |
getFileMetaInformation()
File Meta Information is stored in a separate DicomObject.
|
java.lang.Float |
getFloat_ge(int group,
int element,
int index) |
java.lang.Float |
getFloat_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.Float |
getFloat(int dname,
int index) |
float[] |
getFloats_ge(int group,
int element,
int index) |
float[] |
getFloats_ge(int group,
int element,
java.lang.String creator,
int index) |
float[] |
getFloats(int dname,
int index) |
int |
getI_ge(int g,
int e)
Deprecated.
|
int |
getI_ge(int g,
int e,
int i)
Deprecated.
|
int |
getI(int dname)
Deprecated.
|
int |
getI(int dname,
int i)
Deprecated.
|
java.lang.Integer |
getInteger_ge(int group,
int element,
int index) |
java.lang.Integer |
getInteger_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.Integer |
getInteger(int dname,
int index) |
java.lang.Long |
getLong_ge(int group,
int element,
int index) |
java.lang.Long |
getLong_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.Long |
getLong(int dname,
int index) |
long |
getOffset(int seq,
int i)
returns the offset of the 'i'th SequenceItem 'seq'.
|
DicomObject |
getParent()
returns the parent DicomObject.
|
Person |
getPersonName_ge(int group,
int element,
int index) |
Person |
getPersonName_ge(int group,
int element,
java.lang.String creator,
int index) |
Person |
getPersonName(int dname,
int index) |
byte[] |
getPreamble()
returns the 128 byte preamble or null if the preamble is not
set in a new DicomObject.
|
java.lang.String |
getS_ge(int g,
int e)
Deprecated.
|
java.lang.String |
getS_ge(int g,
int e,
int i)
Deprecated.
|
java.lang.String |
getS(int dname)
Deprecated.
|
java.lang.String |
getS(int dname,
int i)
Deprecated.
|
int |
getSeqItemLenState()
returns the length encoding of this DicomObject in case it is
a sequence item in a sequence.
|
int |
getSeqLenState_ge(int group,
int element)
returns the length encoding of a sequence with specified group
and element number.
|
int |
getSeqLenState_ge(int group,
int element,
java.lang.String creator) |
int |
getSeqLenState(int dname)
returns the length encoding of a sequence with specified tag.
|
DicomObject |
getSequenceItem_ge(int group,
int element,
int index) |
DicomObject |
getSequenceItem_ge(int group,
int element,
java.lang.String creator,
int index) |
DicomObject |
getSequenceItem(int dname,
int index) |
java.lang.Short |
getShort_ge(int group,
int element,
int index) |
java.lang.Short |
getShort_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.Short |
getShort(int dname,
int index) |
int |
getSize_ge(int g,
int e)
Does the same as
getSize(dname)
using a (group, element) - pair instead of 'dname' |
int |
getSize_ge(int group,
int element,
java.lang.String creator) |
int |
getSize(int dname)
Method returns the number of values in the data element with name 'dname'.
|
java.lang.String |
getString_ge(int group,
int element,
int index) |
java.lang.String |
getString_ge(int group,
int element,
int index,
boolean trim) |
java.lang.String |
getString_ge(int group,
int element,
java.lang.String creator,
int index) |
java.lang.String |
getString_ge(int group,
int element,
java.lang.String creator,
int index,
boolean trim) |
java.lang.String |
getString(int dname,
int index) |
java.lang.String |
getString(int dname,
int index,
boolean trim) |
int |
getType_ge(int group,
int element)
Returns the VR type of a tag in this DicomObject.
|
int |
getType_ge(int group,
int element,
java.lang.String creator) |
int |
getType(int dname)
Returns the VR type of a tag in this DicomObject.
|
DataElement |
newDataElement_ge(int group,
int element)
creates a new DataElement for the specified group and element and adds it to the DicomObject.
|
DataElement |
newDataElement_ge(int group,
int element,
java.lang.String creator) |
DataElement |
newDataElement(int dname)
creates a new DataElement for the specified DDict constant and adds it to the DicomObject.
|
void |
read(java.io.InputStream in)
Does the same as
read(in, readpixels) ,
with the 'readpixels' boolean set to true. |
void |
read(java.io.InputStream in,
boolean readpixels)
reads a DICOM dataset from an InputStream and stores the data elements in this DicomObject.
|
void |
read(java.io.InputStream in,
int transfersyntax,
boolean readpixels)
reads a DICOM Dataset from an InputStream.
|
void |
remove_ge(int group,
int element) |
void |
remove_ge(int group,
int element,
java.lang.String creator) |
void |
remove(int dname) |
void |
set_ge(int g,
int e,
java.lang.Object o)
Does the same as
set(dname, o) using a (group, element) - pair instead of 'dname' |
void |
set_ge(int g,
int e,
java.lang.Object o,
int i)
Does the same as
set(dname, o, i) using a (group, element) - pair instead of 'dname' |
void |
set_ge(int group,
int element,
java.lang.String creator,
java.lang.Object o) |
void |
set_ge(int group,
int element,
java.lang.String creator,
java.lang.Object o,
int index) |
void |
set(int dname,
java.lang.Object o)
This methods takes an Object 'o', converts it to the approprate Java type and
replaces the data element with name 'dname' with it.
|
void |
set(int dname,
java.lang.Object o,
int i)
This methods takes an Object 'o', converts it to the approprate Java type and
Overwrites the value at index 'i' of the data element named 'dname'
with it.
|
void |
setATValue_ge(int group,
int element,
ATValue atValue,
int index) |
void |
setATValue(int dname,
ATValue atValue,
int index) |
void |
setBigDecimal_ge(int group,
int element,
java.math.BigDecimal bd,
int index) |
void |
setBigDecimal_ge(int group,
int element,
java.lang.String creator,
java.math.BigDecimal bd,
int index) |
void |
setBigDecimal(int dname,
java.math.BigDecimal bd,
int index) |
void |
setBulkDataReference_ge(int group,
int element,
BulkDataReference bulkDataReference,
int index)
|
void |
setBulkDataReference_ge(int group,
int element,
java.lang.String creator,
BulkDataReference bulkDataReference,
int index)
|
void |
setBulkDataReference(int dname,
BulkDataReference bulkDataReference,
int index)
|
void |
setByteArray_ge(int group,
int element,
ByteArray byteArray,
int index) |
void |
setByteArray_ge(int group,
int element,
java.lang.String creator,
ByteArray byteArray,
int index) |
void |
setByteArray(int dname,
ByteArray byteArray,
int index) |
void |
setBytes_ge(int group,
int element,
byte[] bytes,
int index) |
void |
setBytes_ge(int group,
int element,
java.lang.String creator,
byte[] bytes,
int index) |
void |
setBytes(int dname,
byte[] bytes,
int index) |
void |
setDouble_ge(int group,
int element,
java.lang.Double d,
int index) |
void |
setDouble_ge(int group,
int element,
java.lang.String creator,
java.lang.Double d,
int index) |
void |
setDouble(int dname,
java.lang.Double d,
int index) |
void |
setDoubles_ge(int group,
int element,
double[] doubles,
int index) |
void |
setDoubles_ge(int group,
int element,
java.lang.String creator,
double[] doubles,
int index) |
void |
setDoubles(int dname,
double[] doubles,
int index) |
DicomObject |
setFileMetaInformation(DicomObject fmi)
Use this method to specify a new file meta information object that will be used
when writing to a Dicom file.
|
void |
setFloat_ge(int group,
int element,
java.lang.Float f,
int index) |
void |
setFloat_ge(int group,
int element,
java.lang.String creator,
java.lang.Float f,
int index) |
void |
setFloat(int dname,
java.lang.Float f,
int index) |
void |
setFloats_ge(int group,
int element,
float[] floats,
int index) |
void |
setFloats_ge(int group,
int element,
java.lang.String creator,
float[] floats,
int index) |
void |
setFloats(int dname,
float[] floats,
int index) |
void |
setInteger_ge(int group,
int element,
java.lang.Integer i,
int index) |
void |
setInteger_ge(int group,
int element,
java.lang.String creator,
java.lang.Integer i,
int index) |
void |
setInteger(int dname,
java.lang.Integer i,
int index) |
void |
setLong_ge(int group,
int element,
java.lang.Long l,
int index) |
void |
setLong_ge(int group,
int element,
java.lang.String creator,
java.lang.Long l,
int index) |
void |
setLong(int dname,
java.lang.Long l,
int index) |
void |
setPersonName_ge(int group,
int element,
Person person,
int index) |
void |
setPersonName_ge(int group,
int element,
Person person,
int index,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset)
sets a value of a PN element at the specified tag and index.
|
void |
setPersonName_ge(int group,
int element,
java.lang.String creator,
Person person,
int index) |
void |
setPersonName_ge(int group,
int element,
java.lang.String creator,
Person person,
int index,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset) |
void |
setPersonName(int dname,
Person person,
int index) |
void |
setPersonName(int dname,
Person person,
int index,
DicomCharset singleByteCharset,
DicomCharset ideographicCharset,
DicomCharset phoneticCharset)
sets a value of a PN data element at the specified tag and index.
|
void |
setPreamble(byte[] preamble)
sets the 128 byte preamble.
|
void |
setSeqItemLenState(int state)
sets the length encoding of this DicomObject in case it is
a sequence item
|
void |
setSeqLenState_ge(int group,
int element,
int seqLenState)
sets the length encoding of a sequence.
|
void |
setSeqLenState_ge(int group,
int element,
java.lang.String creator,
int seqLenState) |
void |
setSeqLenState(int dname,
int seqLenState)
sets the length encoding of a sequence.
|
void |
setSequenceItem_ge(int group,
int element,
DicomObject item,
int index) |
void |
setSequenceItem_ge(int group,
int element,
java.lang.String creator,
DicomObject item,
int index) |
void |
setSequenceItem(int dname,
DicomObject item,
int index) |
void |
setShort_ge(int group,
int element,
java.lang.Short sh,
int index) |
void |
setShort_ge(int group,
int element,
java.lang.String creator,
java.lang.Short sh,
int index) |
void |
setShort(int dname,
java.lang.Short sh,
int index) |
void |
setString_ge(int group,
int element,
java.lang.String s,
int index) |
void |
setString_ge(int group,
int element,
java.lang.String creator,
java.lang.String s,
int index) |
void |
setString(int dname,
java.lang.String s,
int index) |
void |
setType_ge(int group,
int element,
int vrtype)
Use this method to further specify the type for tags which the
type is currently tUS_US or tOW_OB.Only these VR type changes are allowed:
tUS_US : tUS or tSS
tOW_OB : tOW or tOB
|
void |
setType_ge(int group,
int element,
java.lang.String creator,
int vrtype) |
void |
setType(int dname,
int vrtype)
Use this method to further specify the type for tags which
type is currently tUS_US or tOW_OB.
|
void |
write(java.io.OutputStream out,
boolean dicomfile)
writes this DICOM data set to an OutputStream as a DICOM file or
DICOM stream.
|
void |
write(java.io.OutputStream out,
boolean dicomfile,
int transfersyntax,
boolean seq_undef)
writes this DICOM data set to an OutputStream as a DICOM file or
DICOM stream.
|
void |
write(java.io.OutputStream out,
boolean dicomfile,
int transfersyntax,
boolean seq_undef,
boolean grouplens)
Does the same as
write(out, f, ts, seq_undef)
and, in addition, lets you specify whether to write grouplengths. |
addGroups, clear, containsGroup, copyGroup, enumerateVRs, enumerateVRs, isEmpty, numberOfElements, numberOfGroups, removeGroup
protected transient JdtLogger log
public DicomObject getParent()
public DicomCharset[] dicomCharsets()
See Dicom Standard Part 5 (7.5.3) for rules related to inheritance of the Specific Character Set attribute.
public void setSeqItemLenState(int state)
state
- int one of DicomObject.SEQITEM_NEW,DicomObject.SEQITEM_UNDEFLEN,DicomObject.SEQITEM_DEFLENpublic int getSeqItemLenState()
public void setPreamble(byte[] preamble)
preamble
- the preamblepublic byte[] getPreamble()
public DataElement newDataElement(int dname)
dname
- public DDict constant or generated constantpublic DataElement newDataElement_ge(int group, int element)
group
- the group part of the tagelement
- the element part of the tagpublic DataElement newDataElement_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public void set(int dname, java.lang.Object o) throws DicomException
o
- if 'null' is given, the data element becomes emptyDicomException
public void set_ge(int g, int e, java.lang.Object o) throws DicomException
set(dname, o)
using a (group, element) - pair instead of 'dname'DicomException
public void set_ge(int group, int element, java.lang.String creator, java.lang.Object o) throws DicomException
DicomException
public void append(int dname, java.lang.Object o) throws DicomException
o
- if 'null' is given, nothing will happen.DicomException
public void append_ge(int g, int e, java.lang.Object o) throws DicomException
append(dname, o)
using a (group, element) - pair instead of 'dname'o
- - if 'null' is given, nothing will happen.DicomException
public void append_ge(int group, int element, java.lang.String creator, java.lang.Object o) throws DicomException
DicomException
public void set(int dname, java.lang.Object o, int i) throws DicomException
o
- if 'null' is given, nothing will happen.DicomException
public void set_ge(int g, int e, java.lang.Object o, int i) throws DicomException
set(dname, o, i)
using a (group, element) - pair instead of 'dname'DicomException
public void set_ge(int group, int element, java.lang.String creator, java.lang.Object o, int index) throws DicomException
DicomException
public int getType(int dname) throws DicomException
dname
- one of the DDict constants representing a tagDicomException
- if no tag is found in this DicomObjectpublic int getType_ge(int group, int element) throws DicomException
group
- groupelement
- elementDicomException
- if no tag is found in this DicomObjectpublic int getType_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public void setType(int dname, int vrtype) throws DicomException
dname
- one of the DDict constants representing a tagvrtype
- one of the DDict constants such as tST,tUL, ...DicomException
- if the tag is not found or the type conversion is
illegalpublic void setType_ge(int group, int element, int vrtype) throws DicomException
group
- the group part of the tagelement
- the element part of the tagvrtype
- one of the DDict constants such as tST,tUL, ...DicomException
- if the tag is not found or the type conversion is
illegalpublic void setType_ge(int group, int element, java.lang.String creator, int vrtype) throws DicomException
DicomException
public void setSeqLenState_ge(int group, int element, int seqLenState) throws DicomException
group
- the group part of the tagelement
- the element part of the tagseqLenState
- one of VR.SEQ_NEW,VR.SEQ_UNDEFLEN,VR.SEQ_DEFLENDicomException
- thrown when the specified data element could not be foundpublic void setSeqLenState_ge(int group, int element, java.lang.String creator, int seqLenState) throws DicomException
DicomException
public void setSeqLenState(int dname, int seqLenState) throws DicomException
dname
- a DDict constant or private constantseqLenState
- one of VR.SEQ_NEW,VR.SEQ_UNDEFLEN,VR.SEQ_DEFLENDicomException
- thrown when the specified data element could not be foundpublic int getSeqLenState_ge(int group, int element) throws DicomException
group
- the group part of the tagelement
- the element part of the tagDicomException
- thrown when the specified data element could not be foundpublic int getSeqLenState_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public int getSeqLenState(int dname) throws DicomException
dname
- the DDict constant or a private constantDicomException
- thrown when the specified data element could not be foundpublic int getSize(int dname)
public int getSize_ge(int g, int e)
getSize(dname)
using a (group, element) - pair instead of 'dname'public int getSize_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public long calculateOffset(int seq, int i, int transferSyntax, boolean sequenceUndefined, boolean grouplens)
Offsets
seq
- the name of the sequence the item is ini
- the number of the itemtransferSyntax
- the transfer syntax that will be used for writing this DicomObjectsequenceUndefined
- what kind of sequence encoding will be used when writing this DicomObjectgrouplens
- boolean indicating whether grouplengths will be writtenpublic long getOffset(int seq, int i)
DDict.tUNKNOWN
.
If the sequence or item aren't found, 0 is returned.
calculateOffset(seq, item, ts, su, grouplen)
.public java.lang.String getString(int dname, int index) throws DicomException
DicomException
public java.lang.String getString(int dname, int index, boolean trim) throws DicomException
DicomException
public java.lang.String getString_ge(int group, int element, int index) throws DicomException
DicomException
public java.lang.String getString_ge(int group, int element, int index, boolean trim) throws DicomException
DicomException
public java.lang.String getString_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public java.lang.String getString_ge(int group, int element, java.lang.String creator, int index, boolean trim) throws DicomException
DicomException
public void setString(int dname, java.lang.String s, int index) throws DicomException
DicomException
public void setString_ge(int group, int element, java.lang.String s, int index) throws DicomException
DicomException
public void setString_ge(int group, int element, java.lang.String creator, java.lang.String s, int index) throws DicomException
DicomException
public void addString(int dname, java.lang.String s) throws DicomException
DicomException
public void addString_ge(int group, int element, java.lang.String s) throws DicomException
DicomException
public void addString_ge(int group, int element, java.lang.String creator, java.lang.String s) throws DicomException
DicomException
public java.math.BigDecimal getBigDecimal(int dname, int index) throws DicomException
DicomException
public java.math.BigDecimal getBigDecimal_ge(int group, int element, int index) throws DicomException
DicomException
public java.math.BigDecimal getBigDecimal_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setBigDecimal(int dname, java.math.BigDecimal bd, int index) throws DicomException
DicomException
public void setBigDecimal_ge(int group, int element, java.math.BigDecimal bd, int index) throws DicomException
DicomException
public void setBigDecimal_ge(int group, int element, java.lang.String creator, java.math.BigDecimal bd, int index) throws DicomException
DicomException
public void addBigDecimal(int dname, java.math.BigDecimal bd) throws DicomException
DicomException
public void addBigDecimal_ge(int group, int element, java.math.BigDecimal bd) throws DicomException
DicomException
public void addBigDecimal_ge(int group, int element, java.lang.String creator, java.math.BigDecimal bd) throws DicomException
DicomException
public java.lang.Short getShort(int dname, int index) throws DicomException
DicomException
public java.lang.Short getShort_ge(int group, int element, int index) throws DicomException
DicomException
public java.lang.Short getShort_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setShort(int dname, java.lang.Short sh, int index) throws DicomException
DicomException
public void setShort_ge(int group, int element, java.lang.Short sh, int index) throws DicomException
DicomException
public void setShort_ge(int group, int element, java.lang.String creator, java.lang.Short sh, int index) throws DicomException
DicomException
public void addShort(int dname, java.lang.Short sh) throws DicomException
DicomException
public void addShort_ge(int group, int element, java.lang.Short sh) throws DicomException
DicomException
public void addShort_ge(int group, int element, java.lang.String creator, java.lang.Short sh) throws DicomException
DicomException
public java.lang.Integer getInteger(int dname, int index) throws DicomException
DicomException
public java.lang.Integer getInteger_ge(int group, int element, int index) throws DicomException
DicomException
public java.lang.Integer getInteger_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setInteger(int dname, java.lang.Integer i, int index) throws DicomException
DicomException
public void setInteger_ge(int group, int element, java.lang.Integer i, int index) throws DicomException
DicomException
public void setInteger_ge(int group, int element, java.lang.String creator, java.lang.Integer i, int index) throws DicomException
DicomException
public void addInteger(int dname, java.lang.Integer i) throws DicomException
DicomException
public void addInteger_ge(int group, int element, java.lang.Integer i) throws DicomException
DicomException
public void addInteger_ge(int group, int element, java.lang.String creator, java.lang.Integer i) throws DicomException
DicomException
public java.lang.Long getLong(int dname, int index) throws DicomException
DicomException
public java.lang.Long getLong_ge(int group, int element, int index) throws DicomException
DicomException
public java.lang.Long getLong_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setLong(int dname, java.lang.Long l, int index) throws DicomException
DicomException
public void setLong_ge(int group, int element, java.lang.Long l, int index) throws DicomException
DicomException
public void setLong_ge(int group, int element, java.lang.String creator, java.lang.Long l, int index) throws DicomException
DicomException
public void addLong(int dname, java.lang.Long l) throws DicomException
DicomException
public void addLong_ge(int group, int element, java.lang.Long l) throws DicomException
DicomException
public void addLong_ge(int group, int element, java.lang.String creator, java.lang.Long l) throws DicomException
DicomException
public java.lang.Float getFloat(int dname, int index) throws DicomException
DicomException
public java.lang.Float getFloat_ge(int group, int element, int index) throws DicomException
DicomException
public java.lang.Float getFloat_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setFloat(int dname, java.lang.Float f, int index) throws DicomException
DicomException
public void setFloat_ge(int group, int element, java.lang.Float f, int index) throws DicomException
DicomException
public void setFloat_ge(int group, int element, java.lang.String creator, java.lang.Float f, int index) throws DicomException
DicomException
public void addFloat(int dname, java.lang.Float f) throws DicomException
DicomException
public void addFloat_ge(int group, int element, java.lang.Float f) throws DicomException
DicomException
public void addFloat_ge(int group, int element, java.lang.String creator, java.lang.Float f) throws DicomException
DicomException
public java.lang.Double getDouble(int dname, int index) throws DicomException
DicomException
public java.lang.Double getDouble_ge(int group, int element, int index) throws DicomException
DicomException
public java.lang.Double getDouble_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setDouble(int dname, java.lang.Double d, int index) throws DicomException
DicomException
public void setDouble_ge(int group, int element, java.lang.Double d, int index) throws DicomException
DicomException
public void setDouble_ge(int group, int element, java.lang.String creator, java.lang.Double d, int index) throws DicomException
DicomException
public void addDouble(int dname, java.lang.Double d) throws DicomException
DicomException
public void addDouble_ge(int group, int element, java.lang.Double d) throws DicomException
DicomException
public void addDouble_ge(int group, int element, java.lang.String creator, java.lang.Double d) throws DicomException
DicomException
public float[] getFloats(int dname, int index) throws DicomException
DicomException
public float[] getFloats_ge(int group, int element, int index) throws DicomException
DicomException
public float[] getFloats_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setFloats(int dname, float[] floats, int index) throws DicomException
DicomException
public void setFloats_ge(int group, int element, float[] floats, int index) throws DicomException
DicomException
public void setFloats_ge(int group, int element, java.lang.String creator, float[] floats, int index) throws DicomException
DicomException
public void addFloats(int dname, float[] floats) throws DicomException
DicomException
public void addFloats_ge(int group, int element, float[] floats) throws DicomException
DicomException
public void addFloats_ge(int group, int element, java.lang.String creator, float[] floats) throws DicomException
DicomException
public double[] getDoubles(int dname, int index) throws DicomException
DicomException
public double[] getDoubles_ge(int group, int element, int index) throws DicomException
DicomException
public double[] getDoubles_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setDoubles(int dname, double[] doubles, int index) throws DicomException
DicomException
public void setDoubles_ge(int group, int element, double[] doubles, int index) throws DicomException
DicomException
public void setDoubles_ge(int group, int element, java.lang.String creator, double[] doubles, int index) throws DicomException
DicomException
public void addDoubles(int dname, double[] doubles) throws DicomException
DicomException
public void addDoubles_ge(int group, int element, double[] doubles) throws DicomException
DicomException
public void addDoubles_ge(int group, int element, java.lang.String creator, double[] doubles) throws DicomException
DicomException
public ATValue getATValue(int dname, int index) throws DicomException
DicomException
public ATValue getATValue_ge(int group, int element, int index) throws DicomException
DicomException
public void setATValue(int dname, ATValue atValue, int index) throws DicomException
DicomException
public void setATValue_ge(int group, int element, ATValue atValue, int index) throws DicomException
DicomException
public void addATValue(int dname, ATValue atValue) throws DicomException
DicomException
public void addATValue_ge(int group, int element, ATValue atValue) throws DicomException
DicomException
public DicomObject getSequenceItem(int dname, int index) throws DicomException
DicomException
public DicomObject getSequenceItem_ge(int group, int element, int index) throws DicomException
DicomException
public DicomObject getSequenceItem_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setSequenceItem(int dname, DicomObject item, int index) throws DicomException
DicomException
public void setSequenceItem_ge(int group, int element, DicomObject item, int index) throws DicomException
DicomException
public void setSequenceItem_ge(int group, int element, java.lang.String creator, DicomObject item, int index) throws DicomException
DicomException
public void addSequenceItem(int dname, DicomObject item) throws DicomException
DicomException
public void addSequenceItem_ge(int group, int element, DicomObject dicomObject) throws DicomException
DicomException
public void addSequenceItem_ge(int group, int element, java.lang.String creator, DicomObject dicomObject) throws DicomException
DicomException
public Person getPersonName(int dname, int index) throws DicomException
DicomException
public Person getPersonName_ge(int group, int element, int index) throws DicomException
DicomException
public Person getPersonName_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setPersonName(int dname, Person person, int index) throws DicomException
DicomException
public void setPersonName(int dname, Person person, int index, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
setPersonName_ge(int, int, Person, int, DicomCharset, DicomCharset, DicomCharset)
for an explanation of the use of the different charsetsDicomException
- DicomExceptionpublic void setPersonName_ge(int group, int element, Person person, int index) throws DicomException
DicomException
public void setPersonName_ge(int group, int element, java.lang.String creator, Person person, int index) throws DicomException
DicomException
public void setPersonName_ge(int group, int element, Person person, int index, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
group
- the group part of the tagelement
- the element part of the tagperson
- person Objectindex
- the index of the value in the data elementsingleByteCharset
- single byte character setideographicCharset
- ideographic character setphoneticCharset
- phonetic character setDicomException
- DicomExceptionpublic void setPersonName_ge(int group, int element, java.lang.String creator, Person person, int index, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
DicomException
public void addPersonName(int dname, Person person) throws DicomException
DicomException
public void addPersonName(int dname, Person person, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
setPersonName_ge(int, int, Person, int, DicomCharset, DicomCharset, DicomCharset)
for an explanation of the use of the different charsetsdname
- the DDict constant or private constantperson
- person ObjectsingleByteCharset
- single byte character setideographicCharset
- ideographic character setphoneticCharset
- phonetic character setDicomException
- DicomExceptionpublic void addPersonName_ge(int group, int element, Person person) throws DicomException
DicomException
public void addPersonName_ge(int group, int element, java.lang.String creator, Person person) throws DicomException
DicomException
public void addPersonName_ge(int group, int element, Person person, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
setPersonName_ge(int, int, Person, int, DicomCharset, DicomCharset, DicomCharset)
for an explanation of the use of the different charsetsgroup
- the group part of the tagelement
- the element part of the tagperson
- person ObjectsingleByteCharset
- single byte character setideographicCharset
- ideographic character setphoneticCharset
- phonetic character setDicomException
- DicomExceptionpublic void addPersonName_ge(int group, int element, java.lang.String creator, Person person, DicomCharset singleByteCharset, DicomCharset ideographicCharset, DicomCharset phoneticCharset) throws DicomException
DicomException
public byte[] getBytes(int dname, int index) throws DicomException
DicomException
public byte[] getBytes_ge(int group, int element, int index) throws DicomException
DicomException
public byte[] getBytes_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setBytes(int dname, byte[] bytes, int index) throws DicomException
DicomException
public void setBytes_ge(int group, int element, byte[] bytes, int index) throws DicomException
DicomException
public void setBytes_ge(int group, int element, java.lang.String creator, byte[] bytes, int index) throws DicomException
DicomException
public void addBytes(int dname, byte[] bytes) throws DicomException
DicomException
public void addBytes_ge(int group, int element, byte[] bytes) throws DicomException
DicomException
public void addBytes_ge(int group, int element, java.lang.String creator, byte[] bytes) throws DicomException
DicomException
public ByteArray getByteArray(int dname, int index) throws DicomException
DicomException
public ByteArray getByteArray_ge(int group, int element, int index) throws DicomException
DicomException
public ByteArray getByteArray_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void setByteArray(int dname, ByteArray byteArray, int index) throws DicomException
DicomException
public void setByteArray_ge(int group, int element, ByteArray byteArray, int index) throws DicomException
DicomException
public void setByteArray_ge(int group, int element, java.lang.String creator, ByteArray byteArray, int index) throws DicomException
DicomException
public void addByteArray(int dname, ByteArray byteArray) throws DicomException
DicomException
public void addByteArray_ge(int group, int element, ByteArray byteArray) throws DicomException
DicomException
public void addByteArray_ge(int group, int element, java.lang.String creator, ByteArray byteArray) throws DicomException
DicomException
public BulkDataReference getBulkDataReference(int dname, int index) throws DicomException
dname
- index
- DicomException
public BulkDataReference getBulkDataReference_ge(int group, int element, int index) throws DicomException
group
- element
- index
- DicomException
public BulkDataReference getBulkDataReference_ge(int group, int element, java.lang.String creator, int index) throws DicomException
group
- element
- creator
- index
- DicomException
public void setBulkDataReference(int dname, BulkDataReference bulkDataReference, int index) throws DicomException
dname
- -bulkDataReference
- -index
- -DicomException
- -public void setBulkDataReference_ge(int group, int element, BulkDataReference bulkDataReference, int index) throws DicomException
group
- element
- bulkDataReference
- index
- DicomException
public void setBulkDataReference_ge(int group, int element, java.lang.String creator, BulkDataReference bulkDataReference, int index) throws DicomException
group
- element
- creator
- bulkDataReference
- index
- DicomException
public void addBulkDataReference(int dname, BulkDataReference bulkDataReference) throws DicomException
dname
- bulkDataReference
- DicomException
public void addBulkDataReference_ge(int group, int element, BulkDataReference bulkDataReference) throws DicomException
group
- element
- bulkDataReference
- DicomException
public void addBulkDataReference_ge(int group, int element, java.lang.String creator, BulkDataReference bulkDataReference) throws DicomException
group
- element
- creator
- bulkDataReference
- DicomException
public DataElement getDataElement(int dname)
dname
- a DDict constantpublic DataElement getDataElement(int group, int element)
group
- the group part of the tagelement
- the element part of the tagpublic DataElement getDataElement(int group, int element, java.lang.String creator) throws DicomException
DicomException
public java.lang.Object get(int dname)
public java.lang.Object get_ge(int g, int e)
get(dname)
using a (group, element) - pair instead of 'dname'.public java.lang.Object get_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public java.lang.Object get(int dname, int i)
public java.lang.Object get_ge(int g, int e, int i)
get(dname, i)
using a (group, element) - pair instead of 'dname'public java.lang.Object get_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
@Deprecated public java.lang.String getS(int dname) throws DicomException
getString(int, int, boolean)
get(dname)
and, if possible, returns it as a String. If the data element does'nt exist or is empty,
the method returns null.DicomException
@Deprecated public java.lang.String getS_ge(int g, int e) throws DicomException
getString_ge(int, int, int, boolean)
getS(dname)
using a (group, element) - pair instead of 'dname'DicomException
@Deprecated public java.lang.String getS(int dname, int i) throws DicomException
getString(int, int, boolean)
get(dname, i)
and, if possible, returns it as a String.
If the data element doesn't exist, the method returns 'null'.DicomException
@Deprecated public java.lang.String getS_ge(int g, int e, int i) throws DicomException
getString_ge(int, int, int, boolean)
get_ge(g, e, i)
and, if possible, returns it as a String.
If the data element doesn't exist, the method returns 'null'.DicomException
@Deprecated public int getI(int dname) throws DicomException
getInteger(int, int)
get(dname)
and, if possible, returns it as an int.
If the Data Element is not present, this method returns Integer.MAX_VALUE.
An exception is thrown if the requested value cannot be converted to int.DicomException
@Deprecated public int getI_ge(int g, int e) throws DicomException
getInteger_ge(int, int, int)
getI(dname)
using a (group, element) - pair instead of 'dname'DicomException
@Deprecated public int getI(int dname, int i) throws DicomException
getInteger(int, int)
get(dname, i)
and, if possible, returns it as an int.
If the Data Element is not present, this method returns Integer.MAX_VALUE.
An exception is thrown if the requested value cannot be converted to int.DicomException
@Deprecated public int getI_ge(int g, int e, int i) throws DicomException
getInteger_ge(int, int, int)
getI(dname, i)
using a (group, element) - pair instead of 'dname'DicomException
public void remove(int dname)
public void remove_ge(int group, int element)
public void remove_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public java.util.List deleteItem(int dname)
public java.util.List deleteItem_ge(int g, int e)
deleteItem(dname)
using a (group, element) - pair instead of 'dname'public java.util.List deleteItem_ge(int group, int element, java.lang.String creator) throws DicomException
DicomException
public java.lang.Object deleteItem(int dname, int i)
public java.lang.Object deleteItem_ge(int g, int e, int i)
deleteItem(dname, i)
using a (group, element) - pair instead of 'dname'public java.lang.Object deleteItem_ge(int group, int element, java.lang.String creator, int index) throws DicomException
DicomException
public void read(java.io.InputStream in) throws java.io.IOException, DicomException
read(in, readpixels)
,
with the 'readpixels' boolean set to true.
DicomReader
class.java.io.IOException
DicomException
public void read(java.io.InputStream in, boolean readpixels) throws java.io.IOException, DicomException
DicomReader
class.in
- the InputStream from which must the DICOM stream must be read.readpixels
- A boolean indicating whether to read pixel datajava.io.IOException
DicomException
public void read(java.io.InputStream in, int transfersyntax, boolean readpixels) throws java.io.IOException, DicomException
DicomReader
class.in
- the InputStream to a DICOM datasettransfersyntax
- the transfer syntax with which this Dataset is encodedreadpixels
- A boolean indicating whether to read pixel datajava.io.IOException
DicomException
TransferSyntax
public void write(java.io.OutputStream out, boolean dicomfile) throws DicomException, java.io.IOException
DicomWriter.write(DicomObject, OutputStream, boolean)
method.dicomfile
- indicates whether the data set should be written as a DICOM
file (see Part 3.10)(true) or as a DICOM stream (false)out
- the outputstreamDicomException
- DicomExceptionjava.io.IOException
- IOExceptionpublic void write(java.io.OutputStream out, boolean dicomfile, int transfersyntax, boolean seq_undef) throws DicomException, java.io.IOException
DicomWriter
class.out
- the outputstream written todicomfile
- true for writing a DICOM part 10 file, false for a raw datasettransfersyntax
- the transfersyntax to use for writingseq_undef
- true - all sequences and items are encoded using undefined length,
false - all sequences and items are encoded using defined lengthDicomException
java.io.IOException
TransferSyntax
public void write(java.io.OutputStream out, boolean dicomfile, int transfersyntax, boolean seq_undef, boolean grouplens) throws DicomException, java.io.IOException
write(out, f, ts, seq_undef)
and, in addition, lets you specify whether to write grouplengths.
DicomWriter
class.out
- the outputstream written todicomfile
- true for writing a DICOM part 10 file, false for a raw datasettransfersyntax
- the transfersyntax to use for writingseq_undef
- true - all sequences and items are encoded using undefined length,
false - all sequences and items are encoded using defined lengthgrouplens
- set to true to include group length tagsDicomException
java.io.IOException
public DicomObject getFileMetaInformation()
public DicomObject setFileMetaInformation(DicomObject fmi)
public void dumpVRs(java.io.OutputStream os) throws java.io.IOException
The width of the description column is 35 characters. The width of the value column is 60 characters. Sequences are indented with 6 whitespace characters.
os
- the Outputstreamjava.io.IOException
DumpUtils
public void dumpVRs(java.io.OutputStream os, boolean metainfo) throws java.io.IOException
DumpUtils
.
The width of the description column is 35 characters. The width of the value column is 60 characters. Sequences are indented with 6 whitespace characters.
os
- the Outputstreammetainfo
- specifies whether or to print out the File Meta Information (if present).java.io.IOException
DumpUtils
public void dumpVRs(java.io.OutputStream os, int maxdescription, int maxvalue, int indentsize, boolean metainfo, boolean grouplengths) throws java.io.IOException
DumpUtils
.os
- the Outputstreammaxdescription
- the maximum number of characters for the tag description columnmaxvalue
- the maximum number of characters for the the tag value columnindentsize
- the number of whitespace characters to indent when a sequence is encounteredmetainfo
- specifies whether or to print out the File Meta Information (if present).grouplengths
- specifies whether or to print out the group length data elements (if present).java.io.IOException
- -