DicomObjects Reference
DicomObjects Reference / DicomAttributes Collection / AddExplicit Method
The tags which define the meaning of the attribute
The tags which define the meaning of the attribute
The value representation (2 character string) of the attribute to be added
The Value to be assigned
In This Topic
    AddExplicit Method
    In This Topic
    Description
    Adds a DicomAttribute with a defined VR to a DicomAttributes Collection
    Syntax
    Visual Basic
    Public Sub AddExplicit( _
       ByVal Group As Long, _
       ByVal Element As Long, _
       ByVal VR As String, _
       ByVal Value As Variant _
    ) 
    Parameters
    Group
    The tags which define the meaning of the attribute
    Element
    The tags which define the meaning of the attribute
    VR
    The value representation (2 character string) of the attribute to be added
    Value
    The Value to be assigned
    Remarks

    Standard elements should be added using Add, which will determine the VR from the internal dictionary.  AddExplicit should only be used for private elements (or possibly new elements not yet known to DicomObjects) for which the VR needs explicit definition.
    The type of value required for the “Value” parameter depends on the value representation of the attribute, as defined by either by the VR parameter, or by the values of group and element.  Values of the types returned by Attribute.Value are always acceptable, as are values of other types that can be suitably coerced.  Variants of type “null” are also accepted, resulting a zero-length data element, which can be useful in raw queries and for “type 2” elements.  There are some special conditions relating to date and time types.

    To create a sequence, value may be a DicomDataSets collection.
    If the data element being added has a potential value multiplicity (VM) of >1, then value may be either an array or scalar, but if the element’s VM is always 1, then an attempt to assign an array will generate an error.
    Any existing attribute with the same group and element will be silently replaced, even if it is an array.

    See Also