Package gov.nih.mipav.model.file
Class FileDicomTagInfo
- java.lang.Object
-
- gov.nih.mipav.model.structures.ModelSerialCloneable
-
- gov.nih.mipav.model.file.FileDicomTagInfo
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class FileDicomTagInfo extends ModelSerialCloneable
Information about a DICOM tag, stored in the DicomDictionary table once for each DICOM tag. This information is read in from the dicom dictionary on disk.- See Also:
DicomDictionary,FileDicomKey,FileDicomTag, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileDicomTagInfo.NumTypestatic classFileDicomTagInfo.StringTypestatic classFileDicomTagInfo.VR
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_TAG_VERSIONThe default DICOM version string to assign to tags.protected FileDicomKeykeyThe DICOM tag 'group,element' key indicating what tag this information pertains to.protected java.lang.StringkeywordThe tag keyword (no spaces).protected java.lang.StringnameThe real world DICOM tag name.private static longserialVersionUIDUse serialVersionUID for interoperability.protected intvalueMultiplicityAllowed value multiplicity (vm) for this tag.protected FileDicomTagInfo.VRvalueRepresentationDICOM value representation (vr) for this tag.protected java.lang.StringversionVersion of the tag.
-
Constructor Summary
Constructors Constructor Description FileDicomTagInfo(int group, int element, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)Constructor that takes all the information needed about the tag except for the value and DICOM revision number.FileDicomTagInfo(int group, int element, java.lang.String version, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)Constructor that takes all the information needed about the tag except for the value.FileDicomTagInfo(FileDicomKey dicomKey, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)Constructor that takes all the information needed about the tag except for the value and DICOM revision number (which we assume to be 3).FileDicomTagInfo(FileDicomKey dicomKey, java.lang.String version, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)Constructor that takes all the information needed about the tag except for the value and DICOM revision number.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Tests whether a tag info object contains the same information as this tag info object.voidfinalize()FileDicomKeygetKey()Return the dicom tag key ('group,element') that this information object describes.java.lang.StringgetKeyword()Returns the keyword for this tag, a word with no spaces.java.lang.StringgetName()Accessor that returns the real world name of this tag.FileDicomTagInfo.VRgetType()Accessor that returns the type of tag, depending on the value representation.static DicomTypegetType(FileDicomTagInfo.VR vr)Accessor that returns the type of tag, depending on a value representation value.intgetValueMultiplicity()Accessor that returns the value multiplicity of the tag.FileDicomTagInfo.VRgetValueRepresentation()Accessor that returns the value representation of the tag.java.lang.StringgetVersion()Accessor that returns the DICOM version of the tag.intgetVersionNumber()Accessor to the DICOM version number for this tag.inthashCode()Returns the unique identifier's hash code.voidsetKey(FileDicomKey key)Sets the dicom tag's key.voidsetValueRepresentation(FileDicomTagInfo.VR vr)Sets the value representation; used only for explicit vr.java.lang.StringtoString()Return information about the tag, in string form.-
Methods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable
clone, nativeClone
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
DEFAULT_TAG_VERSION
public static final java.lang.String DEFAULT_TAG_VERSION
The default DICOM version string to assign to tags.- See Also:
- Constant Field Values
-
key
protected FileDicomKey key
The DICOM tag 'group,element' key indicating what tag this information pertains to.
-
keyword
protected java.lang.String keyword
The tag keyword (no spaces).
-
name
protected java.lang.String name
The real world DICOM tag name.
-
valueMultiplicity
protected int valueMultiplicity
Allowed value multiplicity (vm) for this tag.
-
valueRepresentation
protected FileDicomTagInfo.VR valueRepresentation
DICOM value representation (vr) for this tag.
-
version
protected java.lang.String version
Version of the tag. Usually '2' or '3', although some tags get strings like 'GEM' or 'TSH' when the tag is from a private manufacturer.
-
-
Constructor Detail
-
FileDicomTagInfo
public FileDicomTagInfo(FileDicomKey dicomKey, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)
Constructor that takes all the information needed about the tag except for the value and DICOM revision number (which we assume to be 3).- Parameters:
dicomKey- The group and element which uniquely define this tagvr- the value representationvm- the value multiplicitykeyword- the keyword (no spaces)name- the real world name- See Also:
DEFAULT_TAG_VERSION
-
FileDicomTagInfo
public FileDicomTagInfo(FileDicomKey dicomKey, java.lang.String version, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)
Constructor that takes all the information needed about the tag except for the value and DICOM revision number.- Parameters:
dicomKey- The group and element which uniquely define this tagversion- the DICOM revision (version) number (eg. '3' or 'GEM')vr- the value representationvm- the value multiplicitykeyword- the keyword (no spaces)name- the real world name
-
FileDicomTagInfo
public FileDicomTagInfo(int group, int element, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)Constructor that takes all the information needed about the tag except for the value and DICOM revision number.- Parameters:
group- the integer group word (in hexadecimal)element- the integer element word (in hexadecimal)vr- the value representationvm- the value multiplicitykeyword- the keyword (no spaces)name- the real world name- See Also:
DEFAULT_TAG_VERSION
-
FileDicomTagInfo
public FileDicomTagInfo(int group, int element, java.lang.String version, FileDicomTagInfo.VR vr, int vm, java.lang.String keyword, java.lang.String name)Constructor that takes all the information needed about the tag except for the value.- Parameters:
group- the integer group word (in hexadecimal)element- the integer element word (in hexadecimal)version- the DICOM revision (version) number (eg. '3' or 'GEM')vr- the value representationvm- the value multiplicitykeyword- the keyword (no spaces)name- the real world name
-
-
Method Detail
-
getType
public static final DicomType getType(FileDicomTagInfo.VR vr)
Accessor that returns the type of tag, depending on a value representation value. This allows the reader to read in the tags properly.- Parameters:
vr- value representation- Returns:
- the type (int, double, short, String, or unknown)
-
equals
public boolean equals(java.lang.Object obj)
Tests whether a tag info object contains the same information as this tag info object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- A object (hopefully a non-null FileDicomTagInfo, but not required).- Returns:
- Whether all of the tag info (key, keyword, name, vm, vr, version) in the other tag is the same as this one. False if the tag is null or not a FileDicomTagInfo.
-
getKey
public FileDicomKey getKey()
Return the dicom tag key ('group,element') that this information object describes.- Returns:
- The dicom tag key described by this information object.
-
getKeyword
public final java.lang.String getKeyword()
Returns the keyword for this tag, a word with no spaces.- Returns:
- the keyword
-
getName
public final java.lang.String getName()
Accessor that returns the real world name of this tag. For private tags, the name is the value.- Returns:
- the name of this tag
-
getType
public final FileDicomTagInfo.VR getType()
Accessor that returns the type of tag, depending on the value representation. This allows the reader to read in the tags properly. This method will be so much simpler when (if) the tags are seperated out as individual classes.- Returns:
- the type (int, double, short, String, or unknown)
-
getValueMultiplicity
public final int getValueMultiplicity()
Accessor that returns the value multiplicity of the tag. The value multiplicity is how many instances of this value representation (VR) there can be in one tag.- Returns:
- the value multiplicity
-
getValueRepresentation
public final FileDicomTagInfo.VR getValueRepresentation()
Accessor that returns the value representation of the tag. The value representation allows the reader the read and interpret the tag properly. Because private tags are not unique, the VR is null and they may be read and/or displayed improperly.- Returns:
- the value representation
-
getVersion
public final java.lang.String getVersion()
Accessor that returns the DICOM version of the tag. Although not needed to understand a value, it is important to the dictionary.- Returns:
- the String that is the DICOM version.
-
getVersionNumber
public final int getVersionNumber() throws java.lang.NumberFormatExceptionAccessor to the DICOM version number for this tag. Returns it as a number so numerical comparisons (greater-than, equality, etc) can be made. Also, throws a NumberFormatException for private tags.- Returns:
- the version number.
- Throws:
java.lang.NumberFormatException- when a tag is a Private Tag.
-
hashCode
public final int hashCode()
Returns the unique identifier's hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code.
-
setKey
public final void setKey(FileDicomKey key)
Sets the dicom tag's key. This is only used to specify the values of wild card tags stored in the DicomDictionary- Parameters:
vr- the value representation
-
setValueRepresentation
public final void setValueRepresentation(FileDicomTagInfo.VR vr)
Sets the value representation; used only for explicit vr.- Parameters:
vr- the value representation
-
toString
public final java.lang.String toString()
Return information about the tag, in string form.- Overrides:
toStringin classjava.lang.Object- Returns:
- A tag information string.
-
finalize
public void finalize()
- Overrides:
finalizein classjava.lang.Object
-
-