DicomObjects Reference
DicomObjects Reference / DicomGlobal Object / ReadFile Method
The name of the file to read.
This is passed unmodified to the operating system, and it is therefore the container’s responsibility to ensure either that the file exists within the current directory, or that a fully qualified filename is provided.
In This Topic
    ReadFile Method
    In This Topic
    Description
    Read a DICOM file
    Syntax
    Visual Basic
    Public Function ReadFile( _
       ByVal FileName As String _
    ) As DicomImage
    Parameters
    FileName
    The name of the file to read.
    This is passed unmodified to the operating system, and it is therefore the container’s responsibility to ensure either that the file exists within the current directory, or that a fully qualified filename is provided.
    Remarks

    This method can read either official “Part10” format files with the 128 byte header, or unofficial “Part3” format files without a header, and detection of the type is automatic.
    The file may have been written by the WriteFile method or by other DICOM software.
    See ReadDirectory for an alternative method suitable for reading “DICOMDIR” directory files.
    See the security page for details of restrictions on this method.
    By default, pixel data is read only when it is required, greatly speeding the display of multi-frame images, and reducing memory requirements.  However, a side effect of this is that any elements after the pixel data (7FE0,0010) will not be read.  This should not affect most applications, but if necessary, this behaviour made be over-ridden using the DisableFileMapping or DisableQuickRead registry entries.  See the registry entries page for more details.

    Another effect of file mapping is that files read using this method cannot be deleted until the image object is released.  This method creates two references to the newly created DicomImage object (one in the collection, and one as the return value), and both must be released before the file can be deleted.

    See Also