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
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:
You can only interpret in with respect to another file. Instead, the file should contain physical coordinates (the origin of the input image included).
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)
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
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.