public void Save(
Stream stream,
DicomDataSetSaveFlags flags
)
public:
void Save(
Stream^ stream,
DicomDataSetSaveFlags flags
)
stream
Output stream that will contain the saved data set.
flags
Meta-header flags, Transfer Syntax flags, and other flags that indicate the file characteristics to use when saving the file.
If the Data Set was loaded from a file, the file characteristics were included when the file was loaded. If you wish to use these same characteristics, save the Data Set with flags set to DicomDataSetSaveFlags.None. If you wish to specify the file characteristics for saving the data set, set the characteristics using the possible values for flags.
using Leadtools;
using Leadtools.Dicom;
public void LoadFromStreamSample()
{
string dicomFileNameInput = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image3.dcm");
string dicomFileNameOutput = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "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:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document