Package loci.formats.dicom
Class DicomTag
java.lang.Object
loci.formats.dicom.DicomTag
- All Implemented Interfaces:
Comparable<DicomTag>
Represents a complete DICOM tag, including the dictionary attribute,
actual VR, value, and any "child" tags (in the case of a sequence).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanintprivate booleanprivate longint -
Constructor Summary
ConstructorsConstructorDescriptionDicomTag(loci.common.RandomAccessInputStream in, boolean bigEndian, long location, boolean oddLocations) Read a complete tag and value from the given input stream.DicomTag(loci.common.RandomAccessInputStream in, boolean bigEndian, long location, boolean oddLocations, boolean readValue) Read a complete tag and optionally a value from the given input stream.DicomTag(DicomAttribute attribute) DicomTag(DicomAttribute attribute, DicomVR vr) -
Method Summary
Modifier and TypeMethodDescriptionintlongGet the file pointer at which the value ends (useful for sequences and byte streams).private intgetLength(loci.common.RandomAccessInputStream in) Get the length of the next value in the given input stream.private intgetNextTag(loci.common.RandomAccessInputStream in) Get the next 4 byte DICOM tag from the given input stream.Get a number representation of the current value, or null if not a number.Get a string representation of the current value.longGet the file pointer at which the value starts (useful for sequences and byte streams).booleanSee https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.8.htmllookupChild(DicomAttribute attr) Find the first child tag with the given attribute, or null if one does not exist.toString()booleanCheck this tag against a list of existing tags.voidCompare the value type to the VR.
-
Field Details
-
parent
-
children
-
tag
public int tag -
attribute
-
vr
-
key
-
value
-
elementLength
public int elementLength -
start
private long start -
bigEndianTransferSyntax
private boolean bigEndianTransferSyntax -
oddLocations
private boolean oddLocations -
strategy
-
-
Constructor Details
-
DicomTag
-
DicomTag
-
DicomTag
-
DicomTag
public DicomTag(loci.common.RandomAccessInputStream in, boolean bigEndian, long location, boolean oddLocations) throws FormatException, IOException Read a complete tag and value from the given input stream.- Throws:
FormatExceptionIOException
-
DicomTag
public DicomTag(loci.common.RandomAccessInputStream in, boolean bigEndian, long location, boolean oddLocations, boolean readValue) throws FormatException, IOException Read a complete tag and optionally a value from the given input stream.- Throws:
FormatExceptionIOException
-
-
Method Details
-
getNextTag
Get the next 4 byte DICOM tag from the given input stream.- Throws:
FormatExceptionIOException
-
getLength
Get the length of the next value in the given input stream.- Throws:
IOException
-
getStringValue
Get a string representation of the current value. -
getNumberValue
Get a number representation of the current value, or null if not a number. -
getValueStartPointer
public long getValueStartPointer()Get the file pointer at which the value starts (useful for sequences and byte streams). -
getEndPointer
public long getEndPointer()Get the file pointer at which the value ends (useful for sequences and byte streams). -
lookupChild
Find the first child tag with the given attribute, or null if one does not exist. -
validate
Check this tag against a list of existing tags. If this tag is a duplicate of an existing tag or otherwise deemed invalid, return false. Otherwise return true. -
validateValue
public void validateValue()Compare the value type to the VR. If the two types do not match, attempt to conver the value into the VR's type. Usually this means parsing numerical values from a String. -
isPrivateContentCreator
public boolean isPrivateContentCreator()See https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.8.html- Returns:
- true if this is a private content creator tag
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<DicomTag>
-