DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomGlobal Class / IsDICOM Method / IsDICOM(Stream) Method
The Stream which carries the data
Example

In This Topic
    IsDICOM(Stream) Method
    In This Topic
    A very simple method to test whether a stream contains valid DICOM
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function IsDICOM( _
       ByVal stream As System.IO.Stream _
    ) As System.Boolean
    public static System.bool IsDICOM( 
       System.IO.Stream stream
    )

    Parameters

    stream
    The Stream which carries the data

    Return Value

    True if the byte 129 - 132 is DICM and the next 8 bytes contains the group 0 header data 02 00 00 00 55 4C 04 00
    Example
    string filename = "your_file"; // replace with the actual file path
    using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also