VintaSoft Imaging .NET SDK 14.0: Documentation for .NET developer
Vintasoft.Imaging.Dicom.Mpr.UI Namespace / MprVisualizationController Class / MprVisualizationController Constructor(MprImage,ImageViewer[])
Syntax Exceptions Example Requirements SeeAlso
In This Topic
    MprVisualizationController Constructor(MprImage,ImageViewer[])
    In This Topic
    Initializes a new instance of the MprVisualizationController class.
    Syntax
    'Declaration
    
    Public Function New( _
    ByVal mprImage
    The MPR image.
    As Vintasoft.Imaging.Dicom.Mpr.MprImage, _
    ByVal ParamArray viewers
    The viewers.
    () As Vintasoft.Imaging.UI.ImageViewer _
    )

    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.UI.ImageViewer, curvlinearViewer As Vintasoft.Imaging.UI.ImageViewer, mprImage As Vintasoft.Imaging.Dicom.Mpr.MprImage)
        ' create the MPR visualization controller
        Dim controller As New Vintasoft.Imaging.Dicom.Mpr.UI.MprVisualizationController(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.Drawing.Color.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.UI.MprSliceVisualizer(curvlinearSlice, System.Drawing.Color.Blue)
    
        ' get the DICOM MPR tool, which will be used for building the curvilinear slice
        Dim dicomMprTool As Vintasoft.Imaging.Dicom.Mpr.UI.VisualTools.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)
    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.UI.ImageViewer axialViewer,
        Vintasoft.Imaging.UI.ImageViewer curvlinearViewer,
        Vintasoft.Imaging.Dicom.Mpr.MprImage mprImage)
    {
        // create the MPR visualization controller
        Vintasoft.Imaging.Dicom.Mpr.UI.MprVisualizationController controller =
            new Vintasoft.Imaging.Dicom.Mpr.UI.MprVisualizationController(
            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.Drawing.Color.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.UI.MprSliceVisualizer curvlinearSliceVisualizer =
            new Vintasoft.Imaging.Dicom.Mpr.UI.MprSliceVisualizer(curvlinearSlice, System.Drawing.Color.Blue);
    
        // get the DICOM MPR tool, which will be used for building the curvilinear slice
        Vintasoft.Imaging.Dicom.Mpr.UI.VisualTools.DicomMprTool 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: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also