rt-utils 1.2.7__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {rt-utils-1.2.7 → rt_utils-1.4.0}/LICENSE +21 -21
  2. rt_utils-1.4.0/MANIFEST.in +10 -0
  3. {rt-utils-1.2.7/rt_utils.egg-info → rt_utils-1.4.0}/PKG-INFO +241 -160
  4. rt-utils-1.2.7/PKG-INFO → rt_utils-1.4.0/README.md +196 -160
  5. rt_utils-1.4.0/RELEASING.md +59 -0
  6. rt_utils-1.4.0/pyproject.toml +64 -0
  7. rt_utils-1.4.0/rt_utils/__init__.py +6 -0
  8. rt_utils-1.4.0/rt_utils/_version.py +3 -0
  9. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils/ds_helper.py +234 -219
  10. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils/image_helper.py +430 -306
  11. rt_utils-1.4.0/rt_utils/nifti2rt.py +21 -0
  12. rt_utils-1.4.0/rt_utils/rtstruct.py +194 -0
  13. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils/rtstruct_builder.py +89 -87
  14. rt_utils-1.4.0/rt_utils/rtstruct_merger.py +33 -0
  15. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils/utils.py +137 -127
  16. rt-utils-1.2.7/README.md → rt_utils-1.4.0/rt_utils.egg-info/PKG-INFO +241 -127
  17. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils.egg-info/SOURCES.txt +7 -7
  18. rt_utils-1.4.0/rt_utils.egg-info/requires.txt +12 -0
  19. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils.egg-info/top_level.txt +0 -1
  20. {rt-utils-1.2.7 → rt_utils-1.4.0}/setup.cfg +4 -4
  21. rt-utils-1.2.7/rt_utils/__init__.py +0 -2
  22. rt-utils-1.2.7/rt_utils/rtstruct.py +0 -142
  23. rt-utils-1.2.7/rt_utils.egg-info/requires.txt +0 -4
  24. rt-utils-1.2.7/setup.py +0 -45
  25. rt-utils-1.2.7/tests/__init__.py +0 -1
  26. rt-utils-1.2.7/tests/conftest.py +0 -46
  27. rt-utils-1.2.7/tests/test_ds_helper.py +0 -28
  28. rt-utils-1.2.7/tests/test_rtstruct_builder.py +0 -253
  29. rt-utils-1.2.7/tests/test_utils.py +0 -53
  30. {rt-utils-1.2.7 → rt_utils-1.4.0}/rt_utils.egg-info/dependency_links.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Qurit
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Qurit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,10 @@
1
+ include LICENSE
2
+ include README.md
3
+ include RELEASING.md
4
+
5
+ prune tests
6
+ prune Paper
7
+ prune src
8
+ exclude NIFTI_conversion.py
9
+ exclude nifti2rt.py
10
+ exclude RTUTILS_read_world_example_for_PET.ipynb
@@ -1,160 +1,241 @@
1
- Metadata-Version: 2.1
2
- Name: rt-utils
3
- Version: 1.2.7
4
- Summary: A small library for handling masks and RT-Structs
5
- Home-page: https://github.com/qurit/rtutils
6
- Author: Asim Shrestha
7
- Author-email: asim.shrestha@hotmail.com
8
- Keywords: RTStruct,Dicom,Pydicom
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Programming Language :: Python
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3 :: Only
13
- Classifier: Programming Language :: Python :: 3.6
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Typing :: Typed
20
- Classifier: License :: OSI Approved :: MIT License
21
- Classifier: Topic :: Software Development :: Libraries
22
- Classifier: Topic :: Utilities
23
- Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
24
- Classifier: Topic :: Scientific/Engineering :: Image Processing
25
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
- Classifier: Topic :: Scientific/Engineering :: Physics
27
- Classifier: Intended Audience :: Healthcare Industry
28
- Classifier: Intended Audience :: Science/Research
29
- Classifier: Intended Audience :: Developers
30
- Requires-Python: >=3.6
31
- Description-Content-Type: text/markdown
32
- License-File: LICENSE
33
-
34
- <p align="center">
35
- <img src="https://raw.githubusercontent.com/qurit/rt-utils/main/src/rt-utils-logo.png" height="300"/>
36
- </p>
37
- <p align="center">
38
- <em>A minimal Python library for RT Struct manipulation</em>
39
- </p>
40
- <p align="center">
41
- <img src="https://github.com/qurit/rt-utils/workflows/Python%20application/badge.svg" height="18">
42
- <img src="https://img.shields.io/pypi/pyversions/rt-utils" alt="Python version" height="18">
43
- <a href="https://pypi.org/project/rt-utils"><img src="https://badge.fury.io/py/rt-utils.svg" alt="PyPI version" height="18"></a>
44
- <img alt="PyPI - License" src="https://img.shields.io/github/license/qurit/rt-utils?color=g" height="18" />
45
- </p>
46
-
47
- ---
48
-
49
- RT-Utils is motivated to allow physicians and other users to view the results of segmentation performed on a series of DICOM images. RT-Utils allows you to create or load RT Structs, extract 3d masks from RT Struct ROIs, easily add one or more regions of interest, and save the resulting RT Struct in just a few lines!
50
-
51
- ## How it works
52
- RT-Utils provides a builder class to faciliate the creation and loading of an RT Struct. From there, you can add ROIs through binary masks and optionally input the colour of the region along with the region name.
53
-
54
- The format for the ROI mask is an nd numpy array of type bool. It is an array of 2d binary masks, one plane for each slice location within the DICOM series. The slices should be sorted in ascending order within the mask. Through these masks, we extract the contours of the regions of interest and place them within the RT Struct file. Note that there is currently only support for the use of one frame of reference UID and structered set ROI sequence. Also note that holes within the ROI may be handled poorly.
55
-
56
- ## Installation
57
- ```
58
- pip install rt_utils
59
- ```
60
-
61
- ## Creating new RT Structs
62
- ```Python
63
- from rt_utils import RTStructBuilder
64
-
65
- # Create new RT Struct. Requires the DICOM series path for the RT Struct.
66
- rtstruct = RTStructBuilder.create_new(dicom_series_path="./testlocation")
67
-
68
- # ...
69
- # Create mask through means such as ML
70
- # ...
71
-
72
- # Add the 3D mask as an ROI.
73
- # The colour, description, and name will be auto generated
74
- rtstruct.add_roi(mask=MASK_FROM_ML_MODEL)
75
-
76
- # Add another ROI, this time setting the color, description, and name
77
- rtstruct.add_roi(
78
- mask=MASK_FROM_ML_MODEL,
79
- color=[255, 0, 255],
80
- name="RT-Utils ROI!"
81
- )
82
-
83
- rtstruct.save('new-rt-struct')
84
- ```
85
-
86
- ## Adding to existing RT Structs
87
- ```Python
88
- from rt_utils import RTStructBuilder
89
- import matplotlib.pyplot as plt
90
-
91
- # Load existing RT Struct. Requires the series path and existing RT Struct path
92
- rtstruct = RTStructBuilder.create_from(
93
- dicom_series_path="./testlocation",
94
- rt_struct_path="./testlocation/rt-struct.dcm"
95
- )
96
-
97
- # Add ROI. This is the same as the above example.
98
- rtstruct.add_roi(
99
- mask=MASK_FROM_ML_MODEL,
100
- color=[255, 0, 255],
101
- name="RT-Utils ROI!"
102
- )
103
-
104
- rtstruct.save('new-rt-struct')
105
- ```
106
-
107
- ## Creation Results
108
- <p align="center">
109
- <img src="https://raw.githubusercontent.com/qurit/rt-utils/main/src/contour.png" width="1000"/>
110
- </p>
111
- <p align="center">
112
- The results of a generated ROI with a dummy mask, as viewed in Slicer.
113
- </p>
114
-
115
- <p align="center">
116
- <img src="https://raw.githubusercontent.com/qurit/RT-Utils/main/src/liver-contour.png" width="1000"/>
117
- </p>
118
- <p align="center">
119
- The results of a generated ROI with a liver segmentation model, as viewed in Slicer. (Note the underlying patient data has been hidden)
120
- </p>
121
-
122
- ## Loading an existing RT Struct contour as a mask
123
- ```Python
124
- from rt_utils import RTStructBuilder
125
- import matplotlib.pyplot as plt
126
-
127
- # Load existing RT Struct. Requires the series path and existing RT Struct path
128
- rtstruct = RTStructBuilder.create_from(
129
- dicom_series_path="./testlocation",
130
- rt_struct_path="./testlocation/rt-struct.dcm"
131
- )
132
-
133
- # View all of the ROI names from within the image
134
- print(rtstruct.get_roi_names())
135
-
136
- # Loading the 3D Mask from within the RT Struct
137
- mask_3d = rtstruct.get_roi_mask_by_name("ROI NAME")
138
-
139
- # Display one slice of the region
140
- first_mask_slice = mask_3d[:, :, 0]
141
- plt.imshow(first_mask_slice)
142
- plt.show()
143
- ```
144
-
145
- ## Loading Results
146
- <p align="center">
147
- <img src="https://raw.githubusercontent.com/qurit/rt-utils/main/src/loaded-mask.png" height="300"/>
148
- </p>
149
- <p align="center">
150
- The results of a loading an exisiting ROI as a mask, as viewed in Python.
151
- </p>
152
-
153
- ## Additional Parameters
154
- The add_roi method of our RTStruct class has a multitude of optional parameters available. Below is a comprehensive list of all these parameters and what they do.
155
- - <b>color</b>: This parameter can either be a colour string such as '#ffffff' or a RGB value as a list such as '[255, 255, 255]'. This parameter will dictate the colour of your ROI when viewed in a viewing program. If no colour is provided, RT Utils will pick from our internal colour palette based on the ROI Number of the ROI.
156
- - <b>name</b>: A str value that defaults to none. Used to set the name of the ROI within the RT Struct. If the name is none, RT Utils will set a name of ROI-{ROI Number}.
157
- - <b>description</b>: A str value that sets the description of the ROI within the RT Struct. If no value is provided, the description is just left blank.
158
- - <b>use_pin_hole</b>: A boolean value that defaults to false. If set to true, lines will be erased through your mask such that each separate region within your image can be encapsulated via a single contour instead of contours nested within one another. Use this if your RT Struct viewer of choice does not support nested contours / contours with holes.
159
- - <b>approximate_contours</b>: A boolean value that defaults to True which defines whether or not approximations are made when extracting contours from the input mask. Setting this to false will lead to much larger contour data within your RT Struct so only use this if as much precision as possible is required.
160
- - <b>roi_generation_algorithm</b>: An enum value that defaults to 0 which defines what ROI generation algorithm will be used. 0=\'AUTOMATIC\', 1=\'SEMIAUTOMATIC\', or 2=\'MANUAL\'.
1
+ Metadata-Version: 2.4
2
+ Name: rt-utils
3
+ Version: 1.4.0
4
+ Summary: A small library for handling masks and RT-Structs
5
+ Author-email: Asim Shrestha <asim.shrestha@hotmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/qurit/rt-utils
8
+ Project-URL: Repository, https://github.com/qurit/rt-utils
9
+ Project-URL: Issues, https://github.com/qurit/rt-utils/issues
10
+ Keywords: RTStruct,Dicom,Pydicom
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Typing :: Typed
22
+ Classifier: Topic :: Software Development :: Libraries
23
+ Classifier: Topic :: Utilities
24
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
25
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
26
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
27
+ Classifier: Topic :: Scientific/Engineering :: Physics
28
+ Classifier: Intended Audience :: Healthcare Industry
29
+ Classifier: Intended Audience :: Science/Research
30
+ Classifier: Intended Audience :: Developers
31
+ Requires-Python: >=3.9
32
+ Description-Content-Type: text/markdown
33
+ License-File: LICENSE
34
+ Requires-Dist: pydicom
35
+ Requires-Dist: numpy
36
+ Requires-Dist: opencv-python>=4.0.0
37
+ Provides-Extra: nifti
38
+ Requires-Dist: SimpleITK; extra == "nifti"
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest; extra == "dev"
41
+ Requires-Dist: build; extra == "dev"
42
+ Requires-Dist: twine; extra == "dev"
43
+ Requires-Dist: black; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ <p align="center">
47
+ <img src="https://raw.githubusercontent.com/qurit/rt-utils/main/src/RTUtils_logo.png" height="300"/>
48
+ </p>
49
+ <p align="center">
50
+ <em>A minimal Python library for RT Struct manipulation</em>
51
+ </p>
52
+ <p align="center">
53
+ <img src="https://github.com/qurit/rt-utils/workflows/Python%20application/badge.svg" height="18">
54
+ <img src="https://img.shields.io/pypi/pyversions/rt-utils" alt="Python version" height="18">
55
+ <a href="https://pypi.org/project/rt-utils"><img src="https://badge.fury.io/py/rt-utils.svg" alt="PyPI version" height="18"></a>
56
+ <img alt="PyPI - License" src="https://img.shields.io/github/license/qurit/rt-utils?color=g" height="18" />
57
+
58
+ </p>
59
+
60
+ ---
61
+
62
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14902966.svg)](https://doi.org/10.5281/zenodo.14902966)
63
+
64
+
65
+ RT-Utils is motivated to allow physicians and other users to view the results of segmentation performed on a series of DICOM images. RT-Utils allows you to create or load RT Structs, extract 3d masks from RT Struct ROIs, easily add one or more regions of interest, and save the resulting RT Struct in just a few lines!
66
+ You can also use the RT-Utils for merging two existing RT Structs to one file.
67
+
68
+ ## How it works
69
+ RT-Utils provides a builder class to faciliate the creation and loading of an RT Struct. From there, you can add ROIs through binary masks and optionally input the colour of the region along with the region name.
70
+
71
+ The format for the ROI mask is an nd numpy array of type bool. It is an array of 2d binary masks, one plane for each slice location within the DICOM series. The slices should be sorted in ascending order within the mask. Through these masks, we extract the contours of the regions of interest and place them within the RT Struct file. Note that there is currently only support for the use of one frame of reference UID and structered set ROI sequence. Also note that holes within the ROI may be handled poorly.
72
+
73
+ ## Installation
74
+ ```
75
+ pip install rt_utils
76
+ ```
77
+ ##
78
+ **libGL**
79
+ libGL is a required system dependency. Install it on Linux using:
80
+ ```
81
+ ```bash
82
+ sudo apt install libgl1
83
+ ```
84
+ ## Installation in editable mode
85
+ ```
86
+ git clone https://github.com/qurit/rt-utils.git
87
+ cd rt-utils
88
+ pip install -e .
89
+ ```
90
+
91
+
92
+ ## Creating new RT Structs
93
+ ```Python
94
+ from rt_utils import RTStructBuilder
95
+
96
+ # Create new RT Struct. Requires the DICOM series path for the RT Struct.
97
+ rtstruct = RTStructBuilder.create_new(dicom_series_path="./testlocation")
98
+
99
+ # ...
100
+ # Create mask through means such as ML
101
+ # ...
102
+
103
+ # Add the 3D mask as an ROI.
104
+ # The colour, description, and name will be auto generated
105
+ rtstruct.add_roi(mask=MASK_FROM_ML_MODEL)
106
+
107
+ # Add another ROI, this time setting the color, description, and name
108
+ rtstruct.add_roi(
109
+ mask=MASK_FROM_ML_MODEL,
110
+ color=[255, 0, 255],
111
+ name="RT-Utils ROI!"
112
+ )
113
+
114
+ # By default contours pass through the centres of boundary voxels, preserving
115
+ # historical behavior. To place contours on the outer voxel edges instead:
116
+ rtstruct.add_roi(
117
+ mask=MASK_FROM_ML_MODEL,
118
+ name="Voxel-edge ROI",
119
+ contour_mode="voxel_edge"
120
+ )
121
+
122
+ rtstruct.save('new-rt-struct')
123
+ ```
124
+
125
+ ## Adding to existing RT Structs
126
+ ```Python
127
+ from rt_utils import RTStructBuilder
128
+ import matplotlib.pyplot as plt
129
+
130
+ # Load existing RT Struct. Requires the series path and existing RT Struct path
131
+ rtstruct = RTStructBuilder.create_from(
132
+ dicom_series_path="./testlocation",
133
+ rt_struct_path="./testlocation/rt-struct.dcm"
134
+ )
135
+
136
+ # Add ROI. This is the same as the above example.
137
+ rtstruct.add_roi(
138
+ mask=MASK_FROM_ML_MODEL,
139
+ color=[255, 0, 255],
140
+ name="RT-Utils ROI!"
141
+ )
142
+
143
+ rtstruct.save('new-rt-struct')
144
+ ```
145
+
146
+ ## Creation Results
147
+ <p align="center">
148
+ <img src="https://raw.githubusercontent.com/qurit/rt-utils/main/src/contour.png" width="1000"/>
149
+ </p>
150
+ <p align="center">
151
+ The results of a generated ROI with a dummy mask, as viewed in Slicer.
152
+ </p>
153
+
154
+ <p align="center">
155
+ <img src="https://raw.githubusercontent.com/qurit/RT-Utils/main/src/liver-contour.png" width="1000"/>
156
+ </p>
157
+ <p align="center">
158
+ The results of a generated ROI with a liver segmentation model, as viewed in Slicer. (Note the underlying patient data has been hidden)
159
+ </p>
160
+
161
+ ## Loading an existing RT Struct contour as a mask
162
+ ```Python
163
+ from rt_utils import RTStructBuilder
164
+ import matplotlib.pyplot as plt
165
+
166
+ # Load existing RT Struct. Requires the series path and existing RT Struct path
167
+ rtstruct = RTStructBuilder.create_from(
168
+ dicom_series_path="./testlocation",
169
+ rt_struct_path="./testlocation/rt-struct.dcm"
170
+ )
171
+
172
+ # View all of the ROI names from within the image
173
+ print(rtstruct.get_roi_names())
174
+
175
+ # Loading the 3D Mask from within the RT Struct
176
+ mask_3d = rtstruct.get_roi_mask_by_name("ROI NAME")
177
+
178
+ # Display one slice of the region
179
+ first_mask_slice = mask_3d[:, :, 0]
180
+ plt.imshow(first_mask_slice)
181
+ plt.show()
182
+ ```
183
+
184
+ ## Loading Results
185
+ <p align="center">
186
+ <img src="https://raw.githubusercontent.com/qurit/rt-utils/main/src/loaded-mask.png" height="300"/>
187
+ </p>
188
+ <p align="center">
189
+ The results of a loading an exisiting ROI as a mask, as viewed in Python.
190
+ </p>
191
+
192
+ ## Merging two existing RT Structs
193
+ To be able to merge two RT Structs it is important that both RT Structs have to belong to the same image series,
194
+ e.g. if there is one set for the organs at risk and one set for the target volume(s).
195
+ ```Python
196
+ from rt_utils import RTStructMerger
197
+
198
+ # Load existing RT Structs and corresponding image series and merge them into one RTStruct
199
+ merged_rt_struct = RTStructMerger.merge_rtstructs(
200
+ dicom_series_path="./testlocation",
201
+ rt_struct_path1="./testlocation/rt-struct1.dcm",
202
+ rt_struct_path2="./testlocation/rt-struct2.dcm"
203
+ )
204
+ merged_rt_struct.save('merged-rt-struct')
205
+ ```
206
+
207
+ ## Additional Parameters
208
+ The add_roi method of our RTStruct class has a multitude of optional parameters available. Below is a comprehensive list of all these parameters and what they do.
209
+ - <b>color</b>: This parameter can either be a colour string such as '#ffffff' or a RGB value as a list such as '[255, 255, 255]'. This parameter will dictate the colour of your ROI when viewed in a viewing program. If no colour is provided, RT Utils will pick from our internal colour palette based on the ROI Number of the ROI.
210
+ - <b>name</b>: A str value that defaults to none. Used to set the name of the ROI within the RT Struct. If the name is none, RT Utils will set a name of ROI-{ROI Number}.
211
+ - <b>description</b>: A str value that sets the description of the ROI within the RT Struct. If no value is provided, the description is just left blank.
212
+ - <b>use_pin_hole</b>: A boolean value that defaults to false. If set to true, lines will be erased through your mask such that each separate region within your image can be encapsulated via a single contour instead of contours nested within one another. Use this if your RT Struct viewer of choice does not support nested contours / contours with holes.
213
+ - <b>approximate_contours</b>: A boolean value that defaults to True which defines whether or not approximations are made when extracting contours from the input mask. Setting this to false will lead to much larger contour data within your RT Struct so only use this if as much precision as possible is required.
214
+ - <b>roi_generation_algorithm</b>: An enum value that defaults to 0 which defines what ROI generation algorithm will be used. 0=\'AUTOMATIC\', 1=\'SEMIAUTOMATIC\', or 2=\'MANUAL\'.
215
+
216
+ ## 🚀 New features
217
+ - nifti to rtstruct conversion has been added.
218
+ - conversion from DICOM to NIFTI for PET and corresponding RT-struct file has been added as an example usage with no issues of shift or mismatch between the masks.
219
+
220
+ ## Examples
221
+ You can find the comparison between RT-utils and other conversion techniques in this public repository: https://github.com/qurit/dicom_nifti_conversion_project
222
+
223
+ ## Examples
224
+ You can find the comparison between RT-utils and other conversion techniques in this public repository: https://github.com/qurit/dicom_nifti_conversion_project.
225
+
226
+ The real-world example in the JOSS paper under review was generated using the code provided in the [RTUTILS_read_world_example_for_PET.ipynb](https://github.com/qurit/rt-utils/blob/development/RTUTILS_read_world_example_for_PET.ipynb).
227
+
228
+ ## Contributing
229
+ We welcome contributions to this project! Please review our [CONTRIBUTING guidelines](./CONTRIBUTING.md) for more details.
230
+
231
+
232
+ ## How to Cite
233
+
234
+ If you are incorporating RT-Utils into your projects, kindly include the following citation:
235
+
236
+ [![DOI](https://joss.theoj.org/papers/10.21105/joss.07361/status.svg)](https://doi.org/10.21105/joss.07361)
237
+
238
+ For citation please use:
239
+ Shrestha, A., A. Watkins, F. Yousefirizi, A. Rahmim, C. Uribe, "RT-utils: A minimal python library for RT-struct manipulation." Journal of Open Source Software, Vol. 10 (No. 107), pp. 7361, (2025). doi:10.21105/joss.07361.
240
+
241
+ Read the full paper: Asim Shrestha, Adam Watkins, Fereshteh Yousefirizi, Arman Rahmim, and Carlos Uribe [RT-utils: A Minimal Python Library for RT-struct Manipulation](https://joss.theoj.org/papers/10.21105/joss.07361)