Problem in Point Orientation

Dear all,
I got a dataset from VerSeg challenge. It has json files that describes center points of vertebral bodies in a 3D image. here is what ir says:

The centroid annotations are with respect to the coordinate axis fixed on a (P, I, R) or (A, S, L) orientation, described as:
1. Origin at Superior (S) - Right (R) - Anterior (A)
2. ‘X’ corresponds to S → I direction
3. ‘Y’ corresponds to A → P direction
4. ‘Z’ corresponds to R → L direction

I tried to visualize L4 centroid in Slicer by adding a fiducial and add the values from the json fil but the point looks far away

fiducials
L4

How can I change the orientation of L4 correctly to be something like L4s (L4s is located by me)
Here are the files:
json file: https://drive.google.com/file/d/1vu-YW68CrkIuRQPwAxNsRUl-Ja6NzfSP/view
image: https://drive.google.com/file/d/1nDn_2S_HoqqPcMR_M8ixyv2O4j0huHkh/view

This code snippets sets markup fiducial points positions correctly:

import json
data = json.load(open("verse063_ctd.json", 'r'))
bounds = [0,0,0,0,0,0]
slicer.mrmlScene.GetFirstNodeByClass("vtkMRMLSegmentationNode").GetBounds(bounds)
markupsNode=slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsFiducialNode")
for point in data:
    markupsNode.AddControlPointWorld(vtk.vtkVector3d(bounds[0]+point["Z"], bounds[2]+point["Y"], bounds[4]+point["X"]), "Label: {0}".format(point["label"]))

From this, it is quite clear that the json file is not optimal, because:

  1. You can only interpret in with respect to another file. Instead, the file should contain physical coordinates (the origin of the input image included).
  2. Coordinate system axes direcrtions are S, A, R, while in DICOM (and therefore all other files derived from them), anatomical coordinate axis directions are L, P, S (order should be inverted and directions of first two axes should be inverted)
1 Like

Thanks, @lassoan for your quick reply.

You can only interpret in with respect to another file. Instead, the file should contain physical coordinates (the origin of the input image included).

The files come with images here is the one from this segmentation

https://drive.google.com/file/d/1J4p6CWSczylnsfjwS-fV0VXOrAaFC31i/view

Here is the result of your script.
andras

The points are now close to the vertebrae but not in the center. How can I involve the origin correctly?

You could probably tune the code snippet above to get the correct results, but it would be just a workaround. Instead, I would recommend to ask developers of the software to put save physical coordinates in LPS coordinate system.

1 Like