Loads a Data Set from a stream.
public virtual void Load(
Stream stream,
Leadtools.Dicom.DicomDataSetLoadFlags flags
)
Public Overloads Overridable Sub Load( _
ByVal stream As Stream, _
ByVal flags As Leadtools.Dicom.DicomDataSetLoadFlags _
)
public virtual void Load(
Stream stream,
Leadtools.Dicom.DicomDataSetLoadFlags flags
)
public void load(ILeadStream stream, /*DicomDataSetLoadFlags*/ int flags)
function Leadtools.Dicom.DicomDataSet.Load(Stream,DicomDataSetLoadFlags)(
stream ,
flags
)
public:
virtual void Load(
Stream^ stream,
Leadtools.Dicom.DicomDataSetLoadFlags flags
)
stream
A stream contains the Data Set to be loaded.
flags
Meta-header flags and Transfer Syntax flags that indicate the file characteristics to use when loading the file.
If you know certain characteristics of the file, you can set those in flags. Any characteristic that you do not set will be automatically determined. For example, if you know that the Meta-header is present, but you do not know the byte order, or whether the Value Representation is Implicit or Explicit, you can set only DicomDataSetLoadFlags.MetaHeaderPresent in flags. During loading, LEADTOOLS will determine the byte order and whether the byte order is Implicit or Explicit. If you do not know any of the characteristics of the file, set flags to DicomDataSetLoadFlags.None and LEADTOOLS will automatically determine all the file characteristics and load the file accordingly.
In this overload, the DicomDataSetLoadFlags.LoadAndClose is always used internally, even if not included in the flags
To load a Data Set from memory, you can also use DicomDataSet.Load(IntPtr, long, DicomDataSetFlags). To load a Data Set from a file, you can use DicomDataSet.Load(string, DicomDataSetLoadFlags).
This example will load a DICOM Dataset from a file, save to a stream, load from a stream, and save to another file.
using Leadtools;
using Leadtools.Dicom;
public void LoadFromStreamSample()
{
string dicomFileNameInput = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm");
string dicomFileNameOutput = Path.Combine(LEAD_VARS.ImagesDir, "Image3_copy.dcm");
DicomEngine.Startup();
using (DicomDataSet ds = new DicomDataSet())
{
using (FileStream streamInput = new FileStream(dicomFileNameInput, FileMode.Open))
{
// Load a DICOM data set from a stream
ds.Load(streamInput, DicomDataSetLoadFlags.None);
// Save to another output stream
using (FileStream streamOutput = new FileStream(dicomFileNameOutput, FileMode.Create))
{
ds.Save(streamOutput, DicomDataSetSaveFlags.None);
}
}
}
DicomEngine.Shutdown();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Imports Leadtools
Imports Leadtools.Dicom
Public Sub LoadFromStreamSample()
Dim dicomFileNameInput As String = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm")
Dim dicomFileNameOutput As String = Path.Combine(LEAD_VARS.ImagesDir, "Image3_copy.dcm")
DicomEngine.Startup()
Using ds As New DicomDataSet()
Using streamInput As New FileStream(dicomFileNameInput, FileMode.Open)
' Load a DICOM data set from a stream
ds.Load(streamInput, DicomDataSetLoadFlags.None)
' Save to another output stream
Using streamOutput As New FileStream(dicomFileNameOutput, FileMode.Create)
ds.Save(streamOutput, DicomDataSetSaveFlags.None)
End Using
End Using
End Using
DicomEngine.Shutdown()
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
![]() |
Products |
Support |
Feedback: Load(Stream,DicomDataSetLoadFlags) Method - Leadtools.Dicom |
Introduction |
Help Version 19.0.2017.6.16
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.