How to determine RAS coordinates by voxel position

Throughout the scene, the center point of each voxel has a corresponding RAS coordinate, and I can place a marker point anywhere to see the RAS coordinates of that location.
Now I have a requirement, and I want to loop to find out the location of the maximum CT value in the current 2D view and display its RAS coordinates.
For example, in the following picture, I found this voxel position, and I need to calculate its approximate RAS coordinates, and the error is permissible, because this voxel is not a point, but a very small rectangular region.
Relative to the whole matrix, its position is (346,235,136), and I need to get its approximate RAS coordinates, which can be the coordinates of any point in the whole voxel, or its central coordinates.

You can look at the code of the DataProbe module, and also this example should help:

1 Like