There are many overloads for this method.
This method is used to retrieve a value from a DICOM element It is very flexible method that can be used to retrieve the value as any of the types below, regardless of the DicomVRType The caller specificies the type T of the value, and the value is converted to this type if possible. The generic type T System.Object can be any of the following:
- System.String
- System.Byte
- System.DateTime
- DicomDateValue
- DicomTimeValue
- DicomDateTimeValue
- System.Int32
- System.Int16
- System.Double
- System.Single
- an array of any of the above types
The versions of GetValue that take a delegate can be used to retrieve ANY type, even if it is not native to DicomDataSet. The data is extracted from the value as a string passed to the provided method. The delegate is optional. Pass null if you do not want to use a delegate. Look at the example to see how to use the delegate. Below is a list of the overloads that take a delegate:
- Generic GetValue(DicomElement,Boolean,Int64,T,GetValueDelegate)
- Generic GetValue(DicomElement,T,GetValueDelegate)
- Generic GetValue(Int64,T,GetValueDelegate)
Some versions of GetValue return a reference to DicomDataSet, and return the value as an out parameter. These overloads are intended to be used by chaining them together, to make a very human readable code. See the part of the example that refers to a fluent interface to see how this is done. Below is a list of the overloads that return the type as an out parameter.
- Generic GetValue(DicomElement,T,out T)
- Generic GetValue(Int64,T,out T)
Some versions of GetValue have a parameter tag. For these versions, a search is done in the data set for an element that has this tag. Some of these overloads may also have element and tree parameters. If so, the search for tag starts at element. The search on the data set is performed as a list or tree depending on the tree parameter. For details on the element and tree parameters, see FindFirstElement
- Generic GetValue(DicomElement,Boolean,Int64,T,GetValueDelegate)
- Generic GetValue(Int64,T,GetValueDelegate)
- Generic GetValue(Int64,T)
- Generic GetValue(DicomElement,Boolean,Int64,T)
- Generic GetValue(Int64,T,out T)
Other versions of this method do not have a tag parameter. In this case, a reference to the actual element is passed to the function, and the value of this element is returned.
- Generic GetValue(DicomElement,T,GetValueDelegate)
- Generic GetValue(DicomElement,T)
- Generic GetValue(DicomElement,T,out T)
All versions of this method take a defaultValue parameter. This is the value that is returned (or to which the out parameter is set) if the method cannot retrieve the actual value of the element, or if the element has no value. To see if this is the case, check the value of the property DicomDataSet.GetValueResult.
Overload | Description |
---|---|
GetValue<T>(DicomElement,T,T) | Returns the value of a DICOM element |
GetValue<T>(Int64,T,T) | Returns the value of a DICOM element |
GetValue<T>(DicomElement,T) | Returns the value of a DICOM element |
GetValue<T>(DicomElement,T,GetValueDelegate) | Returns the value of a DICOM element |
GetValue<T>(Int64,T,GetValueDelegate) | Returns the value of a DICOM element |
GetValue<T>(DicomElement,Boolean,Int64,T) | Returns the value of a DICOM element |
GetValue<T>(DicomElement,Boolean,Int64,T,GetValueDelegate) | Returns the value of a DICOM element |
GetValue<T>(Int64,T) | Returns the value of a DICOM element |
Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)