Skip to content

Commit 87877da

Browse files
authored
Fix civ dicom partial (#4374)
Correct path to DICOM civ partial.
1 parent 5f11516 commit 87877da

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

app/grandchallenge/components/templates/components/partials/civ.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{% if not civ.image %}
2323
{% include "components/partials/civ/fallback.html" %}
2424
{% elif civ.interface.is_dicom_image_kind %}
25-
{% include "components/partials/civ/dicom_image.html" %}
25+
{% include "components/partials/civ/dicom_image_set.html" %}
2626
{% else %}
2727
{% include "components/partials/civ/panimg_image.html" %}
2828
{% endif %}

app/tests/components_tests/test_partial_templates.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from django.template.loader import render_to_string
44

55
from grandchallenge.components.models import InterfaceKindChoices
6+
from tests.cases_tests.factories import DICOMImageSetFactory
67
from tests.components_tests.factories import (
78
ComponentInterfaceFactory,
89
ComponentInterfaceValueFactory,
@@ -77,6 +78,14 @@
7778
dict(),
7879
"<a ",
7980
),
81+
( # DICOM_IMAGE_SET
82+
dict(
83+
kind=InterfaceKindChoices.DICOM_IMAGE_SET,
84+
store_in_database=False,
85+
),
86+
dict(),
87+
"<div ",
88+
),
8089
( # Broken / fallback
8190
dict(
8291
kind=InterfaceKindChoices.PANIMG_SEGMENTATION,
@@ -108,9 +117,12 @@ def test_civ(
108117
ContentFile(b"<bh:ff><bh:d8><bh:ff><bh:e0><bh:00><bh:10>JFIF"),
109118
)
110119

111-
if ci.kind == InterfaceKindChoices.PANIMG_IMAGE:
120+
if ci.kind in InterfaceKindChoices.PANIMG_IMAGE:
112121
civ.image = ImageFactory()
113122
ImageFileFactory(image=civ.image)
123+
elif ci.kind == InterfaceKindChoices.DICOM_IMAGE_SET:
124+
civ.image = ImageFactory()
125+
DICOMImageSetFactory(image=civ.image)
114126

115127
# Actually create the CIV
116128
if (

0 commit comments

Comments
 (0)