Skip to content

Commit

Permalink
Update serializer and test
Browse files Browse the repository at this point in the history
  • Loading branch information
amickan committed Jan 24, 2025
1 parent bc4ad33 commit 6b92ab5
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ def sentry_before_send(event, hint):
# CONTENT SECURITY POLICY
##########################

CSP_REPORT_ONLY = strtobool(os.environ.get("CSP_REPORT_ONLY", "False"))
CSP_REPORT_ONLY = strtobool(os.environ.get("CSP_REPORT_ONLY", "True"))

CSP_REPORT_URI = os.environ.get("CSP_REPORT_URI")
CSP_REPORT_PERCENTAGE = float(os.environ.get("CSP_REPORT_PERCENTAGE", "0"))
Expand Down
2 changes: 1 addition & 1 deletion app/grandchallenge/algorithms/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AlgorithmSerializer(serializers.ModelSerializer):
outputs = ComponentInterfaceSerializer(many=True, read_only=True)
logo = URLField(source="logo.x20.url", read_only=True)
url = URLField(source="get_absolute_url", read_only=True)
interfaces = AlgorithmInterfaceSerializer(many=True)
interfaces = AlgorithmInterfaceSerializer(many=True, read_only=True)

class Meta:
model = Algorithm
Expand Down
104 changes: 104 additions & 0 deletions app/tests/algorithms_tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,110 @@ def list_algorithms(self, **__):
"look_up_table": None,
},
],
"interfaces": [
{
"inputs": [
{
"title": "Coronal T2 Prostate MRI",
"description": "Coronal T2 MRI of the Prostate",
"slug": "coronal-t2-prostate-mri",
"kind": "Image",
"pk": 31,
"default_value": None,
"super_kind": "Image",
"relative_path": "images/coronal-t2-prostate-mri",
"overlay_segments": [],
"look_up_table": None,
},
{
"title": "Transverse T2 Prostate MRI",
"description": "Transverse T2 MRI of the Prostate",
"slug": "transverse-t2-prostate-mri",
"kind": "Image",
"pk": 32,
"default_value": None,
"super_kind": "Image",
"relative_path": "images/transverse-t2-prostate-mri",
"overlay_segments": [],
"look_up_table": None,
},
{
"title": "Sagittal T2 Prostate MRI",
"description": "Sagittal T2 MRI of the Prostate",
"slug": "sagittal-t2-prostate-mri",
"kind": "Image",
"pk": 33,
"default_value": None,
"super_kind": "Image",
"relative_path": "images/sagittal-t2-prostate-mri",
"overlay_segments": [],
"look_up_table": None,
},
{
"title": "Transverse HBV Prostate MRI",
"description": "Transverse High B-Value Prostate MRI",
"slug": "transverse-hbv-prostate-mri",
"kind": "Image",
"pk": 47,
"default_value": None,
"super_kind": "Image",
"relative_path": "images/transverse-hbv-prostate-mri",
"overlay_segments": [],
"look_up_table": None,
},
{
"title": "Transverse ADC Prostate MRI",
"description": "Transverse Apparent Diffusion Coefficient Prostate MRI",
"slug": "transverse-adc-prostate-mri",
"kind": "Image",
"pk": 48,
"default_value": None,
"super_kind": "Image",
"relative_path": "images/transverse-adc-prostate-mri",
"overlay_segments": [],
"look_up_table": None,
},
{
"title": "Clinical Information Prostate MRI",
"description": "Clinical information to support clinically significant prostate cancer detection in prostate MRI. Provided information: patient age at time of examination (patient_age), PSA level in ng/mL as reported (PSA_report), PSA density in ng/mL^2 as reported (PSAD_report), prostate volume as reported (prostate_volume_report), prostate volume derived from automatic whole-gland segmentation (prostate_volume_automatic), scanner manufacturer (scanner_manufacturer), scanner model name (scanner_model_name), diffusion b-value of (calculated) high b-value diffusion map (diffusion_high_bvalue). Values acquired from radiology reports will be missing, if not reported.",
"slug": "clinical-information-prostate-mri",
"kind": "Anything",
"pk": 156,
"default_value": None,
"super_kind": "Value",
"relative_path": "clinical-information-prostate-mri.json",
"overlay_segments": [],
"look_up_table": None,
},
],
"outputs": [
{
"title": "Case-level Cancer Likelihood Prostate MRI",
"description": "Case-level likelihood of harboring clinically significant prostate cancer, in range [0,1].",
"slug": "prostate-cancer-likelihood",
"kind": "Float",
"pk": 144,
"default_value": None,
"super_kind": "Value",
"relative_path": "cspca-case-level-likelihood.json",
"overlay_segments": [],
"look_up_table": None,
},
{
"title": "Transverse Cancer Detection Map Prostate MRI",
"description": "Single-class, detection map of clinically significant prostate cancer lesions in 3D, where each voxel represents a floating point in range [0,1].",
"slug": "cspca-detection-map",
"kind": "Heat Map",
"pk": 151,
"default_value": None,
"super_kind": "Image",
"relative_path": "images/cspca-detection-map",
"overlay_segments": [],
"look_up_table": None,
},
],
}
],
}
],
}
Expand Down

0 comments on commit 6b92ab5

Please sign in to comment.