DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / Write Method / Write(String,String,Object) Method

The name of the file to write.

This is passed unmodified to the operating system, and it is therefore the container�s responsibility to ensure either that the current directory is set correctly, or that a fully qualified filename is provided.

Specifies the full UID of the transfer syntax with which the file is to be saved when Part 10 format is used. If omitted, the little-endian explicit VR transfer syntax is used.

The quality factor to be used. This is a generic compression quality depending on the Transfer Syntax used. This can be an integer that specifies the value stored in the System.Drawing.Imaging.EncoderParameter object for Bitmap export. This value for JPEG Baseline and JPEG Extended compression represents an integer between 0 – 100. This tells DicomObjects to set up the compressor to try to achieve the quality in percentage (higher quality value towards 100 means better quality and lower compression ratio). And for JPEG-LS Lossy and JPEG2000 Lossy compression this value is actually the desired compression ratio, i.e. if you set the quality value to 10, it tells DicomObjects to try to achieve compression ratio of 10. The actual compression ratio achieved will not be exactly the same as specified by quality value but close enough. The actual compression ratio is calculated based on the original data size and the compressed data size before it is added to “Lossy Image Compression Ratio” tag of the image. For Video compression, this value directly corresponds to the BitsPerSecond of the compressed video.







In This Topic
    Write(String,String,Object) Method
    In This Topic
    Writes dataset to an external DICOM file with specified transfer syntax and quality factor
    Syntax
    'Declaration
     
    
    Public Overloads Sub Write( _
       ByVal FileName As System.String, _
       ByVal TransferSyntax As System.String, _
       ByVal Quality As System.Object _
    ) 
    'Usage
     
    
    Dim instance As DicomDataSet
    Dim FileName As System.String
    Dim TransferSyntax As System.String
    Dim Quality As System.Object
     
    instance.Write(FileName, TransferSyntax, Quality)
    public void Write( 
       System.string FileName,
       System.string TransferSyntax,
       System.object Quality
    )
    public procedure Write( 
        FileName: System.String;
        TransferSyntax: System.String;
        Quality: System.TObject
    ); 
    public function Write( 
       FileName : System.String,
       TransferSyntax : System.String,
       Quality : System.Object
    );
    public: void Write( 
       System.string* FileName,
       System.string* TransferSyntax,
       System.Object* Quality
    ) 
    public:
    void Write( 
       System.String^ FileName,
       System.String^ TransferSyntax,
       System.Object^ Quality
    ) 

    Parameters

    FileName

    The name of the file to write.

    This is passed unmodified to the operating system, and it is therefore the container�s responsibility to ensure either that the current directory is set correctly, or that a fully qualified filename is provided.

    TransferSyntax

    Specifies the full UID of the transfer syntax with which the file is to be saved when Part 10 format is used. If omitted, the little-endian explicit VR transfer syntax is used.

    Quality

    The quality factor to be used. This is a generic compression quality depending on the Transfer Syntax used. This can be an integer that specifies the value stored in the System.Drawing.Imaging.EncoderParameter object for Bitmap export. This value for JPEG Baseline and JPEG Extended compression represents an integer between 0 – 100. This tells DicomObjects to set up the compressor to try to achieve the quality in percentage (higher quality value towards 100 means better quality and lower compression ratio). And for JPEG-LS Lossy and JPEG2000 Lossy compression this value is actually the desired compression ratio, i.e. if you set the quality value to 10, it tells DicomObjects to try to achieve compression ratio of 10. The actual compression ratio achieved will not be exactly the same as specified by quality value but close enough. The actual compression ratio is calculated based on the original data size and the compressed data size before it is added to “Lossy Image Compression Ratio” tag of the image. For Video compression, this value directly corresponds to the BitsPerSecond of the compressed video.

    Remarks

    The file may subsequently be read by the Read method or by other DICOM software.

    Quality is specific to the compression method being used, and is ignored for non-compressed or lossless JPEG transfer syntaxes. For Lossy JPEG, it is an integer in the range 1-100, the higher the number, the better the quality (and the larger the file), and for JPEG 2000 lossy, it is a compression ratio. Other compression methods may use this for other purposes in the future.

    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also