Skip to content

How to fix AttributeError in example script run_SimpleOptimizationProton.py after OpenTPS 3.0.0 update? #5

@cyj-21

Description

@cyj-21

I'm trying to run the example script run_SimpleOptimizationProton.py with OpenTPS 3.0.0, but I'm encountering an error when it tries to add a dose objective.

Error:
AttributeError: 'ObjectivesList' object has no attribute 'addFidObjective'. Did you mean: 'addObjective'?

Code that causes the error (from the example script, at line 129):
plan.planDesign.objectives.addFidObjective(roi, FidObjective.Metrics.DMAX, 20.0, 1.0)

Questions:
What should replace (roi, FidObjective.Metrics.DMAX, 20.0, 1.0) in the new method?

This error prevents me from running the basic optimization example. Could you please help me understand how to fix this code to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions