public int GetSignaturesCount(
DicomElement item
)
public:
int GetSignaturesCount(
DicomElement^ item
)
item
An item of a sequence of items in the Data Set. The method returns the number of Digital Signatures in this Item. If this parameter is set to null, the method will return the number of Digital Signatures in the main Data Set.
The number of Digital Signatures in the specified item, or in the main Data Set if no item is specified.
The method computes the number of Digital Signatures by counting the number of items under the Digital Signatures sequence (FFFA,FFFA) which is located under the item specified by item or on the root of the Data Set if the parameter is set to null. The method will return 0 if this sequence does not exist. One way of enumerating the Digital Signatures in the main Data Set or in an item of a sequence of items is by using this method along with the GetSignature method.
This example will enumerate all digital signatures in a DICOM dataset.
using Leadtools;
using Leadtools.Dicom;
public void EnumerateSignatures()
{
string dicomFileName = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "Signed.dcm");
//Make sure to initialize the DICOM engine, this needs to be done only once
//In the whole application
DicomEngine.Startup();
using (DicomDataSet dataset = new DicomDataSet())
{
//Load DICOM File
dataset.Load(dicomFileName, DicomDataSetLoadFlags.None);
// We will enumerate the Digital Signatures in the main Data Set
int signaturesCount = dataset.GetSignaturesCount(null);
if (signaturesCount == 0)
{
Console.WriteLine("No Digital Signatures in the main Data Set.");
return;
}
string msg;
if (signaturesCount == 1)
{
msg = "There is 1 Digital Signature in the main Data Set.Do you want to examine it?";
}
else
{
msg = String.Format("There are {0} Digital Signatures in the main Data Set. Do you want to examine them?", signaturesCount);
}
Console.WriteLine($"Sample: {msg}");
for (int i = 0; i < signaturesCount; i++)
{
ExamineSignature(dataset, dataset.GetSignature(null, i));
}
}
DicomEngine.Shutdown();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document