def build(self, finalize_mlc = True): if self.built: return self.datasets rtplan = modules.build_rt_plan(self.current_study, self.isocenter, self.structure_set.build()[0]) assert len(rtplan.FractionGroupSequence) == 1 fraction_group = rtplan.FractionGroupSequence[0] for bb in self.beam_builders: rtbeam = bb.build(rtplan, self, finalize_mlc=finalize_mlc) modules.add_beam_to_rt_fraction_group(fraction_group, rtbeam, bb.meterset) self.built = True self.datasets = [rtplan] return self.datasets