←Select platform

InsertElementAndSetValueResult Property

Summary
Holds the result after a call to InsertElementAndSetValue.
Syntax
C#
C++/CLI
public DicomInsertElementAndSetValueResult InsertElementAndSetValueResult { get; } 
public: 
property DicomInsertElementAndSetValueResult InsertElementAndSetValueResult { 
   DicomInsertElementAndSetValueResult get(); 
} 

Property Value

the result after a call to InsertElementAndSetValue

Remarks

This read-only property is set after every call to InsertElementAndSetValue to indicate the degree of success.

Example
C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
///  
 
private void DicomDataSet_InsertElementAndSetValueExample() 
{ 
   DicomDataSet ds = new DicomDataSet(); 
 
   // Set a string 
   ds.InsertElementAndSetValue(null, false, DicomTag.PatientName, "Patient^Joe^MiddleName"); 
 
   // Or use an overload 
   ds.InsertElementAndSetValue(DicomTag.PatientName, "Patient^Joe^MiddleName"); 
 
   // This is how you check to see if the element got added -- for simplicity, we only check the first time 
   Console.WriteLine(ds.InsertElementAndSetValueResult.ToString()); 
 
   // Set an array of strings 
   string[] names = { "One", "Two", "Three" }; 
   ds.InsertElementAndSetValue(DicomTag.OtherPatientNames, names); 
 
   // Another way to do an array of strings 
   List<string> it = new List<string>(); 
   it.Add("ORIGINAL"); 
   it.Add("PRIMARY"); 
   ds.InsertElementAndSetValue(DicomTag.ImageType, it.ToArray()); 
 
   // Set an array of integers, that will be converted to strings 
   int[] namesInt = { 1, 2, 3 }; 
   ds.InsertElementAndSetValue(DicomTag.PhysicianOfRecord, namesInt); 
 
   // Set a DicomDateValue 
   DicomDateValue dicomDate = new DicomDateValue(1961, 6, 5); 
   ds.InsertElementAndSetValue(DicomTag.PatientBirthDate, dicomDate); 
 
   // Set a DateTime 
   DateTime dateTime = new DateTime(2003, 5, 16); 
   ds.InsertElementAndSetValue(DicomTag.InstanceCreationDate, dateTime); 
 
   // Set an array of DateTime 
   DateTime[] dateTimeArray = { new DateTime(2000, 3, 8), new DateTime(2003, 5, 16) }; 
   ds.InsertElementAndSetValue(DicomTag.DateOfLastCalibration, dateTimeArray); 
 
   // Insert a DicomTag and specify the Value Represention 
   // This is useful when a DICOM tag can have more than one value representation. 
   // For example, (5000,3000) CurveData can have a value representation of either OB or OW 
   int[] curveData = {1897, 1908, 1912, 1912, 1909 }; 
   ds.InsertElementAndSetValue(null, false, DicomTag.CurveData, DicomVRType.OW, curveData); 
 
   ds.Save(Path.Combine(LEAD_VARS.ImagesDir, "test.dcm"), DicomDataSetSaveFlags.None); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.Dicom Assembly

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