Package gov.nih.mipav.model.file
Class FileDicomSQ
java.lang.Object
gov.nih.mipav.model.structures.ModelSerialCloneable
gov.nih.mipav.model.file.FileDicomSQ
- All Implemented Interfaces:
Serializable,Cloneable
This is a class for reading in a DICOM sequence tag. For more information about the DICOM sequence tag see the DICOM
standard, Part 5, Section 7.5.
The sequence tag is encoded as follows:
- A group and element tag indicating that this is a sequence, followed by a length. The group and element tag are stored in the regular FileInfoDicom object. The length is stored there and also here. Often a sequence will have an undefined length, which is defined in FileDicom.
- A series of item tags. Each item tag is read in, the length of the entire item is stored, and the item is read in. The item is simply a series of DICOM tags with data in them. That information is stored in the class DicomItem.
- A tag indicating the end of the sequence.
Given this encoding, the DicomSQ structure is set up as a Vector. The length variable is the length of the sequence as given in the header and NOT the length of the Vector. The Vector is a series of DicomItems. Each DicomItem is a set of tags.
- Author:
- Neva Cherniavsky
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Vector<FileDicomSQItem> Sequences are composed of items (DICOM items) and store in a vector object.private static final longUse serialVersionUID for interoperability.private booleanWhether the sequence should be written using an unknown length -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddItem(FileDicomSQItem item) Add an item to the sequence vector.booleanWhether the sequence should be written using an unknown length, can be set as a preference by user.voidfinalize()Prepares this class for cleanup.intReturns the size of the data held in this sequence in number of bytes, including the number of bytes required to delimit each item.final FileDicomSQItemgetItem(int index) Gets the specified item from the sequence vector.Gets a series of Strings that are the human readable version of the data.final intGets the length of the sequence vector.final intGets the length as read in by the header (possibly undefined).voidsetWriteAsUnknownLength(boolean writeAsUnknownLength) Whether the sequence should be written using an unknown length, this includes adding a sequence delimitation item to the sequence.toString()Returns the word 'Sequence'.Methods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable
clone, nativeClone
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
sequence
Sequences are composed of items (DICOM items) and store in a vector object. -
writeAsUnknownLength
private boolean writeAsUnknownLengthWhether the sequence should be written using an unknown length
-
-
Constructor Details
-
FileDicomSQ
public FileDicomSQ()Creates a new DicomSQ object with initial length.
-
-
Method Details
-
addItem
Add an item to the sequence vector.- Parameters:
item- item to add
-
finalize
public void finalize()Prepares this class for cleanup. -
getDataLength
public int getDataLength()Returns the size of the data held in this sequence in number of bytes, including the number of bytes required to delimit each item. Always returns the exact number of bytes used for the current state of the sequence.- Returns:
- the size of the data held in this sequence in number of bytes.
-
getItem
Gets the specified item from the sequence vector.- Parameters:
index- index in the vector- Returns:
- The specified item from the sequence.
-
getWritableLength
public final int getWritableLength()Gets the length as read in by the header (possibly undefined).- Returns:
- The length of the sequence as read in by the header
-
getSequenceDisplay
Gets a series of Strings that are the human readable version of the data.- Returns:
- A list that contains the human readable form of the sequence data
-
getSequenceLength
public final int getSequenceLength()Gets the length of the sequence vector.- Returns:
- the sequence length
-
toString
Returns the word 'Sequence'. -
getSequence
-
doWriteAsUnknownLength
public boolean doWriteAsUnknownLength()Whether the sequence should be written using an unknown length, can be set as a preference by user. -
setWriteAsUnknownLength
public void setWriteAsUnknownLength(boolean writeAsUnknownLength) Whether the sequence should be written using an unknown length, this includes adding a sequence delimitation item to the sequence.
-