Skip to content

centroid to physical coordinates #67

@longchingkwok331

Description

@longchingkwok331

Hi, I am doing lung nodule predictions on the LIDC-IDRI-0069 sample, and I got the center and the size of the nodule detection to be
"center": [-59.54512023925781, 84.96267700195313, 1369.8218994140625],
"orientation": [-1.0, -0.0, -0.0, -0.0, -1.0, -0.0, 0.0, 0.0, 1.0],
"size": [9.868255615234377, 10.00336456298828, 19.705078125],

I am pretty sure that this lung nodule location corresponds to the first annotation, which is the one available if I run

pid = 'LIDC-IDRI-0069'
annotations = pl.query(pl.Annotation).filter(pl.Scan.patient_id == pid).first()
print("centre>>", annotations.centroid) => [169.19642857, 360.81122449, 46.20153061]
If I convert back to the real-world coordinate:
The following is the metadata
Spacing: [0.741, 0.741, 2.0] (in millimeters)
Origin (RAS): [184.3750, 188.2812, 1288.5]
169 * 0.741-184 = -58,
360 * 0.741-188=78,
46 * 2 + 1288.5 = 1380.5

This actually very much matches the coordinates provided by my prediction, however, I am adding the origin z value while I am minusing the origin x, y value in order to reproduce the value I predicted
This is not consistent, may I know is this formula correct?

I try to check on the second and third lungs nodules in the sample to cross check but I didn't find a way to get the second and third lung nodule annotations. I use this method from poe to get the second lung nodule but It doesn't seem right

pid = 'LIDC-IDRI-0069'
scan = pl.query(pl.Scan).filter(pl.Scan.patient_id == pid).first()
Query annotations for that specific scan
annotations = pl.query(pl.Annotation).filter(pl.Annotation.scan_id == scan.id).all()
second_annotation = annotations[1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions