-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathupdate_derived_rois.py
More file actions
26 lines (23 loc) · 873 Bytes
/
update_derived_rois.py
File metadata and controls
26 lines (23 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Updates all ROIs which are derived and not up to date.
#
# Authors:
# Christoffer Lervåg
# Helse Møre og Romsdal HF
#
from connect import *
case = get_current("Case")
examination = get_current("Examination")
# Search for ROIs which are derived but not updated:
for struct in case.PatientModel.StructureSets:
for roi in struct.RoiGeometries:
if roi.PrimaryShape:
# Check for dirty shape:
if roi.PrimaryShape.DerivedRoiStatus:
if roi.PrimaryShape.DerivedRoiStatus.IsShapeDirty == True:
# For any dirty ROI, update it:
roi.OfRoi.UpdateDerivedGeometry(Examination=examination, Algorithm="Auto")
else:
# Check for empty, derived ROI:
if roi.OfRoi.DerivedRoiExpression:
# Construct the ROI by using the update feature:
roi.OfRoi.UpdateDerivedGeometry(Examination=examination, Algorithm="Auto")