Skip to content

Commit

Permalink
Made roi_corners for FoI multivalued so we can add one roi per image
Browse files Browse the repository at this point in the history
  • Loading branch information
juliomateoslangerak committed Nov 14, 2024
1 parent cca0cef commit ef89828
Show file tree
Hide file tree
Showing 12 changed files with 2,298 additions and 2,289 deletions.
Binary file modified project/excel/microscopemetrics_schema.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion project/graphql/microscopemetrics_schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ type FieldIlluminationOutput
keyMeasurements: FieldIlluminationKeyMeasurements
intensityProfiles: [Table]
roiProfiles: [Roi]
roiCorners: Roi
roiCorners: [Roi]
roiCentersOfMass: [Roi]
roiCentersGeometric: [Roi]
roiCentersFitted: [Roi]
Expand Down
2 changes: 1 addition & 1 deletion project/jsonld/microscopemetrics_schema.context.jsonld
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2024-10-18T16:23:49",
"generation_date": "2024-11-14T12:43:10",
"source": "microscopemetrics_schema.yaml"
},
"@context": {
Expand Down
4 changes: 3 additions & 1 deletion project/jsonld/microscopemetrics_schema.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -3973,6 +3973,7 @@
"FieldIlluminationOutput"
],
"range": "Roi",
"multivalued": true,
"inlined": true,
"@type": "SlotDefinition"
},
Expand Down Expand Up @@ -6157,6 +6158,7 @@
"name": "roi_corners",
"description": "Rectangular ROIs used to compute the corner intensities. The sama ROI is assigned to multiple images.",
"range": "Roi",
"multivalued": true,
"@type": "SlotDefinition"
},
{
Expand Down Expand Up @@ -6657,7 +6659,7 @@
"source_file": "microscopemetrics_schema.yaml",
"source_file_date": "2024-10-16T16:49:39",
"source_file_size": 848,
"generation_date": "2024-10-18T16:23:49",
"generation_date": "2024-11-14T12:43:10",
"@type": "SchemaDefinition",
"@context": [
"project/jsonld/microscopemetrics_schema.context.jsonld",
Expand Down
7 changes: 5 additions & 2 deletions project/jsonschema/microscopemetrics_schema.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,11 @@
"type": "array"
},
"roi_corners": {
"$ref": "#/$defs/Roi",
"description": "Rectangular ROIs used to compute the corner intensities. The sama ROI is assigned to multiple images."
"description": "Rectangular ROIs used to compute the corner intensities. The sama ROI is assigned to multiple images.",
"items": {
"$ref": "#/$defs/Roi"
},
"type": "array"
},
"roi_profiles": {
"description": "line ROIs used to compute the intensity profiles",
Expand Down
1,761 changes: 879 additions & 882 deletions project/owl/microscopemetrics_schema.owl.ttl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion project/protobuf/microscopemetrics_schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ message FieldIlluminationOutput
fieldIlluminationKeyMeasurements keyMeasurements = 0
repeated table intensityProfiles = 0
repeated roi roiProfiles = 0
roi roiCorners = 0
repeated roi roiCorners = 0
repeated roi roiCentersOfMass = 0
repeated roi roiCentersGeometric = 0
repeated roi roiCentersFitted = 0
Expand Down
2,781 changes: 1,390 additions & 1,391 deletions project/shacl/microscopemetrics_schema.shacl.ttl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion project/shex/microscopemetrics_schema.shex
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ CLOSED {
<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/analyses/field_illumination_schema/roi_profiles>
@<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/core_schema/Roi> * ;
<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/analyses/field_illumination_schema/roi_corners>
@<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/core_schema/Roi> ? ;
@<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/core_schema/Roi> * ;
<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/analyses/field_illumination_schema/roi_centers_of_mass>
@<https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema/core_schema/Roi> * ;

Expand Down
13 changes: 10 additions & 3 deletions project/sqlschema/microscopemetrics_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@
-- * Slot: validated Description: Has the dataset been validated by a human
-- * Slot: validation_datetime Description: The datetime of the validation
-- * Slot: key_measurements_id Description: Key-Value pairs containing the Key measurements for the field illumination analysis
-- * Slot: roi_corners_id Description: Rectangular ROIs used to compute the corner intensities. The sama ROI is assigned to multiple images.
-- * Slot: comment_id Description: A human readable comment about the dataset
-- # Class: "FieldIlluminationKeyMeasurements" Description: ""
-- * Slot: id Description:
Expand Down Expand Up @@ -454,6 +453,9 @@
-- # Class: "FieldIlluminationOutput_roi_profiles" Description: ""
-- * Slot: FieldIlluminationOutput_id Description: Autocreated FK slot
-- * Slot: roi_profiles_id Description: line ROIs used to compute the intensity profiles
-- # Class: "FieldIlluminationOutput_roi_corners" Description: ""
-- * Slot: FieldIlluminationOutput_id Description: Autocreated FK slot
-- * Slot: roi_corners_id Description: Rectangular ROIs used to compute the corner intensities. The sama ROI is assigned to multiple images.
-- # Class: "FieldIlluminationOutput_roi_centers_of_mass" Description: ""
-- * Slot: FieldIlluminationOutput_id Description: Autocreated FK slot
-- * Slot: roi_centers_of_mass_id Description: Point ROIs marking the center of mass of the area of maximum illumination. When the image is very flat, the 99 percentile is used instead. One point per channel.
Expand Down Expand Up @@ -1194,11 +1196,9 @@ CREATE TABLE "FieldIlluminationOutput" (
validated BOOLEAN NOT NULL,
validation_datetime DATETIME,
key_measurements_id INTEGER,
roi_corners_id INTEGER,
comment_id INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(key_measurements_id) REFERENCES "FieldIlluminationKeyMeasurements" (id),
FOREIGN KEY(roi_corners_id) REFERENCES "Roi" (id),
FOREIGN KEY(comment_id) REFERENCES "Comment" (id)
);
CREATE TABLE "FieldIlluminationKeyMeasurements" (
Expand Down Expand Up @@ -1551,6 +1551,13 @@ CREATE TABLE "FieldIlluminationOutput_roi_profiles" (
FOREIGN KEY("FieldIlluminationOutput_id") REFERENCES "FieldIlluminationOutput" (id),
FOREIGN KEY(roi_profiles_id) REFERENCES "Roi" (id)
);
CREATE TABLE "FieldIlluminationOutput_roi_corners" (
"FieldIlluminationOutput_id" INTEGER,
roi_corners_id INTEGER,
PRIMARY KEY ("FieldIlluminationOutput_id", roi_corners_id),
FOREIGN KEY("FieldIlluminationOutput_id") REFERENCES "FieldIlluminationOutput" (id),
FOREIGN KEY(roi_corners_id) REFERENCES "Roi" (id)
);
CREATE TABLE "FieldIlluminationOutput_roi_centers_of_mass" (
"FieldIlluminationOutput_id" INTEGER,
roi_centers_of_mass_id INTEGER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from microscopemetrics_schema.yaml by pythongen.py version: 0.0.1
# Generation date: 2024-10-18T16:23:51
# Generation date: 2024-11-14T12:43:12
# Schema: microscopemetrics-schema
#
# id: https://MontpellierRessourcesImagerie.github.io/microscopemetrics-schema
Expand Down Expand Up @@ -1370,7 +1370,7 @@ class FieldIlluminationOutput(MetricsOutput):
key_measurements: Optional[Union[dict, "FieldIlluminationKeyMeasurements"]] = None
intensity_profiles: Optional[Union[Union[dict, Table], List[Union[dict, Table]]]] = empty_list()
roi_profiles: Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]] = empty_list()
roi_corners: Optional[Union[dict, Roi]] = None
roi_corners: Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]] = empty_list()
roi_centers_of_mass: Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]] = empty_list()
roi_centers_geometric: Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]] = empty_list()
roi_centers_fitted: Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]] = empty_list()
Expand All @@ -1389,8 +1389,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
self.roi_profiles = [self.roi_profiles] if self.roi_profiles is not None else []
self.roi_profiles = [v if isinstance(v, Roi) else Roi(**as_dict(v)) for v in self.roi_profiles]

