Leadtools.Dicom Requires Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
InsertElement(DicomElement,Boolean,DicomTagType,DicomVRType,Boolean,Int32) Method
See Also 
Leadtools.Dicom Namespace > DicomDataSet Class > InsertElement Method : InsertElement(DicomElement,Boolean,DicomTagType,DicomVRType,Boolean,Int32) Method




neighbor
An item in the Data Set. The inserted item will be inserted as a neighbor to this item, or as a child, depending on the value of child.
child
true to insert the new item as the last child of neighbor; false to insert the new item as the last sibling of neighbor.
tag
Tag of the inserted element. For a list of default values, refer to Data Element Tag Values.
vr
Value Representation code that indicates the type of the value stored in the data element.
sequence
true if the new item is a sequence; otherwise, false.
index
The index at which the data element should be inserted in a sequence, if the data element is an DicomTagType.Item. This parameter is valid only if the data element being inserted has a tag of value DicomTagType.Item; otherwise, the parameter is ignored. The index is zero-based, so if you want to insert an DicomTagType.Item data element as the first item in the sequence, set this to 0. The value -1 indicates to add the DicomTagType.Item data element to the end of the sequence.

A sequence may consist of one or more items. This parameter lets you insert an DicomTagType.Item data element as any item within the sequence, not just at the end. In addition, it lets you insert multiple DicomTagType.Item data elements within a sequence.

If neighbor points to the parent of a sequence and child is true, the index will pertain to the children of neighbor. If neighbor points to a member of a sequence and child is false, the index pertains to the siblings of neighbor.

Inserts a new element in the Data Set.

Syntax

Visual Basic (Declaration) 
Overloads Public Function InsertElement( _
   ByVal neighbor As DicomElement, _
   ByVal child As Boolean, _
   ByVal tag As DicomTagType, _
   ByVal vr As DicomVRType, _
   ByVal sequence As Boolean, _
   ByVal index As Integer _
) As DicomElement
Visual Basic (Usage)Copy Code
Dim instance As DicomDataSet
Dim neighbor As DicomElement
Dim child As Boolean
Dim tag As DicomTagType
Dim vr As DicomVRType
Dim sequence As Boolean
Dim index As Integer
Dim value As DicomElement
 
value = instance.InsertElement(neighbor, child, tag, vr, sequence, index)
C# 
public DicomElement InsertElement( 
   DicomElement neighbor,
   bool child,
   DicomTagType tag,
   DicomVRType vr,
   bool sequence,
   int index
)
Managed Extensions for C++ 
public: DicomElement* InsertElement( 
   DicomElement* neighbor,
   bool child,
   DicomTagType tag,
   DicomVRType vr,
   bool sequence,
   int index
) 
C++/CLI 
public:
DicomElement^ InsertElement( 
   DicomElement^ neighbor,
   bool child,
   DicomTagType tag,
   DicomVRType vr,
   bool sequence,
   int index
) 

Parameters

neighbor
An item in the Data Set. The inserted item will be inserted as a neighbor to this item, or as a child, depending on the value of child.
child
true to insert the new item as the last child of neighbor; false to insert the new item as the last sibling of neighbor.
tag
Tag of the inserted element. For a list of default values, refer to Data Element Tag Values.
vr
Value Representation code that indicates the type of the value stored in the data element.
sequence
true if the new item is a sequence; otherwise, false.
index
The index at which the data element should be inserted in a sequence, if the data element is an DicomTagType.Item. This parameter is valid only if the data element being inserted has a tag of value DicomTagType.Item; otherwise, the parameter is ignored. The index is zero-based, so if you want to insert an DicomTagType.Item data element as the first item in the sequence, set this to 0. The value -1 indicates to add the DicomTagType.Item data element to the end of the sequence.

A sequence may consist of one or more items. This parameter lets you insert an DicomTagType.Item data element as any item within the sequence, not just at the end. In addition, it lets you insert multiple DicomTagType.Item data elements within a sequence.

If neighbor points to the parent of a sequence and child is true, the index will pertain to the children of neighbor. If neighbor points to a member of a sequence and child is false, the index pertains to the siblings of neighbor.

Example

For an example, refer to Load.

Remarks

The illustrations below show how items are added to the Data Set (internally maintained as a tree), based on the value of child.

For the sake of these illustrations, the order of siblings is top to bottom. Therefore, since added items become the last sibling or the last child, these are drawn at the bottom of the appropriate group of items.

In this illustration, neighbor points to Item 1 and child is false. The new item is added as the last sibling of Item 1.

In this illustration, neighbor points to Item 1 and child is true. The new item is added as the last child of Item 1.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Dicom requires a Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features