DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage Class / ImageToWorld(PointF,DicomViewer) Method
location being calculated in image pixel coordinates
The Viewer being used for display
Example

In This Topic
    ImageToWorld(PointF,DicomViewer) Method
    In This Topic
    Calculate the real-world 3D coordinates of a point of the image currently displayed
    Syntax
    'Declaration
     
    
    Public Overridable Function ImageToWorld( _
       ByVal ImageLocation As System.Drawing.PointF, _
       Optional ByVal Viewer As DicomViewer _
    ) As System.Nullable(Of Point3D)
    public virtual System.Nullable<Point3D> ImageToWorld( 
       System.Drawing.PointF ImageLocation,
       DicomViewer Viewer
    )

    Parameters

    ImageLocation
    location being calculated in image pixel coordinates
    Viewer
    The Viewer being used for display

    Return Value

    Note the use of image pixel coordinates, so you may wish to use DicomViewer.ImagePosition first.
    Example
    DicomImage image = new DicomImage("your_dicom_image.dcm");
    Viewer.Images.Add(image); // Assumes an existing DicomViewer obj
    PointF imagePoint = new PointF(100, 150); 
    Point3D? worldPoint = image.ImageToWorld(imagePoint, Viewer);  // Example Result: {-35.184584228799,-5.04158664136641,-55.2712978166006}
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also