-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f655aa
commit d270785
Showing
2 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
app/grandchallenge/components/migrations/0022_alter_componentinterface_overlay_segments.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Generated by Django 4.2.16 on 2024-11-22 18:08 | ||
|
||
from django.db import migrations, models | ||
|
||
import grandchallenge.core.validators | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("components", "0021_alter_componentinterface_kind_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="componentinterface", | ||
name="overlay_segments", | ||
field=models.JSONField( | ||
blank=True, | ||
default=list, | ||
help_text='The schema that defines how categories of values in the overlay images are differentiated. Example usage: [{"name": "background", "visible": true, "voxel_value": 0},{"name": "tissue", "visible": true, "voxel_value": 1}]. Refer to the <a href="/documentation/interfaces/#segmentation-masks">documentation</a> for more information', | ||
validators=[ | ||
grandchallenge.core.validators.JSONValidator( | ||
schema={ | ||
"$id": "http://example.com/example.json", | ||
"$schema": "http://json-schema.org/draft-06/schema", | ||
"description": "Define the overlay segments for the LUT.", | ||
"items": { | ||
"$id": "#/items", | ||
"additionalProperties": False, | ||
"default": {}, | ||
"description": "Defines what each segment of the LUT represents.", | ||
"examples": [ | ||
{ | ||
"metric_template": "{{metrics.volumes[0]}} mm³", | ||
"name": "Metastasis", | ||
"visible": True, | ||
"voxel_value": 1, | ||
} | ||
], | ||
"maxItems": 64, | ||
"properties": { | ||
"metric_template": { | ||
"$id": "#/items/properties/metric_template", | ||
"default": "", | ||
"description": "The jinja template to determine which property from the results.json should be used as the label text.", | ||
"examples": [ | ||
"{{metrics.volumes[0]}} mm³" | ||
], | ||
"title": "The Metric Template Schema", | ||
"type": "string", | ||
}, | ||
"name": { | ||
"$id": "#/items/properties/name", | ||
"default": "", | ||
"description": "What this segment should be called.", | ||
"examples": ["Metastasis"], | ||
"title": "The Name Schema", | ||
"type": "string", | ||
}, | ||
"visible": { | ||
"$id": "#/items/properties/visible", | ||
"default": True, | ||
"description": "Whether this segment is visible by default.", | ||
"examples": [True], | ||
"title": "The Visible Schema", | ||
"type": "boolean", | ||
}, | ||
"voxel_value": { | ||
"$id": "#/items/properties/voxel_value", | ||
"default": 0, | ||
"description": "The value of the LUT for this segment.", | ||
"examples": [1], | ||
"title": "The Voxel Value Schema", | ||
"type": "integer", | ||
}, | ||
}, | ||
"required": ["voxel_value", "name", "visible"], | ||
"title": "The Segment Schema", | ||
"type": "object", | ||
}, | ||
"title": "The Overlay Segments Schema", | ||
"type": "array", | ||
} | ||
) | ||
], | ||
), | ||
), | ||
] |
88 changes: 88 additions & 0 deletions
88
app/grandchallenge/reader_studies/migrations/0059_alter_question_overlay_segments.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Generated by Django 4.2.16 on 2024-11-22 18:08 | ||
|
||
from django.db import migrations, models | ||
|
||
import grandchallenge.core.validators | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("reader_studies", "0058_alter_question_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="question", | ||
name="overlay_segments", | ||
field=models.JSONField( | ||
blank=True, | ||
default=list, | ||
help_text='The schema that defines how categories of values in the overlay images are differentiated. Example usage: [{"name": "background", "visible": true, "voxel_value": 0},{"name": "tissue", "visible": true, "voxel_value": 1}]. Refer to the <a href="/documentation/interfaces/#segmentation-masks">documentation</a> for more information', | ||
validators=[ | ||
grandchallenge.core.validators.JSONValidator( | ||
schema={ | ||
"$id": "http://example.com/example.json", | ||
"$schema": "http://json-schema.org/draft-06/schema", | ||
"description": "Define the overlay segments for the LUT.", | ||
"items": { | ||
"$id": "#/items", | ||
"additionalProperties": False, | ||
"default": {}, | ||
"description": "Defines what each segment of the LUT represents.", | ||
"examples": [ | ||
{ | ||
"metric_template": "{{metrics.volumes[0]}} mm³", | ||
"name": "Metastasis", | ||
"visible": True, | ||
"voxel_value": 1, | ||
} | ||
], | ||
"maxItems": 64, | ||
"properties": { | ||
"metric_template": { | ||
"$id": "#/items/properties/metric_template", | ||
"default": "", | ||
"description": "The jinja template to determine which property from the results.json should be used as the label text.", | ||
"examples": [ | ||
"{{metrics.volumes[0]}} mm³" | ||
], | ||
"title": "The Metric Template Schema", | ||
"type": "string", | ||
}, | ||
"name": { | ||
"$id": "#/items/properties/name", | ||
"default": "", | ||
"description": "What this segment should be called.", | ||
"examples": ["Metastasis"], | ||
"title": "The Name Schema", | ||
"type": "string", | ||
}, | ||
"visible": { | ||
"$id": "#/items/properties/visible", | ||
"default": True, | ||
"description": "Whether this segment is visible by default.", | ||
"examples": [True], | ||
"title": "The Visible Schema", | ||
"type": "boolean", | ||
}, | ||
"voxel_value": { | ||
"$id": "#/items/properties/voxel_value", | ||
"default": 0, | ||
"description": "The value of the LUT for this segment.", | ||
"examples": [1], | ||
"title": "The Voxel Value Schema", | ||
"type": "integer", | ||
}, | ||
}, | ||
"required": ["voxel_value", "name", "visible"], | ||
"title": "The Segment Schema", | ||
"type": "object", | ||
}, | ||
"title": "The Overlay Segments Schema", | ||
"type": "array", | ||
} | ||
) | ||
], | ||
), | ||
), | ||
] |