VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
In This Topic
    DICOM: Annotate DICOM images in WPF
    In This Topic
    The annotations may be displayed over the DICOM image in WPF image viewer.


    For each annotation is implemented a class, which defines the way the annotation appearance is displayed and how the user can interact with the annotation:
    The WpfDicomAnnotationTool class allows to display and edit the annotations of DICOM image in WPF image viewer.

    Here is C#/VB.NET code that demonstrates how to display annotations of DICOM file in WPF image viewer:
    // create a DICOM visual tool
    Vintasoft.Imaging.Annotation.Dicom.Wpf.UI.VisualTools.WpfDicomAnnotationTool annotationTool = 
        new Vintasoft.Imaging.Annotation.Dicom.Wpf.UI.VisualTools.WpfDicomAnnotationTool();
    // set the DICOM visual tool as active visual tool in image viewer
    viewer.VisualTool = annotationTool;
    
    // load a presentation state file
    Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile presentationStateFile = 
        new Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(presentationStateFilePath);
    // add DICOM annotations from the presentation state file to the DICOM visual tool
    annotationTool.AnnotationDataController.AddAnnotationDataSet(presentationStateFile.Annotations);
    
    // load a DICOM file in the image viewer
    viewer.Images.Add(dicomFilePath);
    
    ' create a DICOM visual tool
    Dim annotationTool As New Vintasoft.Imaging.Annotation.Dicom.Wpf.UI.VisualTools.WpfDicomAnnotationTool()
    ' set the DICOM visual tool as active visual tool in image viewer
    viewer.VisualTool = annotationTool
    
    ' load a presentation state file
    Dim presentationStateFile As New Vintasoft.Imaging.Codecs.ImageFiles.Dicom.DicomFile(presentationStateFilePath)
    ' add DICOM annotations from the presentation state file to the DICOM visual tool
    annotationTool.AnnotationDataController.AddAnnotationDataSet(presentationStateFile.Annotations)
    
    ' load a DICOM file in the image viewer
    viewer.Images.Add(dicomFilePath)