В этом разделе
Предоставляет абстрактный базовый класс для срезов MPR (многоплоскостная реконструкция).
Объектная модель
Синтаксис
'Declaration
Public MustInherit Class MprSlice
public abstract class MprSlice
public __gc abstract class MprSlice
public ref class MprSlice abstract
Пример
Вот C#/VB.NET код, который демонстрирует, как создать коронарный и сагиттальный срезы изображения DICOM MPR.
''' <summary>
''' Creates the coronal and sagittal slices for MPR image.
''' </summary>
''' <param name="mprImage">The MPR image.</param>
''' <param name="coronalSlice">The coronal slice.</param>
''' <param name="sagittalSlice">The sagittal slice.</param>
Public Shared Sub CreateCoronalAndSagittalSlices(mprImage As Vintasoft.Imaging.Dicom.Mpr.MprImage, ByRef coronalSlice As Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice, ByRef sagittalSlice As Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice)
' calculate the MPR image center
Dim mprImageCenter As New Vintasoft.Imaging.VintasoftPoint3D(mprImage.XLength / 2.0, mprImage.YLength / 2.0, mprImage.ZLength / 2.0)
' the coronal slice location
Dim coronalSliceLocation As New Vintasoft.Imaging.VintasoftPoint3D(0, mprImageCenter.Y, mprImage.ZLength)
' the horizontal axis for the coronal slice
Dim coronalSliceXAxis As Vintasoft.Imaging.VintasoftVector3D = Vintasoft.Imaging.VintasoftVector3D.XAxis
' the vertical axis for the coronal slice
' (invert vertical axis because Y-axis in screen coordinate system is going from top to bottom and
' Z-axis in DICOM coordinate system is going from bottom to top)
Dim coronalSliceYAxis As Vintasoft.Imaging.VintasoftVector3D = -Vintasoft.Imaging.VintasoftVector3D.ZAxis
' create the coronal slice
coronalSlice = New Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice(coronalSliceLocation, coronalSliceXAxis, coronalSliceYAxis, mprImage.XLength, mprImage.ZLength)
' the sagittal slice location
Dim sagittalSliceLocation As New Vintasoft.Imaging.VintasoftPoint3D(mprImageCenter.X, 0, mprImage.ZLength)
' the horizontal axis for the sagittal slice
Dim sagittalSliceXAxis As Vintasoft.Imaging.VintasoftVector3D = Vintasoft.Imaging.VintasoftVector3D.YAxis
' the vertical axis for the sagittal slice
' (invert vertical axis because Y-axis in screen coordinate system is going from top to bottom and
' Z-axis in DICOM coordinate system is going from bottom to top)
Dim sagittalSliceYAxis As Vintasoft.Imaging.VintasoftVector3D = -Vintasoft.Imaging.VintasoftVector3D.ZAxis
' create the sagittal slice
sagittalSlice = New Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice(sagittalSliceLocation, sagittalSliceXAxis, sagittalSliceYAxis, mprImage.YLength, mprImage.ZLength)
End Sub
/// <summary>
/// Creates the coronal and sagittal slices for MPR image.
/// </summary>
/// <param name="mprImage">The MPR image.</param>
/// <param name="coronalSlice">The coronal slice.</param>
/// <param name="sagittalSlice">The sagittal slice.</param>
public static void CreateCoronalAndSagittalSlices(
Vintasoft.Imaging.Dicom.Mpr.MprImage mprImage,
out Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice coronalSlice,
out Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice sagittalSlice)
{
// calculate the MPR image center
Vintasoft.Imaging.VintasoftPoint3D mprImageCenter =
new Vintasoft.Imaging.VintasoftPoint3D(
mprImage.XLength / 2.0,
mprImage.YLength / 2.0,
mprImage.ZLength / 2.0);
// the coronal slice location
Vintasoft.Imaging.VintasoftPoint3D coronalSliceLocation =
new Vintasoft.Imaging.VintasoftPoint3D(0, mprImageCenter.Y, mprImage.ZLength);
// the horizontal axis for the coronal slice
Vintasoft.Imaging.VintasoftVector3D coronalSliceXAxis = Vintasoft.Imaging.VintasoftVector3D.XAxis;
// the vertical axis for the coronal slice
// (invert vertical axis because Y-axis in screen coordinate system is going from top to bottom and
// Z-axis in DICOM coordinate system is going from bottom to top)
Vintasoft.Imaging.VintasoftVector3D coronalSliceYAxis = -Vintasoft.Imaging.VintasoftVector3D.ZAxis;
// create the coronal slice
coronalSlice = new Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice(
coronalSliceLocation, coronalSliceXAxis, coronalSliceYAxis,
mprImage.XLength, mprImage.ZLength);
// the sagittal slice location
Vintasoft.Imaging.VintasoftPoint3D sagittalSliceLocation =
new Vintasoft.Imaging.VintasoftPoint3D(mprImageCenter.X, 0, mprImage.ZLength);
// the horizontal axis for the sagittal slice
Vintasoft.Imaging.VintasoftVector3D sagittalSliceXAxis =
Vintasoft.Imaging.VintasoftVector3D.YAxis;
// the vertical axis for the sagittal slice
// (invert vertical axis because Y-axis in screen coordinate system is going from top to bottom and
// Z-axis in DICOM coordinate system is going from bottom to top)
Vintasoft.Imaging.VintasoftVector3D sagittalSliceYAxis = -Vintasoft.Imaging.VintasoftVector3D.ZAxis;
// create the sagittal slice
sagittalSlice = new Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice(
sagittalSliceLocation, sagittalSliceXAxis, sagittalSliceYAxis,
mprImage.YLength, mprImage.ZLength);
}
Иерархия наследования
Требования
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5
Смотрите также