prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add example code for overlay segment configuration for workstation
  
  
  </issue>
  <code>
  [start of app/grandchallenge/workstation_configs/forms.py]
  1 from django.forms import ModelForm
  2 
  3 from grandchallenge.core.forms import SaveFormInitMixin
  4 from grandchallenge.core.widgets import JSONEditorWidget
  5 from grandchallenge.workstation_configs.models import (
  6     OVERLAY_SEGMENTS_SCHEMA,
  7     WorkstationConfig,
  8 )
  9 
  10 
  11 class WorkstationConfigForm(SaveFormInitMixin, ModelForm):
  12     class Meta:
  13         model = WorkstationConfig
  14         fields = (
  15             "title",
  16             "description",
  17             "window_presets",
  18             "default_window_preset",
  19             "default_slab_thickness_mm",
  20             "default_slab_render_method",
  21             "default_orientation",
  22             "default_overlay_alpha",
  23             "default_overlay_lut",
  24             "default_overlay_interpolation",
  25             "overlay_segments",
  26             "default_zoom_scale",
  27             "show_image_info_plugin",
  28             "show_display_plugin",
  29             "show_invert_tool",
  30             "show_flip_tool",
  31             "show_window_level_tool",
  32             "show_reset_tool",
  33         )
  34         widgets = {
  35             "overlay_segments": JSONEditorWidget(
  36                 schema=OVERLAY_SEGMENTS_SCHEMA
  37             ),
  38         }
  39
  [end of app/grandchallenge/workstation_configs/forms.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/app/grandchallenge/workstation_configs/forms.py b/app/grandchallenge/workstation_configs/forms.py
  --- a/app/grandchallenge/workstation_configs/forms.py
  +++ b/app/grandchallenge/workstation_configs/forms.py
  @@ -36,3 +36,14 @@
                   schema=OVERLAY_SEGMENTS_SCHEMA
               ),
           }
  +        help_texts = {
  +            "overlay_segments": (
  +                "If an categorical overlay is shown, it is possible to show toggles "
  +                "to change the visibility of the different overlay categories. To do "
  +                "so, configure the categories that should be displayed. Data from the"
  +                " algorithm's output.json can be added as an extra label to each "
  +                "toggle using jinja templating. "
  +                'For example: [{ "voxel_value": 0, "name": "Level 0", "visible": '
  +                'false, "metric_template": "{{metrics.volumes[0]}} mm³"},]'
  +            ),
  +        }
  
verification_info: {"golden_diff": "diff --git a/app/grandchallenge/workstation_configs/forms.py b/app/grandchallenge/workstation_configs/forms.py\n--- a/app/grandchallenge/workstation_configs/forms.py\n+++ b/app/grandchallenge/workstation_configs/forms.py\n@@ -36,3 +36,14 @@\n                 schema=OVERLAY_SEGMENTS_SCHEMA\n             ),\n         }\n+        help_texts = {\n+            \"overlay_segments\": (\n+                \"If an categorical overlay is shown, it is possible to show toggles \"\n+                \"to change the visibility of the different overlay categories. To do \"\n+                \"so, configure the categories that should be displayed. Data from the\"\n+                \" algorithm's output.json can be added as an extra label to each \"\n+                \"toggle using jinja templating. \"\n+                'For example: [{ \"voxel_value\": 0, \"name\": \"Level 0\", \"visible\": '\n+                'false, \"metric_template\": \"{{metrics.volumes[0]}} mm\u00b3\"},]'\n+            ),\n+        }\n", "issue": "Add example code for overlay segment configuration for workstation\n\n", "before_files": [{"content": "from django.forms import ModelForm\n\nfrom grandchallenge.core.forms import SaveFormInitMixin\nfrom grandchallenge.core.widgets import JSONEditorWidget\nfrom grandchallenge.workstation_configs.models import (\n    OVERLAY_SEGMENTS_SCHEMA,\n    WorkstationConfig,\n)\n\n\nclass WorkstationConfigForm(SaveFormInitMixin, ModelForm):\n    class Meta:\n        model = WorkstationConfig\n        fields = (\n            \"title\",\n            \"description\",\n            \"window_presets\",\n            \"default_window_preset\",\n            \"default_slab_thickness_mm\",\n            \"default_slab_render_method\",\n            \"default_orientation\",\n            \"default_overlay_alpha\",\n            \"default_overlay_lut\",\n            \"default_overlay_interpolation\",\n            \"overlay_segments\",\n            \"default_zoom_scale\",\n            \"show_image_info_plugin\",\n            \"show_display_plugin\",\n            \"show_invert_tool\",\n            \"show_flip_tool\",\n            \"show_window_level_tool\",\n            \"show_reset_tool\",\n        )\n        widgets = {\n            \"overlay_segments\": JSONEditorWidget(\n                schema=OVERLAY_SEGMENTS_SCHEMA\n            ),\n        }\n", "path": "app/grandchallenge/workstation_configs/forms.py"}]}