Loads a Data Set from a stream.
Supported in Silverlight, Windows Phone 7.
Syntax
Parameters
- 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.
Example
This example will load a DICOM Dataset from a file, save to a stream, load from a stream, and save to another file.
Visual Basic | Copy Code |
---|
Public Sub LoadFromStreamSample()
Dim dicomFileNameInput As String = LeadtoolsExamples.Common.ImagesPath.Path & "IMAGE3.dcm"
Dim dicomFileNameOutput As String = LeadtoolsExamples.Common.ImagesPath.Path & "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 |
C# | Copy Code |
---|
public void LoadFromStreamSample()
{
string dicomFileNameInput = LeadtoolsExamples.Common.ImagesPath.Path + "IMAGE3.dcm";
string dicomFileNameOutput = LeadtoolsExamples.Common.ImagesPath.Path + "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();
} |
SilverlightCSharp | Copy Code |
---|
|
SilverlightVB | Copy Code |
---|
|
Remarks
Requirements
Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)
See Also