←Select platform

DeleteSignature Method

Summary
Removes one or all Digital Signatures from the Data Set.
Syntax
C#
C++/CLI
public void DeleteSignature( 
   DicomElement signatureItem 
) 
public: 
void DeleteSignature(  
   DicomElement^ signatureItem 
)  

Parameters

signatureItem
The Digital Signatures Sequence Item that corresponds to the Digital Signature to be removed from the Data Set. To remove all the Digital Signatures in the entire Data Set, set this parameter to null.

Remarks

Call this method to remove a single Digital Signature by specifying the corresponding Digital Signatures Sequence Item. The method will delete the specified item from the Data Set. The Message Authentication Code (MAC) Parameters Sequence Item that was referenced by the deleted Digital Signatures Sequence Item will also be deleted if it is not referenced by a Digital Signatures Sequence Item anymore. Call this method to remove all the Digital Signatures that exist in the Data Set by passing null to the method. In this case, all the MAC Parameters Sequence (4FFE,0001) and the Digital Signatures Sequence (FFFA,FFFA) Data Elements that exist in the Data Set will be deleted.

Example
C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
public void FindSignature() 
{ 
   string dicomFileName = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image3.dcm"); 
   //Make sure to initialize the DICOM engine, this needs to be done only once  
   //In the whole application 
   DicomEngine.Startup(); 
   using (DicomDataSet ds = new DicomDataSet()) 
   { 
      //Load DICOM File 
      ds.Load(dicomFileName, DicomDataSetLoadFlags.None); 
      string signatureUID = "1.2.840.114257.0.130573664"; 
      // Search the whole Data Set for the Digital Signature with the 
      // specified Digital Signature UID 
      DicomElement signatureItem = ds.FindSignature(signatureUID); 
      if (signatureItem != null) 
      { 
         ds.DeleteSignature(signatureItem); 
         Console.WriteLine("Sample: The Digital Signature was found and got deleted."); 
      } 
      else 
      { 
         Assert.Fail("signatureItem is null"); 
         Console.WriteLine("Sample: The Digital Signature could not be found."); 
      } 
   } 
   DicomEngine.Shutdown(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
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.