|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dicom4j.data.DataSet
public class DataSet
DICOM DataSet (a list ofDataElements )
a dataset is used to manage a list of elements, a dataset can be read or write on a file system using DicomFileReader or DicomFileWriter.
or send over a network.
this class offer specific getter of setter to get/set elements depending of their type. A cast error will be raised if you try to get an element of a wrong type.
| Constructor Summary | |
|---|---|
DataSet()
|
|
DataSet(DataSet aDataSet)
|
|
| Method Summary | |
|---|---|
ApplicationEntity |
addApplicationEntity(ApplicationEntity element,
String singleValue)
add a new ApplicationEntity element, and set the single sting value |
CodeString |
addCodeString(CodeString element,
String singleValue)
|
DataSet |
addDataSet(DataSet aDataSet)
add all data contains in the DataSet into this (NOT A COPY) |
DataElement |
addElement(DataElement aDataElement)
Add a new DataElement |
IntegerString |
addIntegerString(IntegerString element,
String singleValue)
add an IntegerString, and set the supplied value |
AbstractModule |
addModule(AbstractModule aModule)
Add a new module to the DataSet |
PersonName |
addPersonName(PersonName personNameElement)
add a new PersonName element |
PersonName |
addPersonName(PersonName element,
String aSingleValue)
add an PersonName, and set the supplied value |
ShortString |
addShortString(ShortString element,
String singleValue)
|
UniqueIdentifier |
addUniqueIdentifier(UniqueIdentifier element,
String singleValue)
add an UniqueIdentifier, and set the supplied value |
void |
clear()
call clear method for all element. |
int |
count()
Return the number of Elements
in the DataSet |
ApplicationEntity |
getApplicationEntity(DicomTag aDataElementTag)
|
ApplicationEntity |
getApplicationEntityOrNull(DicomTag aDataElementTag)
get an ApplicationEntity element |
DataElement |
getAttribute(int aIndex)
Deprecated. use iterator |
CodeString |
getCodeString(DicomTag tag)
|
DataSet |
getDataElementsOfSameGroup(int aGroup)
Return all Attribute of the
same group |
DateElement |
getDate(DicomTag tag)
|
static double[] |
getDoubleValues(DataSet aDataSet,
DicomTag tag)
Get the values of a named attribute in an attribute list, as an array of double. |
DataElement |
getElement(DicomTag aAttributeTag)
Return the DataElement associated whith aAttributeTag |
DataElement |
getElementOrNull(DicomTag aAttributeTag)
Retrun the DataElement associated whith aAttributeTa |
IntegerString |
getIntegerString(DicomTag tag)
Return a IntegerString element depending of the supplied DicomTag |
Iterator<DataElement> |
getIterator()
Return an Iterator for this DataSet |
LongString |
getLongString(DicomTag tag)
|
LongString |
getLongStringOrNull(DicomTag aDataElementTag)
|
LongText |
getLongText(DicomTag aDataElementTag)
|
LongText |
getLongTextOrNull(DicomTag aDataElementTag)
|
OtherByteString |
getOtherByteString(DicomTag aDataElementTag)
|
OtherByteString |
getOtherByteStringOrNull(DicomTag aDataElementTag)
|
PersonName |
getPersonName(DicomTag tag)
|
PersonName |
getPersonNameOrNull(DicomTag aDataElementTag)
|
SequenceOfItems |
getSequenceOfItems(DicomTag tag)
get a SequenceOfItems element |
SequenceOfItems |
getSequenceOfItemsOrNull(DicomTag aDataElementTag)
get a SequenceOfItems element or Null |
ShortString |
getShortString(DicomTag aTag)
|
Time |
getTime(DicomTag tag)
|
UniqueIdentifier |
getUniqueIdentifier(DicomTag aDataElementTag)
|
UniqueIdentifier |
getUniqueIdentifierOrNull(DicomTag aDataElementTag)
|
UnsignedLong |
getUnsignedLong(DicomTag tag)
|
UnsignedLong |
getUnsignedLongOrNull(DicomTag aDataElementTag)
|
UnsignedShort |
getUnsignedShort(DicomTag aDataElementTag)
|
boolean |
hasElement(DicomTag aAttributeTag)
|
void |
read(byte[] aBytes,
TransferSyntax aTransferSyntax)
Deprecated. use reader instead |
void |
read(InputStream aStream,
TransferSyntax aTransferSyntax)
Deprecated. use reader instead |
void |
removeAll()
Remove all elements |
DataElement |
removeElement(DataElement element)
remove the supplied element from the Dataset |
DataElement |
removeElement(DicomTag tag)
remove an element depending of his tag |
Object[] |
toArray()
get all elements as an array of objects |
byte[] |
toBytes(TransferSyntax aTransferSyntax)
Deprecated. |
String |
toString()
|
void |
write(OutputStream aStream,
TransferSyntax aTransferSyntax)
Deprecated. use reader instead |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DataSet()
public DataSet(DataSet aDataSet)
| Method Detail |
|---|
public static double[] getDoubleValues(DataSet aDataSet,
DicomTag tag)
Get the values of a named attribute in an attribute list, as an array of double.
If there is no such attribute, null is returned.
If there is an exception trying to fetch the values, null is
returned.
aDataSet - the list of attributes in which to look for the attributetag - the tag of the attribute to find
public DataSet addDataSet(DataSet aDataSet)
aDataSet -
public DataElement addElement(DataElement aDataElement)
aDataElement - the element to add
DataElement
public ApplicationEntity addApplicationEntity(ApplicationEntity element,
String singleValue)
ApplicationEntity element, and set the single sting value
element - the element to addaSingleValue - the single string value to set
public CodeString addCodeString(CodeString element,
String singleValue)
public PersonName addPersonName(PersonName personNameElement)
PersonName element
personNameElement - the element
public PersonName addPersonName(PersonName element,
String aSingleValue)
PersonName, and set the supplied value
element - the element to addsingleValue - the value to set
public ShortString addShortString(ShortString element,
String singleValue)
public UniqueIdentifier addUniqueIdentifier(UniqueIdentifier element,
String singleValue)
UniqueIdentifier, and set the supplied value
element - the element to addsingleValue - the value to set
public IntegerString addIntegerString(IntegerString element,
String singleValue)
IntegerString, and set the supplied value
element - the element to addsingleValue - the value to set
public AbstractModule addModule(AbstractModule aModule)
aModule - the module to add
public void clear()
public int count()
Elements
in the DataSet
Elements
public ApplicationEntity getApplicationEntity(DicomTag aDataElementTag)
throws NoSuchElementException,
WrongDataElementTypeException
aDataElementTag -
NoSuchElementException
WrongDataElementTypeExceptionpublic ApplicationEntity getApplicationEntityOrNull(DicomTag aDataElementTag)
aDataElementTag - the dicom tag
@Deprecated public DataElement getAttribute(int aIndex)
aIndex -
public CodeString getCodeString(DicomTag tag)
public DataSet getDataElementsOfSameGroup(int aGroup)
Attribute of the
same group
aGroup - the group
public DateElement getDate(DicomTag tag)
public DataElement getElement(DicomTag aAttributeTag)
aAttributeTag - the Tag
public DataElement getElementOrNull(DicomTag aAttributeTag)
aAttributeTag - the tag
public IntegerString getIntegerString(DicomTag tag)
throws NoSuchElementException,
WrongDataElementTypeException
IntegerString element depending of the supplied DicomTag
tag - the element's tag
NoSuchElementException - if the element isn't not present in the dataset
WrongDataElementTypeException - if the element's type is not IntegerStringpublic Iterator<DataElement> getIterator()
Iterator for this DataSet
public LongString getLongString(DicomTag tag)
public LongString getLongStringOrNull(DicomTag aDataElementTag)
public LongText getLongText(DicomTag aDataElementTag)
throws NoSuchElementException,
WrongDataElementTypeException
NoSuchElementException
WrongDataElementTypeExceptionpublic LongText getLongTextOrNull(DicomTag aDataElementTag)
public OtherByteString getOtherByteString(DicomTag aDataElementTag)
public OtherByteString getOtherByteStringOrNull(DicomTag aDataElementTag)
public PersonName getPersonName(DicomTag tag)
public PersonName getPersonNameOrNull(DicomTag aDataElementTag)
public SequenceOfItems getSequenceOfItems(DicomTag tag)
SequenceOfItems element
tag -
public SequenceOfItems getSequenceOfItemsOrNull(DicomTag aDataElementTag)
SequenceOfItems element or Null
aDataElementTag -
public ShortString getShortString(DicomTag aTag)
public Time getTime(DicomTag tag)
public UniqueIdentifier getUniqueIdentifier(DicomTag aDataElementTag)
throws NoSuchElementException,
WrongDataElementTypeException
NoSuchElementException
WrongDataElementTypeExceptionpublic UniqueIdentifier getUniqueIdentifierOrNull(DicomTag aDataElementTag)
public UnsignedLong getUnsignedLong(DicomTag tag)
public UnsignedLong getUnsignedLongOrNull(DicomTag aDataElementTag)
public UnsignedShort getUnsignedShort(DicomTag aDataElementTag)
public boolean hasElement(DicomTag aAttributeTag)
@Deprecated
public void read(byte[] aBytes,
TransferSyntax aTransferSyntax)
throws IOException,
DicomException,
Exception
aBytes - the bytes to readaTransferSyntax - the TransferSyntax to use
IOException
DicomException
Exception
@Deprecated
public void read(InputStream aStream,
TransferSyntax aTransferSyntax)
throws IOException,
DicomException,
Exception
aStream - the Stream to readaTransferSyntax - the TransferSyntax to use
IOException
DicomException
Exceptionpublic void removeAll()
public DataElement removeElement(DataElement element)
element - the element to remote
public DataElement removeElement(DicomTag tag)
tag - the tag
public Object[] toArray()
@Deprecated
public byte[] toBytes(TransferSyntax aTransferSyntax)
throws IOException,
DicomException
IOException
DicomExceptionpublic String toString()
toString in class Object
@Deprecated
public void write(OutputStream aStream,
TransferSyntax aTransferSyntax)
throws IOException,
DicomException
aStream - the Stream to writeaTransferSyntax - the TransferSyntax to use
IOException
DicomException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||