Closed Kiragroh closed 3 years ago
This is a surprisingly complicated topic, both from database design and clinical perspectives. To be brief, I think what makes the most sense, given the database design, is to add two columns to the DVHs table: centroid_dist_to_iso_min
and centroid_dist_to_iso_max
. For single isocenter plans, these will have the same value, but if they differ, you know you have multiple isocenters.
I still haven't figured out how to implement the PTV DTH data in the GUI, but I'd argue an ROI-to-Iso DTH is probably the best way to capture this information.
It is a fairly quick thing for me to do (especially since both isocenter and ROI centroid are already captured), but maybe not so easy to figure out for others. So I can use this opportunity as a way to document how to add a new column for the power users out there. I'll try to do that in one concise commit.
The first referenced commit just adds some safe guards incase DVHA is using an older database that doesn't have all of the same columns.
The second commit should serve as a good example of how to add a new column.
Note that I have separate .sql
scripts for Postgres and SQLite. Also note that I don't know how to add a new column to SQLite, so you'll have to start from a new database. I did a quick search of how to add a new column in SQLite, but it looks just as complicated as last time I checked. To be frank, I'm not interested in figuring that out. I'm afraid I'll implement something that doesn't work for all users, so I'd rather not even try to support it.
Also, I slightly modified the centroid property to return an array, and moved the csv processing, so I didn't have to unnecessarily parse the centroid from a string.
Wow. That works immediately out of the box. And thanks for the commit. It is easy to understand
Hmmm... did I get my units right? That might be in mm?
Almost certainly... I forgot to convert. DICOM coordinates are in mm.
Yes you are right. I only looked at the values
in version v0.9.2
Would be cool to have this metric for a cohort of non-isocentric targets. Maybe it is a quick thing for you. Otherwise, I will add it myself next week. I will post my solution if it works.