←Select platform

FindNextPrivateElement Method

Summary
Returns the next existing private element that is reserved by privateCreatorDataElement.
Syntax
C#
C++/CLI
Java
public DicomElement findNextPrivateElement(DicomElement element, DicomElement privateCreatorDataElement) 

Parameters

element
A DicomElement in the data set.

privateCreatorDataElement
Private Creator Data Element

Return Value

The next private element reserved by privateCreatorDataElement. If null is returned, a private element was not found.

Remarks

This feature is available in version 16 or higher.

Use this method after calling FindFirstPrivateElement to find any or all the private elements reserved by privateCreatorDataElement. For more information on how Private Creator Data Elements are used to reserve private elements, see the documentation for CreatePrivateCreatorDataElement.

The search for private elements is on the same level as privateCreatorDataElement. For the argument element, pass the value returned by FindFirstPrivateElement or the value returned by FindNextPrivateElement.

Example
C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
string DumpElement(DicomElement p) 
{ 
   if (p == null) 
      return string.Empty; 
   return string.Format("({0:X4},{1:X4})\n", p.Tag >> 0x10, p.Tag & 0xFFFF); 
} 
 
string DumpPrivateElements(DicomDataSet ds, DicomElement privateCreatorDataElement) 
{ 
   string sMsg = string.Empty; 
   DicomElement p = ds.FindFirstPrivateElement(privateCreatorDataElement); 
   while (p != null) 
   { 
      sMsg = sMsg + "\t" + DumpElement(p); 
      p = ds.FindNextPrivateElement(p, privateCreatorDataElement); 
   } 
   return sMsg; 
} 
 
void DicomDataSet_FindFirstPrivateCreatorDataElementExample(DicomDataSet ds, DicomElement root, bool tree) 
{ 
   string sMsg = string.Empty; 
   DicomElement pPrivateCreatorDataElement = ds.FindFirstPrivateCreatorDataElement(root, tree, null, 0); 
   while (pPrivateCreatorDataElement != null) 
   { 
      sMsg = sMsg + "*** Private Creator Data Element" + DumpElement(pPrivateCreatorDataElement); 
      sMsg = sMsg + DumpPrivateElements(ds, pPrivateCreatorDataElement); 
      pPrivateCreatorDataElement = ds.FindNextPrivateCreatorDataElement(pPrivateCreatorDataElement, tree, null, 0); 
   } 
 
   Console.WriteLine($"Private Elements: {sMsg.ToString()}"); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.8.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.