Skip to content

Commit

Permalink
Store Dose Reference Sequence attribute as metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
aditiiyer committed Oct 3, 2024
1 parent 44636b7 commit 65ac9f6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cerr/dataclasses/beams.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ class PatientSetupSeq:
PatientSetupNumber: int = 0
PatientPosition: str = ""

class DoseReferenceSeq:
"""This class defines sequence of dose references.
Attributes:
ReferencedSOPClassUID (str): Referenced SOP class UID
ReferencedSOPInstanceUID (str): Referenced SOP instance UID
"""
DoseReferenceType: str = ""
DoseReferenceUID: str = ""
DeliveryMaximumDose: float = 0

@dataclass
class BeamLimitingDevicePositionSeq:
"""This class defines data model for Sequence of beam limiting device (collimator) jaw or leaf (element) positions.
Expand Down Expand Up @@ -278,6 +289,14 @@ def load_beams(file_list):
patientSetupSeq.PatientSetupNumber = ds.PatientSetupSequence[0].PatientSetupNumber
ref_dose_seq_list = np.append(patient_setup_seq_list,patientSetupSeq)
beams_meta.PatientSetupSequence = patient_setup_seq_list
if hasattr(ds,"DoseReferenceSequence"):
dose_ref_seq_list = np.array([], dtype=DoseReferenceSeq)
doseRefSeq = DoseReferenceSeq()
doseRefSeq.DoseReferenceType = ds.DoseReferenceSequence[0].DoseReferenceType
doseRefSeq.DoseReferenceUID = ds.DoseReferenceSequence[0].DoseReferenceUID
doseRefSeq.DeliveryMaximumDose = ds.DoseReferenceSequence[0].DeliveryMaximumDose
dose_ref_seq_list = np.append(dose_ref_seq_list, doseRefSeq)
beams_meta.DoseReferenceSequence = dose_ref_seq_list
if hasattr(ds,"FractionGroupSequence"):
fx_grp_list = np.array([])
for fx_grp in ds.FractionGroupSequence:
Expand Down

0 comments on commit 65ac9f6

Please sign in to comment.