←Select platform

Save(Stream,DicomDataSetSaveFlags) Method

Summary
Saves the Data Set to a stream.
Syntax
C#
C++/CLI
Java
public void Save( 
   Stream stream, 
   DicomDataSetSaveFlags flags 
) 
public void save(ILeadStream stream, int flags) 
public: 
void Save(  
   Stream^ stream, 
   DicomDataSetSaveFlags flags 
)  

Parameters

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.

Remarks

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.

Example
C#
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"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.8.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.