Error Decoding Full Arc VMAT with Start and End at 180 Gantry Angle

Hi Everyone,

I wonder whether do you encounter Error Decoding Full Arc VMAT with Start and End at 180 Gantry Angle? These full arc VMATs are one beam 2 arcs each. What about one beam 3 arcs or more?

regards,
LipTeck

Here’s the error message:

AssertionError: Unable to automatically determine whether angle is 180 or -180
Traceback:

File "/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/script_runner.py", line 333, in _run_script
    exec(code, module.__dict__)
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_app.py", line 24, in <module>
    main()
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_app.py", line 20, in main
    index.main()
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/index.py", line 149, in main
    application_function()
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/main.py", line 668, in main
    reference_results = get_input_data_ui(
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/main.py", line 192, in get_input_data_ui
    results = data_method_map[data_method](  # type: ignore
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_monaco.py", line 54, in monaco_input_method
    deliveries = _deliveries.cached_deliveries_loading(
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_deliveries.py", line 48, in cached_deliveries_loading
    deliveries += [method_function(an_input)]
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/caching.py", line 603, in wrapped_func
    return get_or_create_cached_value()
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/caching.py", line 587, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_deliveries.py", line 35, in delivery_from_tel
    return pymedphys.Delivery.from_monaco(tel_path)
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_monaco/delivery.py", line 34, in from_monaco
    return cls(*delivery_from_tel_plan_contents(tel_contents))
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_monaco/delivery.py", line 44, in delivery_from_tel_plan_contents
    bipolar_gantry_angle = pymedphys._utilities.transforms.convert_IEC_angle_to_bipolar(  # pylint: disable = protected-access
File "/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_utilities/transforms/bipolar.py", line 41, in convert_IEC_angle_to_bipolar
    assert np.all(

Hi Simon,

I have encountered this with 0.37.0dev1 too.

The error message:

AssertionError: Unable to automatically determine whether angle is 180 or -180
Traceback:
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/script_runner.py”, line 333, in _run_script
exec(code, module.dict)
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_app.py”, line 24, in
main()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_app.py”, line 20, in main
index.main()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/index.py”, line 149, in main
application_function()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/main.py”, line 668, in main
reference_results = get_input_data_ui(
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/main.py”, line 192, in get_input_data_ui
results = data_method_map[data_method]( # type: ignore
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_monaco.py”, line 54, in monaco_input_method
deliveries = _deliveries.cached_deliveries_loading(
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_deliveries.py”, line 48, in cached_deliveries_loading
deliveries += [method_function(an_input)]
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/caching.py”, line 603, in wrapped_func
return get_or_create_cached_value()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/caching.py”, line 587, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_deliveries.py”, line 35, in delivery_from_tel
return pymedphys.Delivery.from_monaco(tel_path)
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_monaco/delivery.py”, line 34, in from_monaco
return cls(*delivery_from_tel_plan_contents(tel_contents))
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_monaco/delivery.py”, line 44, in delivery_from_tel_plan_contents
bipolar_gantry_angle = pymedphys._utilities.transforms.convert_IEC_angle_to_bipolar( # pylint: disable = protected-access
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_utilities/transforms/bipolar.py”, line 41, in convert_IEC_angle_to_bipolar
assert np.all(

Hi Simon,

It has also happened to open arc VMAT with gantry start or stop at 180 degree.

AssertionError: Unable to automatically determine whether angle is 180 or -180
Traceback:
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/script_runner.py”, line 333, in _run_script
exec(code, module.dict)
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_app.py”, line 24, in
main()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_app.py”, line 20, in main
index.main()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/index.py”, line 149, in main
application_function()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/main.py”, line 668, in main
reference_results = get_input_data_ui(
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/main.py”, line 192, in get_input_data_ui
results = data_method_map[data_method]( # type: ignore
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_monaco.py”, line 54, in monaco_input_method
deliveries = _deliveries.cached_deliveries_loading(
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_deliveries.py”, line 48, in cached_deliveries_loading
deliveries += [method_function(an_input)]
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/caching.py”, line 603, in wrapped_func
return get_or_create_cached_value()
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/streamlit/caching.py”, line 587, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_streamlit/apps/metersetmap/_deliveries.py”, line 35, in delivery_from_tel
return pymedphys.Delivery.from_monaco(tel_path)
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_monaco/delivery.py”, line 34, in from_monaco
return cls(*delivery_from_tel_plan_contents(tel_contents))
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_monaco/delivery.py”, line 44, in delivery_from_tel_plan_contents
bipolar_gantry_angle = pymedphys._utilities.transforms.convert_IEC_angle_to_bipolar( # pylint: disable = protected-access
File “/home/physics/pymedphys/env/lib/python3.8/site-packages/pymedphys/_utilities/transforms/bipolar.py”, line 41, in convert_IEC_angle_to_bipolar
assert np.all(

regards,
LipTeck

Hi All

It’s solved in v 0.37.1

Thanks Simon!

  • Fixed a bug where Delivery.from_monaco wouldn’t be able to load beams
    where the stop angle of one beam was +180 and the start angle of the
    subsequent beam was -180 (or visa-versa). The conversion from IEC to bipolar
    is now handled on a “per-beam” basis. This bug affected the MetersetMap
    application.

Regards
Lip Teck

Ahhh :slight_smile: beautiful :slight_smile: :tada:

Great to hear :slight_smile: