DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / WorldToImage(Point3D,DicomViewer,Int32) Method
The point in real world coordinates
The Viewer being used for display
The frame to apply this calculation to
Example

In This Topic
    WorldToImage(Point3D,DicomViewer,Int32) Method
    In This Topic
    Calculate the nearest image coordinates for a point in real world (X,Y,Z) space,
    Syntax
    'Declaration
     
    
    Public Function WorldToImage( _
       ByVal WorldLocation As System.Windows.Media.Media3D.Point3D, _
       ByVal Viewer As DicomViewer, _
       ByVal Frame As System.Integer _
    ) As System.Drawing.PointF
    public System.Drawing.PointF WorldToImage( 
       System.Windows.Media.Media3D.Point3D WorldLocation,
       DicomViewer Viewer,
       System.int Frame
    )

    Parameters

    WorldLocation
    The point in real world coordinates
    Viewer
    The Viewer being used for display
    Frame
    The frame to apply this calculation to

    Return Value

    Image coordinates of the closest point of the image plane
    Example
    DicomImage image = new DicomImage("your_dicom_image.dcm");
    Point3D point3D = new Point3D(150, 200, 0);
    int frame = 1;
    PointF imagePoint = image.WorldToImage(point3D, Viewer, frame);  // Example value: {X = 475.292419 Y = 548.391846}
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also