MprVisualizationController Constructor(MprImage,ImageViewer[])
Инициализирует новый экземпляр класса
MprVisualizationController.
Вот 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.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);
}
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5