DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / BurnAnnotations Method
Frames to burn labels into
Example

In This Topic
    BurnAnnotations Method
    In This Topic
    Burn all image Labels in Pixel data.

    This method modifies the underlying pixel data!

    Syntax
    'Declaration
     
    
    Public Sub BurnAnnotations( _
       ByVal ParamArray FrameNumbers() As System.Integer _
    ) 
    public void BurnAnnotations( 
       params System.int[] FrameNumbers
    )

    Parameters

    FrameNumbers
    Frames to burn labels into
    Remarks
    If no frame number is specified, all frames are selected by default
    Example
    // This example assumes multiframe image with >= 9 frames
    DicomImage image = new DicomImage("path_to_your_dicom_image.dcm");
                        
    // Example rectangle 
    var newRectLabel = new DicomLabel
    {
        LabelType = LabelType.Rectangle,
        Area = new RectangleF(50, 50, 300, 300),
        ScaleMode = ScaleMode.Image
    };
                        
    // Adding rectangle to specified frame
    newRectLabel.FrameList.Add(1);
    newRectLabel.FrameList.Add(3);
    newRectLabel.FrameList.Add(6);
    newRectLabel.FrameList.Add(9);
                        
    // Add labels to image
    image.Labels.Add(newRectLabel);
                        
    image.BurnAnnotations();
    image.Write("path_to_save_location_image.dcm");
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also