|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pixelmed.dicom.Attribute
com.pixelmed.dicom.SequenceAttribute
public class SequenceAttribute
A concrete class specializing Attribute for
Sequence (SQ) attributes.
Though an instance of this class may be created
using its constructors, there is also a factory class, AttributeFactory.
SequenceItem,
Attribute,
AttributeFactory,
AttributeList| Field Summary |
|---|
| Fields inherited from class com.pixelmed.dicom.Attribute |
|---|
valueLength, valueMultiplicity |
| Constructor Summary | |
|---|---|
SequenceAttribute(AttributeTag t)
Construct an (empty) attribute. |
|
| Method Summary | |
|---|---|
void |
addItem(AttributeList item)
Add an item to the sequence (after any existing items). |
void |
addItem(AttributeList item,
long byteOffset)
Add an item to the sequence (after any existing items), keeping tracking of input byte offsets. |
void |
addItem(SequenceItem item)
Add an item to the sequence (after any existing items). |
static AttributeList |
getAttributeListFromSelectedItemWithinSequence(SequenceAttribute sequenceAttribute,
int index)
Extract the AttributeList of the particular item in the sequence. |
static AttributeList |
getAttributeListFromWithinSequenceWithSingleItem(AttributeList list,
AttributeTag sequenceTag)
Extract the AttributeList of the first item from a specified sequence from within a list of attributes. |
static AttributeList |
getAttributeListFromWithinSequenceWithSingleItem(SequenceAttribute sequenceAttribute)
Extract the AttributeList of the first item from a sequence. |
String |
getDelimitedStringValuesOrDefault(String dflt,
NumberFormat format)
Get all the string values for all the items. |
SequenceItem |
getItem(int index)
Get particular item in the sequence. |
static String |
getMeaningOfCodedSequenceAttributeOrDefault(AttributeList list,
AttributeTag tag,
String dflt)
Extract the code meaning attribute value from within the first item of the specified code sequence from within a list of attributes. |
static Attribute |
getNamedAttributeFromWithinSelectedItemWithinSequence(AttributeList list,
AttributeTag sequenceTag,
int index,
AttributeTag namedTag)
Extract the specified attribute from within the particular item of the specified sequence from within a list of attributes. |
static Attribute |
getNamedAttributeFromWithinSelectedItemWithinSequence(SequenceAttribute sequenceAttribute,
int index,
AttributeTag namedTag)
Extract the specified attribute from within the particular item in the sequence. |
static Attribute |
getNamedAttributeFromWithinSequenceWithSingleItem(AttributeList list,
AttributeTag sequenceTag,
AttributeTag namedTag)
Extract the specified attribute from within the first item of the specified sequence from within a list of attributes. |
static Attribute |
getNamedAttributeFromWithinSequenceWithSingleItem(SequenceAttribute sequenceAttribute,
AttributeTag namedTag)
Extract the specified attribute from the first item of the specified sequence. |
int |
getNumberOfItems()
Get the number of items in the sequence. |
byte[] |
getVR()
Get the value representation of this attribute (SQ). |
Iterator |
iterator()
Get an Iterator of the items in the sequence. |
void |
removeValues()
Remove any existing values, making the attribute empty (zero length). |
String |
toString(DicomDictionary dictionary)
Dump the contents of the attribute as a human-readable string. |
void |
write(DicomOutputStream o)
Write the entire attribute (including values) to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SequenceAttribute(AttributeTag t)
Construct an (empty) attribute.
t - the tag of the attribute| Method Detail |
|---|
public void write(DicomOutputStream o)
throws DicomException,
IOException
AttributeWrite the entire attribute (including values) to the output stream.
write in class Attributeo -
IOException
DicomExceptionpublic String toString(DicomDictionary dictionary)
AttributeDump 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>
toString in class Attributedictionary - the dictionary to use to look up the name
String valuepublic void removeValues()
AttributeRemove any existing values, making the attribute empty (zero length).
removeValues in class AttributeDicomExceptionpublic void addItem(SequenceItem item)
item - public void addItem(AttributeList item)
item - the list of attributes that comprise the item
public void addItem(AttributeList item,
long byteOffset)
item - the list of attributes that comprise the itembyteOffset - the byte offset in the input stream of the start of the itempublic Iterator iterator()
Iterator of the items in the sequence.
Iterator of items, each encoded as an SequenceItempublic int getNumberOfItems()
public SequenceItem getItem(int index)
index - which item to return, numbered from zero
SequenceItem, null if no items or no such itempublic byte[] getVR()
Get the value representation of this attribute (SQ).
getVR in class AttributeValueRepresentationpublic static AttributeList getAttributeListFromWithinSequenceWithSingleItem(SequenceAttribute sequenceAttribute)
Extract the AttributeList of the first item from a sequence.
sequenceAttribute - the sequence attribute that has one item (may be null in which case returns null)
public static AttributeList getAttributeListFromSelectedItemWithinSequence(SequenceAttribute sequenceAttribute,
int index)
Extract the AttributeList of the particular item in the sequence.
sequenceAttribute - the sequence attribute that has one item (may be null in which case returns null)index - which item to return, numbered from zero
public static Attribute getNamedAttributeFromWithinSelectedItemWithinSequence(SequenceAttribute sequenceAttribute,
int index,
AttributeTag namedTag)
Extract the specified attribute from within the particular item in the sequence.
sequenceAttribute - the sequence attribute that has one item (may be null in which case returns null)index - which item to return, numbered from zeronamedTag - the tag of the attribute within the item of the sequence
public static Attribute getNamedAttributeFromWithinSelectedItemWithinSequence(AttributeList list,
AttributeTag sequenceTag,
int index,
AttributeTag namedTag)
Extract the specified attribute from within the particular item of the specified sequence from within a list of attributes.
list - the list that contains the sequence (may not be null)sequenceTag - the tag of the sequence attribute that has one itemindex - which item to return, numbered from zeronamedTag - the tag of the attribute within the item of the sequence
public static AttributeList getAttributeListFromWithinSequenceWithSingleItem(AttributeList list,
AttributeTag sequenceTag)
Extract the AttributeList of the first item from a specified sequence from within a list of attributes.
list - the list that contains the sequence (may not be null)sequenceTag - the tag of the sequence attribute that has one item
public static Attribute getNamedAttributeFromWithinSequenceWithSingleItem(SequenceAttribute sequenceAttribute,
AttributeTag namedTag)
Extract the specified attribute from the first item of the specified sequence.
sequenceAttribute - the sequence attribute that has one item (may be null in which case returns null)namedTag - the tag of the attribute within the item of the sequence
public static Attribute getNamedAttributeFromWithinSequenceWithSingleItem(AttributeList list,
AttributeTag sequenceTag,
AttributeTag namedTag)
Extract the specified attribute from within the first item of the specified sequence from within a list of attributes.
list - the list that contains the sequence (may not be null)sequenceTag - the tag of the sequence attribute that has one itemnamedTag - the tag of the attribute within the item of the sequence
public static String getMeaningOfCodedSequenceAttributeOrDefault(AttributeList list,
AttributeTag tag,
String dflt)
Extract the code meaning attribute value from within the first item of the specified code sequence from within a list of attributes.
list - the list that contains the code sequence (may not be null)tag - the tag of the code sequence attribute that has one itemdflt - what to return if there is no such sequence attribute or it is empty or has no code meaning attribute
public String getDelimitedStringValuesOrDefault(String dflt,
NumberFormat format)
Get all the string values for all the items.
If there is no string value for an individual value or an exception trying to fetch it, the supplied default is returned for each Attribute.
A canonicalized (unpadded) form is returned for each Attribute value, not the original string.
getDelimitedStringValuesOrDefault in class Attributedflt - what to return if there are no (valid) string valuesformat - the format to use for each numerical or decimal value (null if none)
String
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||