Comments (2)
Please see my comment from the dicompyler-core issue you posted, the formats are different. overlap_volume
needs a "sets of points" format
I might be easier to write a function to convert dicompyler-core structure coordinates into Shapely objects. Then use Shapely's geometric operations to get intersections. The DVHA code can provide some good inspiration for that.
That said, I haven't tried the following, but seems like it should work. You can use a couple functions already written to get what you need I think.
DVH-Analytics/dvha/tools/roi_formatter.py
Lines 201 to 223 in b0be703
DVH-Analytics/dvha/tools/roi_formatter.py
Lines 38 to 71 in b0be703
from dvh-analytics.
That works! Leaving this working example below in case anyone else wants to try it.
from dicompylercore import dicomparser, dvh, dvhcalc
from dvha.tools.roi_geometry import overlap_volume
from dvha.tools.roi_formatter import dicompyler_roi_coord_to_db_string, get_planes_from_string
dp = dicomparser.DicomParser("RT-STRUCT.dcm") #parse RTStruct dicom
# i.e. Get a dict of structure information
structures = dp.GetStructures() #can use this structures dict to find structure indices
#extract gtv and format for dvha (with this specific rt-struct file 16 is the gtv index)
gtv_coords=dp.GetStructureCoordinates(16)
gtv_coords_str=dicompyler_roi_coord_to_db_string(gtv_coords)
gtv_planes=get_planes_from_string(gtv_coords_str)
#do the same for ptv (with this specific rt-struct file 18 is the ptv index)
ptv_coords=dp.GetStructureCoordinates(18)
ptv_coords_str=dicompyler_roi_coord_to_db_string(ptv_coords)
ptv_planes=get_planes_from_string(ptv_coords_str)
v=overlap_volume(ptv_planes, gtv_planes)
from dvh-analytics.
Related Issues (20)
- Suport structure DVH to long time to calculate HOT 5
- Slow Performance when using ROI MAP HOT 12
- Empty PixelData tag causes dicompyler-core crash HOT 1
- PTV distance calcs skipped if RTROIInterpretedType is empty HOT 1
- DTH not sampled uniformly HOT 2
- importing DICOM files problems HOT 19
- Crash due to Pango conflict on GTK / Linux HOT 18
- wxAssertionError while using python 3.8.5 and wxpython 4.1.1 HOT 1
- "You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale. Things are going to break, please only change locale by creating wxLocale objects to avoid this!" HOT 4
- Moving a Contour and then assigning to RT-Struct HOT 12
- Is it possible to add an extra contour from a 'set of points' dict to a parsed rtss object? HOT 1
- Possible issue with the sort call in get_shapely_from_sets_of_point function HOT 2
- Building wheel for wxPython (setup.py) ... error HOT 10
- Posible Memory leaek HOT 5
- Regressors fails when collecting regressors HOT 5
- Database merging functionality
- Array must not contain infs or nones HOT 1
- wxLocale on Windows
- DVHA is being archived
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dvh-analytics.