←Select platform

GetValueResult Property

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

Property Value

The result of DicomDataSet.GetValue

Remarks

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

Example
C#
using Leadtools; 
using Leadtools.Dicom; 
 
 
///  
private void DicomDataSet_GetValueExample() 
{ 
   string sMsg; 
 
   // *************************************************** 
   // *** First 
   // *** Create some elements and set the values 
   // *************************************************** 
 
   DicomDataSet ds = new DicomDataSet(); 
   ds.InsertElementAndSetValue(DicomTag.HighBit, 15); 
 
   // 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()); 
 
   string[] names = { "ORIGINAL", "PRIMARY" }; 
   ds.InsertElementAndSetValue(DicomTag.ImageType, names); 
 
   ds.InsertElementAndSetValue(DicomTag.PhotometricInterpretation, DicomImagePhotometricInterpretationType.Rgb); 
   ds.InsertElementAndSetValue(DicomTag.PatientBirthDate, DateTime.Now); 
   ds.InsertElementAndSetValue(DicomTag.PatientName, "John^Smith"); 
 
   // *************************************************** 
   // *** Second 
   // *** Retrieve the element values 
   // *************************************************** 
 
   // Get an int value of an element by specifying a tag 
   int highbit = ds.GetValue<int>(DicomTag.HighBit, 0); 
 
   // This is how you check to see if the element value was successfully retrieved 
   Console.WriteLine(ds.GetValueResult.ToString()); 
 
   // Get a list of strings value of an element by specifying a tag 
   List<string> imageType = ds.GetValue<List<string>>(DicomTag.ImageType, null); 
   sMsg = string.Format("Result: {0}\nValues:", ds.GetValueResult); 
   foreach (string s in imageType) 
   { 
      sMsg = sMsg + "\n" + s; 
   } 
   Console.WriteLine(sMsg); 
 
   // Get an enumeration value of an element by specifying a tag 
   DicomImagePhotometricInterpretationType p = ds.GetValue<DicomImagePhotometricInterpretationType>(DicomTag.PhotometricInterpretation, 
                                                                                                    DicomImagePhotometricInterpretationType.Rgb); 
 
   // Get value of an element by specifying the element 
   DicomElement element = ds.FindFirstElement(null, DicomTag.PatientName, false); 
   string name = ds.GetValue<string>(element, null); 
   Console.WriteLine(name); 
 
   // Another overload 
   DateTime defaultDateTime = new DateTime(); 
   DateTime dateTime = ds.GetValue<DateTime>(null, true, DicomTag.PatientBirthDate, defaultDateTime); 
   Console.WriteLine(dateTime.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.