if self.roi_corners is not None and not isinstance(self.roi_corners, Roi):
self.roi_corners = Roi(**as_dict(self.roi_corners))
if not isinstance(self.roi_corners, list):
self.roi_corners = [self.roi_corners] if self.roi_corners is not None else []
self.roi_corners = [v if isinstance(v, Roi) else Roi(**as_dict(v)) for v in self.roi_corners]

if not isinstance(self.roi_centers_of_mass, list):
self.roi_centers_of_mass = [self.roi_centers_of_mass] if self.roi_centers_of_mass is not None else []
Expand Down Expand Up @@ -3102,7 +3103,7 @@ class slots:
model_uri=MICROSCOPEMETRICS_SCHEMA.fieldIlluminationOutput__roi_profiles, domain=None, range=Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]])

slots.fieldIlluminationOutput__roi_corners = Slot(uri=MICROSCOPEMETRICS_SCHEMA['analyses/field_illumination_schema/roi_corners'], name="fieldIlluminationOutput__roi_corners", curie=MICROSCOPEMETRICS_SCHEMA.curie('analyses/field_illumination_schema/roi_corners'),
model_uri=MICROSCOPEMETRICS_SCHEMA.fieldIlluminationOutput__roi_corners, domain=None, range=Optional[Union[dict, Roi]])
model_uri=MICROSCOPEMETRICS_SCHEMA.fieldIlluminationOutput__roi_corners, domain=None, range=Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]])

slots.fieldIlluminationOutput__roi_centers_of_mass = Slot(uri=MICROSCOPEMETRICS_SCHEMA['analyses/field_illumination_schema/roi_centers_of_mass'], name="fieldIlluminationOutput__roi_centers_of_mass", curie=MICROSCOPEMETRICS_SCHEMA.curie('analyses/field_illumination_schema/roi_centers_of_mass'),
model_uri=MICROSCOPEMETRICS_SCHEMA.fieldIlluminationOutput__roi_centers_of_mass, domain=None, range=Optional[Union[Union[dict, Roi], List[Union[dict, Roi]]]])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ classes:
range: Roi
description: >-
Rectangular ROIs used to compute the corner intensities. The sama ROI is assigned to multiple images.
multivalued: false
multivalued: true
roi_centers_of_mass:
range: Roi
description: >-
Expand Down

0 comments on commit ef89828

Please sign in to comment.