VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.Dicom.Mpr.Wpf.UI Namespace / WpfMprVisualizationController Class / WpfMprVisualizationController Constructor(MprImage,WpfImageViewer[])
Syntax Exceptions Example Requirements SeeAlso
In This Topic
WpfMprVisualizationController Constructor(MprImage,WpfImageViewer[])
In This Topic
Initializes a new instance of the WpfMprVisualizationController class.
Syntax

Parameters

mprImage
The MPR image.
viewers
The viewers.
Exceptions
ExceptionDescription
Thrown if mprImage or viewers is null or empty.
Example

This C#/VB.NET code shows how to display an axial DICOM MPR slice in the first image viewer and build and display the curvlinear DICOM MPR slice, which is based on axial slice, in the second image viewer.


''' <summary>
''' Displays an axial DICOM MPR slice in the first image viewer and
''' builds and displays the curvlinear DICOM MPR slice, which is based on axial slice, in the second image viewer.
''' </summary>
''' <param name="axialViewer">The viewer with axial slice.</param>
''' <param name="curvlinearViewer">The viewer with curvlinear slice.</param>
''' <param name="mprImage">The MPR image.</param>
Public Shared Sub DisplayAxialAndCurvilinearSlicesInTwoViewers(axialViewer As Vintasoft.Imaging.Wpf.UI.WpfImageViewer, curvlinearViewer As Vintasoft.Imaging.Wpf.UI.WpfImageViewer, mprImage As Vintasoft.Imaging.Dicom.Mpr.MprImage)
    ' create the MPR visualization controller
    Dim controller As New Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.WpfMprVisualizationController(mprImage, axialViewer, curvlinearViewer)


    ' create the axial slice
    Dim axialSlice As Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice = mprImage.CreateAxialSlice(mprImage.ZLength / 2.0)
    ' add axial slice to the MPR visualization controller
    controller.AddSliceVisualization(axialSlice, System.Windows.Media.Colors.Yellow)

    ' show the axial slice in axialViewer
    controller.ShowSliceInViewer(axialViewer, axialSlice)


    ' create the curvlinear slice
    Dim curvlinearSlice As Vintasoft.Imaging.Dicom.Mpr.MprCurvilinearSlice = mprImage.CreateCurvilinearSlice(axialSlice, Nothing)
    ' set parameters of curvilinear slice
    curvlinearSlice.RenderingMode = Vintasoft.Imaging.Dicom.Mpr.MprSliceRenderingMode.Avg
    curvlinearSlice.Thickness = 10
    Dim curvlinearSliceVisualizer As New Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.WpfMprSliceVisualizer(curvlinearSlice, System.Windows.Media.Colors.Blue)

    ' get the DICOM MPR tool, which will be used for building the curvilinear slice
    Dim dicomMprTool As Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.VisualTools.WpfDicomMprTool = controller.GetDicomMprToolAssociatedWithImageViewer(axialViewer)
    ' add the curvilinear slice to the visual tool and start building of slice
    dicomMprTool.MprImageTool.AddAndBuildSlice(curvlinearSliceVisualizer)

    ' show the curvlinear slice in curvlinearViewer
    controller.ShowSliceInViewer(curvlinearViewer, curvlinearSlice)
End Sub


/// <summary>
/// Displays an axial DICOM MPR slice in the first image viewer and
/// builds and displays the curvlinear DICOM MPR slice, which is based on axial slice, in the second image viewer.
/// </summary>
/// <param name="axialViewer">The viewer with axial slice.</param>
/// <param name="curvlinearViewer">The viewer with curvlinear slice.</param>
/// <param name="mprImage">The MPR image.</param>
public static void DisplayAxialAndCurvilinearSlicesInTwoViewers(
    Vintasoft.Imaging.Wpf.UI.WpfImageViewer axialViewer,
    Vintasoft.Imaging.Wpf.UI.WpfImageViewer curvlinearViewer,
    Vintasoft.Imaging.Dicom.Mpr.MprImage mprImage)
{
    // create the MPR visualization controller
    Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.WpfMprVisualizationController controller =
        new Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.WpfMprVisualizationController(
        mprImage, axialViewer, curvlinearViewer);


    // create the axial slice
    Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice axialSlice = mprImage.CreateAxialSlice(mprImage.ZLength / 2.0);
    // add axial slice to the MPR visualization controller
    controller.AddSliceVisualization(axialSlice, System.Windows.Media.Colors.Yellow);

    // show the axial slice in axialViewer
    controller.ShowSliceInViewer(axialViewer, axialSlice);


    // create the curvlinear slice
    Vintasoft.Imaging.Dicom.Mpr.MprCurvilinearSlice curvlinearSlice = mprImage.CreateCurvilinearSlice(
        axialSlice, null);
    // set parameters of curvilinear slice
    curvlinearSlice.RenderingMode = Vintasoft.Imaging.Dicom.Mpr.MprSliceRenderingMode.Avg;
    curvlinearSlice.Thickness = 10;
    Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.WpfMprSliceVisualizer curvlinearSliceVisualizer =
        new Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.WpfMprSliceVisualizer(curvlinearSlice, System.Windows.Media.Colors.Blue);

    // get the DICOM MPR tool, which will be used for building the curvilinear slice
    Vintasoft.Imaging.Dicom.Mpr.Wpf.UI.VisualTools.WpfDicomMprTool dicomMprTool =
         controller.GetDicomMprToolAssociatedWithImageViewer(axialViewer);
    // add the curvilinear slice to the visual tool and start building of slice
    dicomMprTool.MprImageTool.AddAndBuildSlice(curvlinearSliceVisualizer);

    // show the curvlinear slice in curvlinearViewer
    controller.ShowSliceInViewer(curvlinearViewer, curvlinearSlice);
}

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also