Object/Memory Management of DicomImage and DicomDataSet


The following diagram shows the relationship between DicomImage and DicomDataSet objects.



DicomImage object

DicomImage contains DicomDataSet which holds the pixel data.

DicomImage.Dispose() method does not need to be called explicitly as it will get cleaned up eventually via a finaliser when called from the Garbage Collector.

The following objects are cleared when DicomImage object is disposed:


DicomDataSet object

DicomDataSet object contains all DICOM attributes, including pixel data. It also contains the Textures when in DirectX mode.

DicomDataSet.Dispose() method does not need to be called explicitly as it will get cleaned up eventually via a finaliser when called from the Garbage Collector.

The following objects are cleared when DicomDataSet object is disposed:

Note

disposing DicomImage object does not necessarily dispose the DicomDataSet object the image contains, as the above diagram shows it is possible to construct 2 DicomImage objects that share the same DicomDataSet object. To clean things up more predictably, it is best to call Dispose on both the DicomImage and the DicomDataset (assuming that no other images are using the dataset) in either order.

Unmanaged Resources

There are a few unmanaged resources being used:


We use cookies to give you the best possible experience on our website. By continuing to use this website, you agree with our use of cookies. for more information please click HERE