DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage3D Class / PixelToWorld Method
Example

In This Topic
    PixelToWorld Method (DicomImage3D)
    In This Topic
    Calculate the real world location of a point displayed on a 3D image
    Syntax
    'Declaration
     
    
    Public Function PixelToWorld( _
       ByVal Point As System.Drawing.PointF, _
       ByVal DisplaySize As System.Drawing.Size _
    ) As System.Windows.Media.Media3D.Point3D
    public System.Windows.Media.Media3D.Point3D PixelToWorld( 
       System.Drawing.PointF Point,
       System.Drawing.Size DisplaySize
    )

    Parameters

    Point
    DisplaySize
    Remarks

    This method is suitable for MPR and Slab images, and whilst it will provide a value for "projectional" MIP and VR images the point will be on the "central plane" of that view, and is not really localised to a single point in space.

    Example
    DicomImage image = new DicomImage("your_3D_dicom_image.dcm");
    DicomVolume volume = new DicomVolume(image);
                         
    RenderMode3D renderMode = RenderMode3D.VR;
    DicomImage3D image3D = new DicomImage3D(volume, renderMode);   
                
    Size displaySize = new Size(image3D.Size.Width, image3D.Size.Height);
    PointF pixelLocation = new PointF(displaySize.Width / 2, displaySize.Height / 2);
    Point3D worldPoint = image3D.PixelToWorld(pixelLocation, displaySize);        
                 
    Viewer.Images.Add(image3D);
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also