Search code examples
overlaydicomclearcanvas

ClearCanvas DICOM Library - How to use Overlay Planes?


NOTE:: This may be a better question to answer:: Free DICOM files, with Multiple Overlays

Hi, I have a question relating to tag DicomTags.OverlayData & Overlay Planes.

As of now I can get back overlay data from a DICOM file in ClearCanvas and uncompress & display it using:

var overlayData = dicomFile.DataSet[DicomTags.OverlayData];

I also use other tags in the DICOM file for Overlays such as, OverlayOrigin, OverlayColumns, OverlayRows etc...

So my question is, how do OverlayPlanes come into play here? All these Overlay tags seem to be global & not grouped in a OverlayPlane tag or something.

Is plane data layered in the OverlayData tag?? I'm new to DICOM & a little confused about this.


Solution

  • The ClearCanvas DICOM assembly has several helper IOD classes that make it a bit easier to access specific modules within a DICOM Message. The OverlayPlaneModuleIod class is one such IOD class that make it easier to access all of the tags together within an overlay plane. The following code shows an example of how to use this class to check and access an each of the potential overlay planes, without having to worry about the various tags involved:

    
    DicomFile theFile = new DicomFile("filename.dcm");
    theFile.Load();
    
    OverlayPlaneModuleIod iod = new OverlayPlaneModuleIod(theFile.DataSet);
    for (int i = 0; i < 16; i++)
    {
        if (iod.HasOverlayPlane(i))
        {
            OverlayPlane overlay = iod[i];
            byte[] overlayData = overlay.OverlayData;
            string description = overlay.OverlayDescription;
        }
    }