VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Dicom.Mpr Namespace / MprSlice Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
    MprSlice Class
    In This Topic
    Provides the abstract base class for MPR (multiplanar reconstruction) slices.
    Object Model
    VintasoftPoint3D VintasoftVector3D VintasoftVector3D MprSlice
    Syntax
    'Declaration
    
    Public MustInherit Class MprSlice
    
    
    public abstract class MprSlice
    
    
    public __gc abstract class MprSlice
    
    
    public ref class MprSlice abstract
    
    
    Example

    This C#/VB.NET code shows how to create the coronal and sagittal slices of DICOM MPR image.

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

    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.Dicom.Mpr.MprSlice
          Vintasoft.Imaging.Dicom.Mpr.MprPolylineSlice
          Vintasoft.Imaging.Dicom.Mpr.MprPlanarSlice

    Requirements

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

    See Also