![]() |
Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.3.25
|
Leadtools.Dicom Namespace > DicomDataSet Class > SetBinaryValue Method : SetBinaryValue(DicomElement,String) Method |
public bool SetBinaryValue( DicomElement element, string fileName )
'Declaration
Public Overloads Function SetBinaryValue( _ ByVal element As DicomElement, _ ByVal fileName As String _ ) As Boolean
'Usage
Dim instance As DicomDataSet Dim element As DicomElement Dim fileName As String Dim value As Boolean value = instance.SetBinaryValue(element, fileName)
public bool SetBinaryValue( DicomElement element, string fileName )
public: bool SetBinaryValue( DicomElement^ element, String^ fileName )
This example will replace the video stored in an existing DICOM Dataset with another one. The replacement video should have the same format, frame rate and compression as the originally stored one.
Note:
This example assumes the replacement video has all the correct characteristics of a Dicom video and assumes that the tags found in the original dataset matches the video specs as well, if you need higher level video processing you need to use the medical SDK, which is supported only via the LEADTOOLS Medical Multimedia Module.
Imports Leadtools Imports Leadtools.Dicom <TestMethod()> _ Public Sub Test_DicomDataSet_ReplaceVideoExample() Dim src As String = "DaDa_DVD_MPEG2.dcm" Dim videoFile As String = "DaDa_DVD_MPEG2.mpg" Dim target As String = "target.dcm" DicomEngine.Startup() Dim ds As DicomDataSet = New DicomDataSet() ds.Load(src, DicomDataSetLoadFlags.None) Dim pixelDataElement As DicomElement = ds.FindFirstElement(Nothing, DicomTag.PixelData, True) Dim itemElement As DicomElement = ds.GetChildElement(pixelDataElement, True) itemElement = ds.GetNextElement(itemElement, True, True) ds.SetBinaryValue(itemElement, videoFile) ds.Save(target, 0) DicomEngine.Shutdown() Console.WriteLine("Test_DicomDataSet_ReplaceVideoExample Finished") End Sub
using Leadtools; using Leadtools.Dicom; [TestMethod] public void Test_DicomDataSet_ReplaceVideoExample() { string src = @"DaDa_DVD_MPEG2.dcm"; string videoFile = @"DaDa_DVD_MPEG2.mpg"; string target = @"target.dcm"; DicomEngine.Startup(); DicomDataSet ds = new DicomDataSet(); ds.Load(src, DicomDataSetLoadFlags.None); var pixelDataElement = ds.FindFirstElement(null, DicomTag.PixelData, true); var itemElement = ds.GetChildElement(pixelDataElement, true); itemElement = ds.GetNextElement(itemElement, true, true); ds.SetBinaryValue(itemElement, videoFile); ds.Save(target, 0); DicomEngine.Shutdown(); Console.WriteLine("Test_DicomDataSet_ReplaceVideoExample Finished"); }
DicomDataSet Class
DicomDataSet Members
Overload List
SetValue Method
SetBinaryValue(DicomElement,IntPtr,Int32) Method
SetStringValue(DicomElement,String,DicomCharacterSetType) Method
SetStringValue(DicomElement,String[],DicomCharacterSetType) Method
SetStringValue(DicomElement,String) Method
SetStringValue(DicomElement,String[]) Method
SetStringValuePtr(DicomElement,IntPtr,Int32) Method
SetStringValuePtr(DicomElement,IntPtr,UInt32,DicomCharacterSetType) Method
SetShortValue(DicomElement,Int16[],Int32) Method
SetIntValue(DicomElement,Int32[],Int32) Method
SetFloatValue(DicomElement,Single[],Int32) Method
SetDoubleValue(DicomElement,Double[],Int32) Method
SetAgeValue Method
SetDateValue(DicomElement,DicomDateValue[]) Method
SetTimeValue(DicomElement,DicomTimeValue[]) Method
SetDateTimeValue(DicomElement,DicomDateTimeValue[]) Method
SetConvertValue(DicomElement,String,Int32) Method