DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / Import Method / Import(Stream,String) Method

The System IO Stream to read

The type of import operation to perform







In This Topic
    Import(Stream,String) Method
    In This Topic
    Copies the image data from a System IO Stream
    Syntax
    'Declaration
     
    
    Public Overloads Sub Import( _
       ByVal Stream As System.IO.Stream, _
       ByVal Format As System.String _
    ) 
    'Usage
     
    
    Dim instance As DicomImage
    Dim Stream As System.IO.Stream
    Dim Format As System.String
     
    instance.Import(Stream, Format)
    public void Import( 
       System.IO.Stream Stream,
       System.string Format
    )
    public procedure Import( 
        Stream: System.IO.Stream;
        Format: System.String
    ); 
    public function Import( 
       Stream : System.IO.Stream,
       Format : System.String
    );
    public: void Import( 
       System.IO.Stream* Stream,
       System.string* Format
    ) 
    public:
    void Import( 
       System.IO.Stream^ Stream,
       System.String^ Format
    ) 

    Parameters

    Stream

    The System IO Stream to read

    Format

    The type of import operation to perform

    Remarks

    Like the Paste method, this method modifies only the minimum number of attributes necessary to ensure consistency of the image. In order to produce a valid DICOM SOP instance, many other attributes (depending on the SOP class) must be added.

    All formats which can be supported by Windows via new Bitmap(Stream) or explicitly via (including JPEG 2000) are supported.

    The following applies to JPEG file import:

    • The JPEG data is imported directly, and may either be stored or transmitted unchanged as a JPEG encapsulated SOP instance (1.2.840.10008.1.2.4.50), or automatically decompressed if necessary.
    • The Type parameter must be JPEG or JPG

    The following applies to JPEG 2000 file import:

    • The import format must be "J2K", "JPC" or "JP2"
    • The JPEG 2000 data is imported directly, and may either be stored or transmitted unchanged as a JPEG 2000 encapsulated SOP instance (1.2.840.10008.1.2.4.90 or .91), or automatically decompressed if necessary.
    • The Type parameter must be J2K, JPC or JP2.
    • For JP2, the header is stripped

    The following applies to AVI file import:

    • The Type parameter must be AVI.
    • A multi-frame DICOM image is generated.

    See for details of how to write and configure your own codecs.

    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also