←Select platform

FindFirstPrivateElement Method

Summary
Returns the first existing private element that is reserved by privateCreatorDataElement.
Syntax
C#
C++/CLI
Java
public DicomElement FindFirstPrivateElement( 
   DicomElement privateCreatorDataElement 
) 
public DicomElement findFirstPrivateElement(DicomElement privateCreatorDataElement) 
public: 
DicomElement^ FindFirstPrivateElement(  
   DicomElement^ privateCreatorDataElement 
)  

Parameters

privateCreatorDataElement
Private Creator Data Element

Return Value

The first 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 along with FindNextPrivateElement 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 the element privateCreatorDataElement.

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.