VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
Vintasoft.Imaging.Dicom.Mpr.Wpf.UI Namespace / WpfMprVisualizationController Class / WpfMprVisualizationController Constructor(MprImage,WpfImageViewer[])
Синтаксис Exceptions Example Требования Смотрите также
В этом разделе
WpfMprVisualizationController Constructor(MprImage,WpfImageViewer[])
В этом разделе
Инициализирует новый экземпляр класса WpfMprVisualizationController.
Синтаксис
'Declaration

Public Function New( _
ByVal mprImage
Изображение MPR.
As Vintasoft.Imaging.Dicom.Mpr.MprImage, _
ByVal ParamArray viewers
Средства просмотра.
() As Vintasoft.Imaging.Wpf.UI.WpfImageViewer _
)

Parameters

mprImage
Изображение MPR.
viewers
Средства просмотра.
Исключения
ИсключениеОписание
Выбрасывается, если mprImage или viewers равны null или пусты.
Пример

Вот C#/VB.NET код, который демонстрирует, как отобразить аксиальный срез DICOM MPR в первом средстве просмотра изображений и построить и отобразить криволинейный срез DICOM MPR, основанный на аксиальном срезе, во втором средстве просмотра изображений.


''' <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);
}

Требования

Целевые платформы: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

Смотрите также