MemoryMapping in Reading Files

There are two ways to control how DicomObjects reads files in terms of efficiency and RAM usage:

  • Setting DicomGlobal.CloseFilesAfterReading
  • Seting DicomGlobal.SetRegWord("DisableMemoryMapping", VALUE)

If you want DicomObjects to read the entire content of the file so that it loses the file handle and you have total control over the file after reading (you can modify or even delete the file), you set either CloseFilesAfterReading to true or DisableMemoryMapping to 1 (replace VALUE by 1).

If you want DicomObjects to only read the DICOM header and keep the file handle (so that it can access the pixel data whenever it needs to) then you set either CloseFilesAfterReading to false or DisableMemoryMapping to 0.

Please NOTE, in COM version of DicomObjects (there is no CloseFilesAfterReading in COM version) we use MemoryMapping and in .NET version we use delayed stream.

Relevance: