Package org.aoju.bus.image.galaxy.data
Class Attributes
java.lang.Object
org.aoju.bus.image.galaxy.data.Attributes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic enumstatic interface -
Constructor Summary
ConstructorsConstructorDescriptionAttributes(boolean bigEndian) Attributes(boolean bigEndian, int initialCapacity) Attributes(int initialCapacity) Attributes(Attributes other) Attributes(Attributes other, boolean bigEndian) Attributes(Attributes other, boolean bigEndian, int... selection) Attributes(Attributes other, boolean bigEndian, Attributes selection) Attributes(Attributes other, int... selection) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(Attributes.Visitor visitor, boolean visitNestedDatasets) InvokesAttributes.Visitor.visit(org.aoju.bus.image.galaxy.data.Attributes, int, org.aoju.bus.image.galaxy.data.VR, java.lang.Object)for each attribute in this instance.booleanaddAll(Attributes other) booleanaddAll(Attributes other, boolean mergeOriginalAttributesSequence) booleanaddNotSelected(Attributes other, int... selection) Add not selected attributes from another Attributes object to this.booleanaddNotSelected(Attributes other, int[] selection, int fromIndex, int toIndex) Add not selected attributes from another Attributes object to this.addOriginalAttributes(String sourceOfPreviousValues, Date modificationDateTime, String reasonForModification, String modifyingSystem, Attributes originalAttributes) booleanaddSelected(Attributes other, int... selection) Add selected attributes from another Attributes object to this.booleanaddSelected(Attributes other, int[] selection, int fromIndex, int toIndex) Add selected attributes from another Attributes object to this.booleanaddSelected(Attributes other, String privateCreator, int tag) booleanaddSelected(Attributes other, Attributes selection) final booleanintcalcLength(ImageEncodingOptions encOpts, boolean explicitVR) voidclear()clearProperty(String key) booleancontains(int tag) booleanbooleancontainsTagInRange(int firstTag, int lastTag) Test whether at least one tag within the given range is contained.booleancontainsValue(int tag) booleancontainsValue(String privateCreator, int tag) createFileMetaInformation(String tsuid) static AttributescreateFileMetaInformation(String iuid, String cuid, String tsuid) intdiff(Attributes other, int[] selection, Attributes diff) intdiff(Attributes other, int[] selection, Attributes diff, boolean onlyModified) ensureSequence(int tag, int initialCapacity) ensureSequence(String privateCreator, int tag, int initialCapacity) booleanbooleanequalValues(Attributes other, int tag) booleanequalValues(Attributes other, String privateCreator, int tag) byte[]getBytes(int tag) byte[]getDate(int tag) getDate(int tag, int valueIndex) getDate(int tag, int valueIndex, Date defVal, DatePrecision precision) getDate(int tag, int valueIndex, DatePrecision precision) getDate(int tag, Date defVal, DatePrecision precision) getDate(int tag, DatePrecision precision) getDate(long tag) getDate(long tag, Date defVal, DatePrecision precision) getDate(long tag, DatePrecision precision) getDate(String privateCreator, int tag, int valueIndex, Date defVal, DatePrecision precision) getDate(String privateCreator, int tag, int valueIndex, DatePrecision precision) getDate(String privateCreator, int tag, Date defVal, DatePrecision precision) getDate(String privateCreator, int tag, DatePrecision precision) getDate(String privateCreator, int tag, VR vr, int valueIndex, Date defVal, DatePrecision precision) getDate(String privateCreator, int tag, VR vr, int valueIndex, DatePrecision precision) getDate(String privateCreator, int tag, VR vr, Date defVal, DatePrecision precision) getDate(String privateCreator, int tag, VR vr, DatePrecision precision) getDate(String privateCreator, long tag, Date defVal, DatePrecision precision) getDate(String privateCreator, long tag, DatePrecision precision) getDateRange(int tag) getDateRange(int tag, DateRange defVal) getDateRange(long tag) getDateRange(long tag, DateRange defVal) getDateRange(String privateCreator, int tag) getDateRange(String privateCreator, int tag, DateRange defVal) getDateRange(String privateCreator, int tag, VR vr) getDateRange(String privateCreator, int tag, VR vr, DateRange defVal) getDateRange(String privateCreator, long tag) getDateRange(String privateCreator, long tag, DateRange defVal) Date[]getDates(int tag) Date[]getDates(int tag, DatePrecision precisions) Date[]getDates(long tag) Date[]getDates(long tag, DatePrecision precisions) Date[]Date[]getDates(String privateCreator, int tag, DatePrecision precisions) Date[]Date[]getDates(String privateCreator, int tag, VR vr, DatePrecision precisions) Date[]Date[]getDates(String privateCreator, long tag, DatePrecision precisions) doublegetDouble(int tag, double defVal) doublegetDouble(int tag, int valueIndex, double defVal) doubledoubledoubledoubledouble[]getDoubles(int tag) double[]getDoubles(String privateCreator, int tag) double[]getDoubles(String privateCreator, int tag, VR vr) floatgetFloat(int tag, float defVal) floatgetFloat(int tag, int valueIndex, float defVal) floatfloatfloatfloatfloat[]getFloats(int tag) float[]float[]intgetInt(int tag, int defVal) intgetInt(int tag, int valueIndex, int defVal) intintintintint[]getInts(int tag) int[]int[]final longfinal intfinal intgetLevel()getModified(Attributes other, Attributes result) Add attributes of this data set which were replaced in the specified other data set into the result data set.getNestedDataset(int sequenceTag) getNestedDataset(int sequenceTag, int itemIndex) getNestedDataset(String privateCreator, int sequenceTag) getNestedDataset(String privateCreator, int sequenceTag, int itemIndex) getNestedDataset(List<ItemPointer> itemPointers) getNestedDataset(ItemPointer... itemPointers) final AttributesgetPrivateCreator(int tag) getProperty(String key, Object defVal) getRemovedOrModified(Attributes other) Returns attributes of this data set which were removed or replaced in the specified other data set.final AttributesgetRoot()byte[]getSafeBytes(int tag) byte[]getSafeBytes(String privateCreator, int tag) getSequence(int tag) getSequence(String privateCreator, int tag) getString(int tag) getString(int tag, int valueIndex) String[]getStrings(int tag) String[]getStrings(String privateCreator, int tag) String[]getStrings(String privateCreator, int tag, VR vr) getValue(int tag) getVR(int tag) inthashCode()voidinternalizeStringValues(boolean decode) final booleanisEmpty()final booleanisRoot()booleanmatches(Attributes keys, boolean ignorePNCase, boolean matchNoValue) newFragments(int tag, VR vr, int initialCapacity) newFragments(String privateCreator, int tag, VR vr, int initialCapacity) newSequence(int tag, int initialCapacity) newSequence(String privateCreator, int tag, int initialCapacity) privateCreatorOf(int tag) remove(int tag) intintintintintremovePrivateAttributes(String privateCreator, int groupNumber) voidremoveSelected(int... selection) voidreplaceSelected(Attributes others, int... selection) voidreplaceUIDSelected(int... selection) setDate(int tag, VR vr, DatePrecision precision, Date... ds) voidvoidsetDate(long tag, DatePrecision precision, Date dt) setDate(String privateCreator, int tag, VR vr, DatePrecision precision, Date... ds) voidvoidsetDate(String privateCreator, long tag, DatePrecision precision, Date dt) setDateRange(int tag, VR vr, DatePrecision precision, DateRange range) setDateRange(int tag, VR vr, DateRange range) voidsetDateRange(long tag, DateRange dr) setDateRange(String privateCreator, int tag, VR vr, DatePrecision precision, DateRange range) setDateRange(String privateCreator, int tag, VR vr, DateRange range) voidsetDateRange(String privateCreator, long tag, DateRange range) voidfinal voidsetItemPosition(long itemPosition) voidsetProperties(Map<String, Object> properties) setProperty(String key, Object value) voidsetSpecificCharacterSet(String... codes) Set Specific Character Set (0008,0005) to specified internal(s) and re-encode contained LO, LT, PN, SH, ST, UT attributes accordingly.voidsetTimezone(TimeZone tz) Set the Default Time Zone to specified value and adjust contained DA, DT and TM attributs accordingly.voidsetTimezoneOffsetFromUTC(String utcOffset) Set Timezone Offset From UTC (0008,0201) to specified value and adjust contained DA, DT and TM attributs accordinglyfinal intsize()intint[]tags()booleantestUpdate(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified) booleantestUpdateNotSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Tests ifupdateNotSelected(org.aoju.bus.image.galaxy.data.Attributes.UpdatePolicy, org.aoju.bus.image.galaxy.data.Attributes, org.aoju.bus.image.galaxy.data.Attributes, int...)would modify attributes, without actually modifying this attributesbooleantestUpdateSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Tests ifupdateSelected(org.aoju.bus.image.galaxy.data.Attributes.UpdatePolicy, org.aoju.bus.image.galaxy.data.Attributes, org.aoju.bus.image.galaxy.data.Attributes, int...)would modify attributes, without actually modifying this attributestoString()toString(int limit, int maxWidth) toStringBuilder(int limit, int maxWidth, StringBuilder sb) voidvoidtrimToSize(boolean recursive) static voidunifyCharacterSets(Attributes... attrsList) booleanupdate(Attributes.UpdatePolicy updatePolicy, boolean mergeOriginalAttributesSequence, Attributes newAttrs, Attributes modified) booleanupdate(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified) booleanupdateNotSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Add not selected attributes from another Attributes object to this.booleanupdateSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Add selected attributes from another Attributes object to this.voidvalidate(IOD.DataElement el, ValidationResult result) voidwriteGroupTo(ImageOutputStream out, int groupLengthTag) voidvoidwriteTo(ImageOutputStream out)
-
Constructor Details
-
Attributes
public Attributes() -
Attributes
public Attributes(boolean bigEndian) -
Attributes
public Attributes(int initialCapacity) -
Attributes
public Attributes(boolean bigEndian, int initialCapacity) -
Attributes
-
Attributes
-
Attributes
-
Attributes
-
Attributes
-
-
Method Details
-
createFileMetaInformation
-
unifyCharacterSets
-
clear
public void clear() -
getProperties
-
setProperties
-
getProperty
-
setProperty
-
clearProperty
-
isRoot
public final boolean isRoot() -
getLevel
public final int getLevel() -
bigEndian
public final boolean bigEndian() -
getParent
-
getRoot
-
getLength
public final int getLength() -
getItemPosition
public final long getItemPosition() -
setItemPosition
public final void setItemPosition(long itemPosition) -
isEmpty
public final boolean isEmpty() -
size
public final int size() -
tags
public int[] tags() -
trimToSize
public void trimToSize() -
trimToSize
public void trimToSize(boolean recursive) -
internalizeStringValues
public void internalizeStringValues(boolean decode) -
getNestedDataset
-
getNestedDataset
-
getNestedDataset
-
getNestedDataset
-
getNestedDataset
-
getNestedDataset
-
tagOf
-
getSpecificCharacterSet
-
contains
public boolean contains(int tag) -
contains
-
containsValue
public boolean containsValue(int tag) -
containsValue
-
containsTagInRange
public boolean containsTagInRange(int firstTag, int lastTag) Test whether at least one tag within the given range is contained.- Parameters:
firstTag- first tag (inclusive)lastTag- last tag (inclusive)- Returns:
- whether at least one tag within the given range is contained
-
privateCreatorOf
-
getValue
-
getValue
-
getValue
-
getValue
-
getVR
-
getVR
-
getSequence
-
getSequence
-
getBytes
- Throws:
IOException
-
getBytes
- Throws:
IOException
-
getSafeBytes
public byte[] getSafeBytes(int tag) -
getSafeBytes
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getString
-
getStrings
-
getStrings
-
getStrings
-
getInt
public int getInt(int tag, int defVal) -
getInt
public int getInt(int tag, int valueIndex, int defVal) -
getInt
-
getInt
-
getInt
-
getInt
-
getInts
public int[] getInts(int tag) -
getInts
-
getInts
-
getFloat
public float getFloat(int tag, float defVal) -
getFloat
public float getFloat(int tag, int valueIndex, float defVal) -
getFloat
-
getFloat
-
getFloat
-
getFloat
-
getFloats
public float[] getFloats(int tag) -
getFloats
-
getFloats
-
getDouble
public double getDouble(int tag, double defVal) -
getDouble
public double getDouble(int tag, int valueIndex, double defVal) -
getDouble
-
getDouble
-
getDouble
-
getDouble
-
getDoubles
public double[] getDoubles(int tag) -
getDoubles
-
getDoubles
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
public Date getDate(String privateCreator, int tag, int valueIndex, Date defVal, DatePrecision precision) -
getDate
-
getDate
-
getDate
-
getDate
public Date getDate(String privateCreator, int tag, VR vr, int valueIndex, Date defVal, DatePrecision precision) -
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDate
-
getDates
-
getDates
-
getDates
-
getDates
-
getDates
-
getDates
-
getDates
-
getDates
-
getDates
-
getDates
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getDateRange
-
getSpecificCharacterSet
-
setSpecificCharacterSet
Set Specific Character Set (0008,0005) to specified internal(s) and re-encode contained LO, LT, PN, SH, ST, UT attributes accordingly.- Parameters:
codes- new value(s) of Specific Character Set (0008,0005)
-
getDefaultTimeZone
-
setDefaultTimeZone
-
getTimeZone
-
setTimezoneOffsetFromUTC
Set Timezone Offset From UTC (0008,0201) to specified value and adjust contained DA, DT and TM attributs accordingly- Parameters:
utcOffset- offset from UTC as (+|-)HHMM
-
setTimezone
Set the Default Time Zone to specified value and adjust contained DA, DT and TM attributs accordingly. If the Time Zone does not use Daylight Saving Time, attribute Timezone Offset From UTC (0008,0201) will be also set accordingly. If the Time zone uses Daylight Saving Time, a previous existing attribute Timezone Offset From UTC (0008,0201) will be removed.- Parameters:
tz- Time Zone- See Also:
-
getPrivateCreator
-
remove
-
remove
-
setNull
-
setNull
-
setBytes
-
setBytes
-
setString
-
setString
-
setString
-
setString
-
setInt
-
setInt
-
setFloat
-
setFloat
-
setDouble
-
setDouble
-
setDate
-
setDate
-
setDate
-
setDate
-
setDate
-
setDate
-
setDate
-
setDate
-
setDateRange
-
setDateRange
-
setDateRange
-
setDateRange
public Object setDateRange(String privateCreator, int tag, VR vr, DatePrecision precision, DateRange range) -
setDateRange
-
setDateRange
-
setValue
-
setValue
-
newSequence
-
newSequence
-
ensureSequence
-
ensureSequence
-
newFragments
-
newFragments
-
addAll
-
addAll
-
addSelected
-
addSelected
-
addSelected
Add selected attributes from another Attributes object to this. The specified array of tag values must be sorted (as by theArrays.sort(int[])method) prior to making this call.- Parameters:
other- the other Attributes objectselection- sorted tag values- Returns:
- true if one ore more attributes were added
-
addSelected
Add selected attributes from another Attributes object to this. The specified array of tag values must be sorted (as by theArrays.sort(int[], int, int)method) prior to making this call.- Parameters:
other- the other Attributes objectselection- sorted tag valuesfromIndex- the index of the first tag (inclusive)toIndex- the index of the last tag (exclusive)- Returns:
- true if one ore more attributes were added
-
addNotSelected
Add not selected attributes from another Attributes object to this. The specified array of tag values must be sorted (as by theArrays.sort(int[])method) prior to making this call.- Parameters:
other- the other Attributes objectselection- sorted tag values- Returns:
- true if one ore more attributes were added
-
addNotSelected
Add not selected attributes from another Attributes object to this. The specified array of tag values must be sorted (as by theArrays.sort(int[])method) prior to making this call.- Parameters:
other- the other Attributes objectselection- sorted tag valuesfromIndex- the index of the first tag (inclusive)toIndex- the index of the last tag (exclusive)- Returns:
- true if one ore more attributes were added
-
update
public boolean update(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified) -
update
public boolean update(Attributes.UpdatePolicy updatePolicy, boolean mergeOriginalAttributesSequence, Attributes newAttrs, Attributes modified) -
testUpdate
public boolean testUpdate(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified) -
updateSelected
public boolean updateSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Add selected attributes from another Attributes object to this. Optionally, the original values of overwritten existing non-empty attributes are preserved in another Attributes object.- Parameters:
updatePolicy- the policynewAttrs- the other Attributes objectmodified- Attributes object to collect overwritten non-empty attributes with original values or nullselection- sorted tag values- Returns:
- true f one ore more attribute were added or overwritten with a different value
-
testUpdateSelected
public boolean testUpdateSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Tests ifupdateSelected(org.aoju.bus.image.galaxy.data.Attributes.UpdatePolicy, org.aoju.bus.image.galaxy.data.Attributes, org.aoju.bus.image.galaxy.data.Attributes, int...)would modify attributes, without actually modifying this attributes- Parameters:
updatePolicy- the policynewAttrs- the other Attributes objectmodified- Attributes object to collect overwritten non-empty attributes with original values or trueselection- sorted tag values- Returns:
- true if one ore more attribute would be added or overwritten with a different value
-
updateNotSelected
public boolean updateNotSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Add not selected attributes from another Attributes object to this. Optionally, the original values of overwritten existing non-empty attributes are preserved in another Attributes object. The specified array of tag values must be sorted (as by theArrays.sort(int[])method) prior to making this call.- Parameters:
updatePolicy- the policynewAttrs- the other Attributes objectmodified- Attributes object to collect overwritten non-empty attributes with original values or nullselection- sorted tag values- Returns:
- true if one ore more attribute were added or overwritten with a different value
-
testUpdateNotSelected
public boolean testUpdateNotSelected(Attributes.UpdatePolicy updatePolicy, Attributes newAttrs, Attributes modified, int... selection) Tests ifupdateNotSelected(org.aoju.bus.image.galaxy.data.Attributes.UpdatePolicy, org.aoju.bus.image.galaxy.data.Attributes, org.aoju.bus.image.galaxy.data.Attributes, int...)would modify attributes, without actually modifying this attributes- Parameters:
updatePolicy- the policynewAttrs- the other Attributes objectmodified- Attributes object to collect overwritten non-empty attributes with original values or trueselection- sorted tag values- Returns:
- true if one ore more attribute would be added or overwritten with a different value
-
addOriginalAttributes
public Attributes addOriginalAttributes(String sourceOfPreviousValues, Date modificationDateTime, String reasonForModification, String modifyingSystem, Attributes originalAttributes) -
equals
-
equalValues
-
equalValues
-
hashCode
-
toString
-
toString
-
toStringBuilder
-
toStringBuilder
-
calcLength
-
writeTo
- Throws:
IOException
-
writeItemTo
- Throws:
IOException
-
accept
InvokesAttributes.Visitor.visit(org.aoju.bus.image.galaxy.data.Attributes, int, org.aoju.bus.image.galaxy.data.VR, java.lang.Object)for each attribute in this instance. The operation will be aborted if visitor.visit returns false .- Parameters:
visitor- the VisitorvisitNestedDatasets- controls if visitor.visit is also invoked for attributes in nested datasets- Returns:
- true if the operation was not aborted.
- Throws:
Exception- exception
-
writeGroupTo
- Throws:
IOException
-
createFileMetaInformation
-
matches
-
validate
-
validate
-
getModified
Add attributes of this data set which were replaced in the specified other data set into the result data set. If no result data set is passed, a new result set will be instantiated.- Parameters:
other- data setresult- data set ornull- Returns:
- result data set.
-
getRemovedOrModified
Returns attributes of this data set which were removed or replaced in the specified other data set.- Parameters:
other- data set- Returns:
- attributes of this data set which were removed or replaced in the specified other data set.
-
diff
-
diff
-
removeAllBulkData
public int removeAllBulkData() -
removePrivateAttributes
-
removePrivateAttributes
public int removePrivateAttributes() -
removeSelected
public void removeSelected(int... selection) -
replaceSelected
-
replaceUIDSelected
public void replaceUIDSelected(int... selection) -
removeCurveData
public int removeCurveData() -
removeOverlayData
public int removeOverlayData()
-