Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cen 13988 add wkt to dicomseg recipe #26

Merged
merged 8 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions wkt_to_dicomseg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# DicomSeg Generation

## Summary
The code snippet in the notebook can be used to convert a WKT representation of
the geometries to a dicomseg file. Note that the script expects the WKT
to be formatted with absolute coordinates. Additionally, any invalid geometries
should be fixed or removed.
You may use the recipes for [coordinate conversion](../coordinate_converter) and
fixing invalid geometries for these steps.

### Installation
No special installation steps required. Follow the virtual environment setup on
[the main repository page](../README.md#installation) and then follow the steps in the notebook.
Binary file added wkt_to_dicomseg/example/input/dicom_image.dcm
Binary file not shown.
14 changes: 14 additions & 0 deletions wkt_to_dicomseg/example/input/wkt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
lyndankwuda marked this conversation as resolved.
Show resolved Hide resolved
{
"intensity": 64,
"wkt": "POLYGON ((572 507, 566 512, 566 518, 557 534, 555 561, 548 579, 542 622, 515 716, 505 772, 494 806, 484 822, 483 855, 488 874, 498 883, 546 887, 571 898, 586 898, 608 889, 624 874, 627 867, 627 845, 621 833, 621 825, 608 786, 608 754, 615 703, 618 645, 642 586, 665 563, 666 546, 664 537, 654 526, 585 507, 572 507))"
},
{
"intensity": 156,
"wkt": "POLYGON ((677 301, 667 308, 642 359, 630 391, 608 420, 578 480, 578 494, 582 505, 636 520, 656 520, 669 516, 681 498, 685 476, 685 447, 691 431, 691 413, 701 385, 733 345, 738 335, 738 325, 731 312, 712 304, 692 305, 677 301))"
},
{
"intensity": 255,
"wkt": "POLYGON ((729 137, 718 143, 712 152, 685 249, 683 265, 676 269, 672 278, 672 290, 676 296, 705 298, 720 307, 733 305, 749 284, 750 265, 744 251, 742 227, 748 218, 748 209, 755 204, 763 185, 761 170, 754 156, 742 142, 729 137))"
}
]
Binary file not shown.
287 changes: 287 additions & 0 deletions wkt_to_dicomseg/main.ipynb

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions wkt_to_dicomseg/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
matplotlib
numpy
Pillow
Shapely
jupyter
ipykernel
pydicom
highdicom