From cbb334f94e3fe02cb469b106dbf2783511c9ad33 Mon Sep 17 00:00:00 2001 From: aranega Date: Fri, 15 Aug 2025 10:52:23 -0600 Subject: [PATCH 01/29] feat: Add support/config for InstanceSegmentationMask --- ingestion_tools/dataset_configs/template.yaml | 7 +++++++ schema/core/v1.1.0/metadata.yaml | 7 +++++++ schema/core/v2.0.0/metadata.yaml | 7 +++++++ .../ingestion_config/v1.0.0/ingestion_config_models.yaml | 3 +++ 4 files changed, 24 insertions(+) diff --git a/ingestion_tools/dataset_configs/template.yaml b/ingestion_tools/dataset_configs/template.yaml index b2d77c7b4..84ad934bd 100644 --- a/ingestion_tools/dataset_configs/template.yaml +++ b/ingestion_tools/dataset_configs/template.yaml @@ -93,6 +93,13 @@ annotations: OPTIONAL delimiter: OPTIONAL, STRING (DEFAULT ',') parent_filters: see InstanceSegmentation.parent_filters exclude: SEE InstanceSegmentation.exclude + - InstanceSegmentationMask: + file_format: see InstanceSegmentation.file_format + glob_string: see InstanceSegmentation.glob_string + glob_strings: see InstanceSegmentation.glob_strings + is_visualization_default: see InstanceSegmentation.is_visualization_default + parent_filters: see InstanceSegmentation.parent_filters + exclude: SEE InstanceSegmentation.exclude - SegmentationMask: file_format: see InstanceSegmentation.file_format glob_string: see InstanceSegmentation.glob_string diff --git a/schema/core/v1.1.0/metadata.yaml b/schema/core/v1.1.0/metadata.yaml index 5738dc08d..581a37785 100644 --- a/schema/core/v1.1.0/metadata.yaml +++ b/schema/core/v1.1.0/metadata.yaml @@ -629,6 +629,13 @@ classes: description: File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes. attributes: # no extended attributes + AnnotationInstanceSegmentationMaskFile: + is_a: AnnotationOrientedPointFile + aliases: + - InstanceSegmentationMask + description: File and sourcing data for an instance segmentation mask annotation. Annotation that identifies individual instances of object shape masks. + attributes: # no extended attributes + AnnotationPointFile: is_a: AnnotationSourceFile aliases: diff --git a/schema/core/v2.0.0/metadata.yaml b/schema/core/v2.0.0/metadata.yaml index 9bcb1e83f..04a219fd8 100644 --- a/schema/core/v2.0.0/metadata.yaml +++ b/schema/core/v2.0.0/metadata.yaml @@ -775,6 +775,13 @@ classes: description: File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes. attributes: # no extended attributes + AnnotationInstanceSegmentationMaskFile: + is_a: AnnotationOrientedPointFile + aliases: + - InstanceSegmentationMask + description: File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + attributes: # no extended attributes + AnnotationPointFile: is_a: AnnotationSourceFile aliases: diff --git a/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml b/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml index 30404d90b..71920e3b4 100644 --- a/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml +++ b/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml @@ -302,6 +302,9 @@ classes: InstanceSegmentation: description: The instance segmentation annotation source. range: AnnotationInstanceSegmentationFile + InstanceSegmentationMask: + description: The instance segmentation mask annotation source. + range: AnnotationInstanceSegmentationMaskFile OrientedPoint: description: The oriented point annotation source. range: AnnotationOrientedPointFile From c4aa044c1ca9045762511250fa44b11e8b875aa6 Mon Sep 17 00:00:00 2001 From: aranega Date: Fri, 15 Aug 2025 10:53:25 -0600 Subject: [PATCH 02/29] chore: Add new generated code from the new config for InstanceSegmentationMask --- .../v2.0.0/codegen/metadata_materialized.yaml | 133 +++++ schema/core/v2.0.0/codegen/metadata_models.py | 233 +++++++- .../v1.0.0/codegen/ingestion_config_models.py | 160 +++++- .../ingestion_config_models.schema.json | 79 +++ .../ingestion_config_models_materialized.yaml | 12 + .../v2.0.0/codegen/metadata_files.py | 513 ++++++++++++++++-- .../v2.0.0/codegen/metadata_files.schema.json | 294 +++++++++- .../codegen/metadata_files_materialized.yaml | 163 +++++- 8 files changed, 1478 insertions(+), 109 deletions(-) diff --git a/schema/core/v2.0.0/codegen/metadata_materialized.yaml b/schema/core/v2.0.0/codegen/metadata_materialized.yaml index 6de25c1a7..dc25bb4e6 100644 --- a/schema/core/v2.0.0/codegen/metadata_materialized.yaml +++ b/schema/core/v2.0.0/codegen/metadata_materialized.yaml @@ -3899,6 +3899,139 @@ classes: required: false inlined: true inlined_as_list: true + AnnotationInstanceSegmentationMaskFile: + name: AnnotationInstanceSegmentationMaskFile + description: File and sourcing data for an instance segmentation annotation mask. + Annotation that identifies individual instances of object shape masks. + from_schema: metadata + aliases: + - InstanceSegmentationMask + is_a: AnnotationOrientedPointFile + attributes: + binning: + name: binning + description: The binning factor for a point / oriented point / instance segmentation + annotation file. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_binning + ifabsent: float(1) + alias: binning + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationOrientedPointFile + - AnnotationPointFile + range: float + inlined: true + inlined_as_list: true + minimum_value: 0 + filter_value: + name: filter_value + description: The filter value for an oriented point / instance segmentation + annotation file. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_filter_value + alias: filter_value + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationOrientedPointFile + - AnnotationPointFile + - IdentifiedObjectList + range: string + inlined: true + inlined_as_list: true + order: + name: order + description: The order of axes for an oriented point / instance segmentation + annotation file. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_order + ifabsent: string(xyz) + alias: order + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationOrientedPointFile + range: string + inlined: true + inlined_as_list: true + file_format: + name: file_format + description: File format for this file + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_format + alias: file_format + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + range: string + required: true + inlined: true + inlined_as_list: true + glob_string: + name: glob_string + description: Glob string to match annotation files in the dataset. Required + if annotation_source_file_glob_strings is not provided. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_glob_string + alias: glob_string + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + range: string + required: false + inlined: true + inlined_as_list: true + glob_strings: + name: glob_strings + description: Glob strings to match annotation files in the dataset. Required + if annotation_source_file_glob_string is not provided. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_glob_strings + alias: glob_strings + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + range: string + required: false + multivalued: true + inlined: true + inlined_as_list: true + is_visualization_default: + name: is_visualization_default + description: This annotation will be rendered in neuroglancer by default. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_is_visualization_default + ifabsent: 'False' + alias: is_visualization_default + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - Tomogram + - AnnotationSourceFile + range: boolean + inlined: true + inlined_as_list: true + is_portal_standard: + name: is_portal_standard + description: Whether the annotation source is a portal standard. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_is_portal_standard + ifabsent: 'False' + alias: is_portal_standard + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + - Alignment + range: boolean + required: false + inlined: true + inlined_as_list: true AnnotationPointFile: name: AnnotationPointFile description: File and sourcing data for a point annotation. Annotation that identifies diff --git a/schema/core/v2.0.0/codegen/metadata_models.py b/schema/core/v2.0.0/codegen/metadata_models.py index 852c995ca..907788313 100644 --- a/schema/core/v2.0.0/codegen/metadata_models.py +++ b/schema/core/v2.0.0/codegen/metadata_models.py @@ -3081,6 +3081,7 @@ class Tomogram(AuthoredEntity): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3383,6 +3384,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3403,6 +3405,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3423,6 +3426,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3444,6 +3448,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3466,6 +3471,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3497,6 +3503,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationOrientedPointFile", "AnnotationPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_binning"], "ifabsent": "float(1)", @@ -3514,6 +3521,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], } @@ -3525,7 +3533,11 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): json_schema_extra={ "linkml_meta": { "alias": "order", - "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], "exact_mappings": ["cdp-common:annotation_source_file_order"], "ifabsent": "string(xyz)", } @@ -3541,6 +3553,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3561,6 +3574,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3581,6 +3595,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3602,6 +3617,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3624,6 +3640,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3655,6 +3672,176 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationOrientedPointFile", "AnnotationPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_binning"], + "ifabsent": "float(1)", + } + }, + ) + filter_value: Optional[str] = Field( + None, + description="""The filter value for an oriented point / instance segmentation annotation file.""", + json_schema_extra={ + "linkml_meta": { + "alias": "filter_value", + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationPointFile", + "IdentifiedObjectList", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], + } + }, + ) + order: Optional[str] = Field( + "xyz", + description="""The order of axes for an oriented point / instance segmentation annotation file.""", + json_schema_extra={ + "linkml_meta": { + "alias": "order", + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_order"], + "ifabsent": "string(xyz)", + } + }, + ) + file_format: str = Field( + ..., + description="""File format for this file""", + json_schema_extra={ + "linkml_meta": { + "alias": "file_format", + "domain_of": [ + "AnnotationSourceFile", + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + "AnnotationPointFile", + "AnnotationSegmentationMaskFile", + "AnnotationSemanticSegmentationMaskFile", + "AnnotationTriangularMeshFile", + "AnnotationTriangularMeshGroupFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_format"], + } + }, + ) + glob_string: Optional[str] = Field( + None, + description="""Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.""", + json_schema_extra={ + "linkml_meta": { + "alias": "glob_string", + "domain_of": [ + "AnnotationSourceFile", + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + "AnnotationPointFile", + "AnnotationSegmentationMaskFile", + "AnnotationSemanticSegmentationMaskFile", + "AnnotationTriangularMeshFile", + "AnnotationTriangularMeshGroupFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_glob_string"], + } + }, + ) + glob_strings: Optional[List[str]] = Field( + None, + description="""Glob strings to match annotation files in the dataset. Required if annotation_source_file_glob_string is not provided.""", + json_schema_extra={ + "linkml_meta": { + "alias": "glob_strings", + "domain_of": [ + "AnnotationSourceFile", + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + "AnnotationPointFile", + "AnnotationSegmentationMaskFile", + "AnnotationSemanticSegmentationMaskFile", + "AnnotationTriangularMeshFile", + "AnnotationTriangularMeshGroupFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_glob_strings"], + } + }, + ) + is_visualization_default: Optional[bool] = Field( + False, + description="""This annotation will be rendered in neuroglancer by default.""", + json_schema_extra={ + "linkml_meta": { + "alias": "is_visualization_default", + "domain_of": [ + "Tomogram", + "AnnotationSourceFile", + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + "AnnotationPointFile", + "AnnotationSegmentationMaskFile", + "AnnotationSemanticSegmentationMaskFile", + "AnnotationTriangularMeshFile", + "AnnotationTriangularMeshGroupFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_is_visualization_default"], + "ifabsent": "False", + } + }, + ) + is_portal_standard: Optional[bool] = Field( + False, + description="""Whether the annotation source is a portal standard.""", + json_schema_extra={ + "linkml_meta": { + "alias": "is_portal_standard", + "domain_of": [ + "AnnotationSourceFile", + "Alignment", + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + "AnnotationPointFile", + "AnnotationSegmentationMaskFile", + "AnnotationSemanticSegmentationMaskFile", + "AnnotationTriangularMeshFile", + "AnnotationTriangularMeshGroupFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_is_portal_standard"], + "ifabsent": "False", + } + }, + ) + + +class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): + """ + File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + """ + + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["InstanceSegmentationMask"], "from_schema": "metadata"}) + + binning: Optional[float] = Field( + 1.0, + description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", + ge=0, + json_schema_extra={ + "linkml_meta": { + "alias": "binning", + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_binning"], "ifabsent": "float(1)", @@ -3672,6 +3859,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], } @@ -3683,7 +3871,11 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): json_schema_extra={ "linkml_meta": { "alias": "order", - "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], "exact_mappings": ["cdp-common:annotation_source_file_order"], "ifabsent": "string(xyz)", } @@ -3699,6 +3891,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3719,6 +3912,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3739,6 +3933,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3760,6 +3955,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3782,6 +3978,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3813,6 +4010,7 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationOrientedPointFile", "AnnotationPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_binning"], "ifabsent": "float(1)", @@ -3854,6 +4052,7 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], } @@ -3869,6 +4068,7 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3889,6 +4089,7 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3909,6 +4110,7 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3930,6 +4132,7 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3952,6 +4155,7 @@ class AnnotationPointFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -3982,6 +4186,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4002,6 +4207,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4022,6 +4228,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4043,6 +4250,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4065,6 +4273,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4130,6 +4339,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4150,6 +4360,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4170,6 +4381,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4191,6 +4403,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4213,6 +4426,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4256,6 +4470,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4276,6 +4491,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4296,6 +4512,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4317,6 +4534,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4339,6 +4557,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4406,6 +4625,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4426,6 +4646,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4446,6 +4667,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4467,6 +4689,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4489,6 +4712,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -4588,6 +4812,7 @@ class IdentifiedObjectList(ConfiguredBaseModel): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:identified_object_filter_value"], } @@ -5094,6 +5319,7 @@ class Alignment(ConfiguredBaseModel): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", @@ -5717,10 +5943,10 @@ def pattern_ORCID(cls, v): FundedEntity.model_rebuild() CrossReferencedEntity.model_rebuild() PicturedEntity.model_rebuild() +PicturedMetadataEntity.model_rebuild() Assay.model_rebuild() DevelopmentStageDetails.model_rebuild() Disease.model_rebuild() -PicturedMetadataEntity.model_rebuild() OrganismDetails.model_rebuild() TissueDetails.model_rebuild() CellType.model_rebuild() @@ -5745,6 +5971,7 @@ def pattern_ORCID(cls, v): AnnotationSourceFile.model_rebuild() AnnotationOrientedPointFile.model_rebuild() AnnotationInstanceSegmentationFile.model_rebuild() +AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationPointFile.model_rebuild() AnnotationSegmentationMaskFile.model_rebuild() AnnotationSemanticSegmentationMaskFile.model_rebuild() diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py index 680cb4bcd..87f58ac90 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py @@ -1939,6 +1939,7 @@ class Tomogram(AuthoredEntity): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2120,6 +2121,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2130,6 +2132,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2140,6 +2143,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2151,6 +2155,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2163,6 +2168,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2181,24 +2187,28 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2209,6 +2219,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2219,6 +2230,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2230,6 +2242,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2242,6 +2255,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2260,24 +2274,28 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2288,6 +2306,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2298,6 +2317,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2309,6 +2329,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2321,6 +2342,94 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], + 'ifabsent': 'False'} }) + + +class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): + """ + File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['InstanceSegmentationMask'], 'from_schema': 'metadata'}) + + binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_binning'], + 'ifabsent': 'float(1)'} }) + filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationPointFile', + 'IdentifiedObjectList', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) + order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_order'], + 'ifabsent': 'string(xyz)'} }) + file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', + 'domain_of': ['AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) + glob_string: Optional[str] = Field(None, description="""Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.""", json_schema_extra = { "linkml_meta": {'alias': 'glob_string', + 'domain_of': ['AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) + glob_strings: Optional[List[str]] = Field(None, description="""Glob strings to match annotation files in the dataset. Required if annotation_source_file_glob_string is not provided.""", json_schema_extra = { "linkml_meta": {'alias': 'glob_strings', + 'domain_of': ['AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) + is_visualization_default: Optional[bool] = Field(False, description="""This annotation will be rendered in neuroglancer by default.""", json_schema_extra = { "linkml_meta": {'alias': 'is_visualization_default', + 'domain_of': ['Tomogram', + 'AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], + 'ifabsent': 'False'} }) + is_portal_standard: Optional[bool] = Field(False, description="""Whether the annotation source is a portal standard.""", json_schema_extra = { "linkml_meta": {'alias': 'is_portal_standard', + 'domain_of': ['AnnotationSourceFile', + 'Alignment', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2339,7 +2448,8 @@ class AnnotationPointFile(AnnotationSourceFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) columns: Optional[str] = Field("xyz", description="""The columns used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'columns', @@ -2354,12 +2464,14 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2370,6 +2482,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2380,6 +2493,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2391,6 +2505,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2403,6 +2518,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2422,6 +2538,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2432,6 +2549,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2442,6 +2560,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2453,6 +2572,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2465,6 +2585,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2495,6 +2616,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2505,6 +2627,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2515,6 +2638,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2526,6 +2650,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2538,6 +2663,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2562,6 +2688,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2572,6 +2699,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2582,6 +2710,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2593,6 +2722,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2605,6 +2735,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2643,6 +2774,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2653,6 +2785,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2663,6 +2796,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2674,6 +2808,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2686,6 +2821,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2738,7 +2874,8 @@ class IdentifiedObjectList(ConfiguredBaseModel): 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:identified_object_filter_value']} }) @@ -3013,6 +3150,7 @@ class Alignment(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -4083,6 +4221,7 @@ class AnnotationSource(DefaultSource): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'cdp-ingestion-config'}) InstanceSegmentation: Optional[AnnotationInstanceSegmentationFile] = Field(None, description="""File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes.""", json_schema_extra = { "linkml_meta": {'alias': 'InstanceSegmentation', 'domain_of': ['AnnotationSource']} }) + InstanceSegmentationMask: Optional[AnnotationInstanceSegmentationMaskFile] = Field(None, description="""File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks.""", json_schema_extra = { "linkml_meta": {'alias': 'InstanceSegmentationMask', 'domain_of': ['AnnotationSource']} }) OrientedPoint: Optional[AnnotationOrientedPointFile] = Field(None, description="""File and sourcing data for an oriented point annotation. Annotation that identifies points along with orientation in the volume.""", json_schema_extra = { "linkml_meta": {'alias': 'OrientedPoint', 'domain_of': ['AnnotationSource']} }) Point: Optional[AnnotationPointFile] = Field(None, description="""File and sourcing data for a point annotation. Annotation that identifies points in the volume.""", json_schema_extra = { "linkml_meta": {'alias': 'Point', 'domain_of': ['AnnotationSource']} }) SegmentationMask: Optional[AnnotationSegmentationMaskFile] = Field(None, description="""File and sourcing data for a segmentation mask annotation. Annotation that identifies an object.""", json_schema_extra = { "linkml_meta": {'alias': 'SegmentationMask', 'domain_of': ['AnnotationSource']} }) @@ -7894,10 +8033,10 @@ class TomogramHeader(ConfiguredBaseModel): FundedEntity.model_rebuild() CrossReferencedEntity.model_rebuild() PicturedEntity.model_rebuild() +PicturedMetadataEntity.model_rebuild() Assay.model_rebuild() DevelopmentStageDetails.model_rebuild() Disease.model_rebuild() -PicturedMetadataEntity.model_rebuild() OrganismDetails.model_rebuild() TissueDetails.model_rebuild() CellType.model_rebuild() @@ -7922,6 +8061,7 @@ class TomogramHeader(ConfiguredBaseModel): AnnotationSourceFile.model_rebuild() AnnotationOrientedPointFile.model_rebuild() AnnotationInstanceSegmentationFile.model_rebuild() +AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationPointFile.model_rebuild() AnnotationSegmentationMaskFile.model_rebuild() AnnotationSemanticSegmentationMaskFile.model_rebuild() diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json index 6177e6f4b..914fc0d6e 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json @@ -676,6 +676,74 @@ "title": "AnnotationInstanceSegmentationFile", "type": "object" }, + "AnnotationInstanceSegmentationMaskFile": { + "additionalProperties": false, + "description": "File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks.", + "properties": { + "binning": { + "description": "The binning factor for a point / oriented point / instance segmentation annotation file.", + "minimum": 0, + "type": [ + "number", + "null" + ] + }, + "file_format": { + "description": "File format for this file", + "type": "string" + }, + "filter_value": { + "description": "The filter value for an oriented point / instance segmentation annotation file.", + "type": [ + "string", + "null" + ] + }, + "glob_string": { + "description": "Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.", + "type": [ + "string", + "null" + ] + }, + "glob_strings": { + "description": "Glob strings to match annotation files in the dataset. Required if annotation_source_file_glob_string is not provided.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "is_portal_standard": { + "description": "Whether the annotation source is a portal standard.", + "type": [ + "boolean", + "null" + ] + }, + "is_visualization_default": { + "description": "This annotation will be rendered in neuroglancer by default.", + "type": [ + "boolean", + "null" + ] + }, + "order": { + "description": "The order of axes for an oriented point / instance segmentation annotation file.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "file_format" + ], + "title": "AnnotationInstanceSegmentationMaskFile", + "type": "object" + }, "AnnotationMethodLinkTypeEnum": { "description": "Describes the type of link associated to the annotation method.", "enum": [ @@ -1121,6 +1189,17 @@ ], "description": "File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes." }, + "InstanceSegmentationMask": { + "anyOf": [ + { + "$ref": "#/$defs/AnnotationInstanceSegmentationMaskFile" + }, + { + "type": "null" + } + ], + "description": "File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks." + }, "OrientedPoint": { "anyOf": [ { diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml index 2f0c1d753..3d939d31d 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml @@ -1877,6 +1877,18 @@ classes: range: AnnotationInstanceSegmentationFile inlined: true inlined_as_list: true + InstanceSegmentationMask: + name: InstanceSegmentationMask + description: File and sourcing data for an instance segmentation annotation + mask. Annotation that identifies individual instances of object shape masks. + from_schema: cdp-ingestion-config + alias: InstanceSegmentationMask + owner: AnnotationSource + domain_of: + - AnnotationSource + range: AnnotationInstanceSegmentationMaskFile + inlined: true + inlined_as_list: true OrientedPoint: name: OrientedPoint description: File and sourcing data for an oriented point annotation. Annotation diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files.py b/schema/metadata_files/v2.0.0/codegen/metadata_files.py index b6e7cdb55..7a7179807 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files.py +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files.py @@ -84,11 +84,21 @@ def __contains__(self, key:str) -> bool: 'from_schema': 'metadata', 'name': 'BTO_ID', 'pattern': '^BTO:[0-9]{7}$'}, + 'CC_ID': {'base': 'str', + 'description': 'A Cell Culture Collection identifier', + 'from_schema': 'metadata', + 'name': 'CC_ID', + 'pattern': '^CC-[0-9]{4}$'}, 'CL_ID': {'base': 'str', 'description': 'A Cell Ontology identifier', 'from_schema': 'metadata', 'name': 'CL_ID', 'pattern': '^CL:[0-9]{7}$'}, + 'CVCL_ID': {'base': 'str', + 'description': 'A Cellosaurus identifier', + 'from_schema': 'metadata', + 'name': 'CVCL_ID', + 'pattern': '^CVCL_[A-Z0-9]{4,}$'}, 'DOI': {'base': 'str', 'description': 'A Digital Object Identifier', 'from_schema': 'metadata', @@ -99,6 +109,12 @@ def __contains__(self, key:str) -> bool: 'from_schema': 'metadata', 'name': 'DOI_LIST', 'pattern': '^(doi:)?10\\.[0-9]{4,9}/[-._;()/:a-zA-Z0-9]+(\\s*,\\s*(doi:)?10\\.[0-9]{4,9}/[-._;()/:a-zA-Z0-9]+)*$'}, + 'EFO_ID': {'base': 'str', + 'description': 'An Experimental Factor Ontology ' + 'identifier', + 'from_schema': 'metadata', + 'name': 'EFO_ID', + 'pattern': '^EFO:[0-9]{7}$'}, 'EMDB_ID': {'base': 'str', 'description': 'An Electron Microscopy Data Bank ' 'identifier', @@ -137,6 +153,12 @@ def __contains__(self, key:str) -> bool: 'from_schema': 'metadata', 'name': 'GO_ID', 'pattern': '^GO:[0-9]{7}$'}, + 'HSAPDV_ID': {'base': 'str', + 'description': 'A Human Developmental Phenotype ' + 'Ontology identifier', + 'from_schema': 'metadata', + 'name': 'HSAPDV_ID', + 'pattern': 'HsapDv:[0-9]{7}$'}, 'IntegerFormattedString': {'base': 'str', 'description': 'A formatted string that ' 'represents an integer.', @@ -144,6 +166,16 @@ def __contains__(self, key:str) -> bool: 'name': 'IntegerFormattedString', 'pattern': '^int[ ' ']*\\{[a-zA-Z0-9_-]+\\}[ ]*$'}, + 'MONDO_ID': {'base': 'str', + 'description': 'An identifier of type MONDO', + 'from_schema': 'metadata', + 'name': 'MONDO_ID', + 'pattern': '^MONDO:[0-9]{7}$'}, + 'NCBI_TAXON_ID': {'base': 'str', + 'description': 'A NCBI Taxonomy identifier', + 'from_schema': 'metadata', + 'name': 'NCBI_TAXON_ID', + 'pattern': '^NCBITaxon:[0-9]+$'}, 'ONTOLOGY_ID': {'base': 'str', 'description': 'An ontology identifier', 'from_schema': 'metadata', @@ -155,6 +187,11 @@ def __contains__(self, key:str) -> bool: 'from_schema': 'metadata', 'name': 'ORCID', 'pattern': '[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$'}, + 'PATO_ID': {'base': 'str', + 'description': 'An identifier of type PATO', + 'from_schema': 'metadata', + 'name': 'PATO_ID', + 'pattern': '^PATO:[0-9]{7}$'}, 'PDB_ID': {'base': 'str', 'description': 'A Protein Data Bank identifier', 'from_schema': 'metadata', @@ -168,11 +205,22 @@ def __contains__(self, key:str) -> bool: 'name': 'StringFormattedString', 'pattern': '^[ ]*\\{[a-zA-Z0-9_-]+\\}[ ' ']*$'}, + 'UBERON_ID': {'base': 'str', + 'description': 'An UBERON identifier', + 'from_schema': 'metadata', + 'name': 'UBERON_ID', + 'pattern': '^UBERON:[0-9]{7}$'}, 'UNIPROT_ID': {'base': 'str', 'description': 'A UniProt identifier', 'from_schema': 'metadata', 'name': 'UNIPROT_ID', 'pattern': '^UniProtKB:[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}$'}, + 'UNKNOWN_LITERAL': {'base': 'str', + 'description': 'A placeholder for an unknown ' + 'value.', + 'from_schema': 'metadata', + 'name': 'UNKNOWN_LITERAL', + 'pattern': '^unknown$'}, 'URLorS3URI': {'base': 'str', 'description': 'A URL or S3 URI', 'from_schema': 'metadata', @@ -184,11 +232,21 @@ def __contains__(self, key:str) -> bool: 'from_schema': 'metadata', 'minimum_value': 0, 'name': 'VersionString'}, - 'WORMBASE_ID': {'base': 'str', - 'description': 'A WormBase identifier', - 'from_schema': 'metadata', - 'name': 'WORMBASE_ID', - 'pattern': 'WBStrain[0-9]{8}$'}, + 'WORMBASE_DEVELOPMENT_ID': {'base': 'str', + 'description': 'A WormBase identifier', + 'from_schema': 'metadata', + 'name': 'WORMBASE_DEVELOPMENT_ID', + 'pattern': 'WBls:[0-9]{7}$'}, + 'WORMBASE_STRAIN_ID': {'base': 'str', + 'description': 'A WormBase strain identifier', + 'from_schema': 'metadata', + 'name': 'WORMBASE_STRAIN_ID', + 'pattern': 'WBStrain[0-9]{8}$'}, + 'WORMBASE_TISSUE_ID': {'base': 'str', + 'description': 'A WormBase tissue identifier', + 'from_schema': 'metadata', + 'name': 'WORMBASE_TISSUE_ID', + 'pattern': 'WBbt:[0-9]{7}$'}, 'boolean': {'base': 'Bool', 'description': 'A binary (true or false) value', 'exact_mappings': ['schema:Boolean'], @@ -541,22 +599,26 @@ class SampleTypeEnum(str, Enum): """ Type of sample imaged in a CryoET study. """ - # Tomographic data of whole cells or cell sections. - cell = "cell" - # Tomographic data of tissue sections. - tissue = "tissue" - # Tomographic data of sections through multicellular organisms. - organism = "organism" - # Tomographic data of purified organelles. - organelle = "organelle" - # Tomographic data of purified viruses or VLPs. - virus = "virus" - # Tomographic data of in vitro reconstituted systems or mixtures of proteins. - in_vitro = "in_vitro" + # Tomographic data of immortalized cells or immortalized cell sections + cell_line = "cell_line" # Simulated tomographic data. in_silico = "in_silico" + # Tomographic data of in vitro reconstituted systems or mixtures of proteins. + in_vitro = "in_vitro" + # Tomographic data of purified organelles. + organelle = "organelle" + # Tomographic data of sections through multicellular organisms. + organism = "organism" + # Tomographic data of organoid-derived samples. + organoid = "organoid" # Other type of sample. other = "other" + # Tomographic data of whole primary cells or primary cell sections. + primary_cell_culture = "primary_cell_culture" + # Tomographic data of tissue sections. + tissue = "tissue" + # Tomographic data of purified viruses or VLPs. + virus = "virus" class TiltseriesCameraAcquireModeEnum(str, Enum): @@ -813,6 +875,148 @@ class PicturedMetadataEntity(ConfiguredBaseModel): 'DepositionMetadata']} }) +class Assay(ConfiguredBaseModel): + """ + The assay that was used to create the dataset. + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) + + name: str = Field(..., description="""Name of the assay component.""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', + 'TissueDetails', + 'CellType', + 'CellStrain', + 'CellComponent', + 'AnnotationObject', + 'AnnotationTriangularMeshGroupFile', + 'AuthorMixin', + 'Author'], + 'exact_mappings': ['cdp-common:assay_name']} }) + id: Optional[str] = Field(None, description="""The EFO identifier for the cellular component.""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', + 'CellType', + 'CellStrain', + 'CellComponent', + 'AnnotationObject'], + 'exact_mappings': ['cdp-common:assay_id'], + 'recommended': True} }) + + @field_validator('id') + def pattern_id(cls, v): + pattern=re.compile(r"^EFO:[0-9]{7}$") + if isinstance(v,list): + for element in v: + if not pattern.match(element): + raise ValueError(f"Invalid id format: {element}") + elif isinstance(v,str): + if not pattern.match(v): + raise ValueError(f"Invalid id format: {v}") + return v + + +class DevelopmentStageDetails(ConfiguredBaseModel): + """ + The development stage of the patients or organisms from which assayed biosamples were derived. + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) + + name: Optional[str] = Field(None, description="""Name of the developmental stage component.""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', + 'TissueDetails', + 'CellType', + 'CellStrain', + 'CellComponent', + 'AnnotationObject', + 'AnnotationTriangularMeshGroupFile', + 'AuthorMixin', + 'Author'], + 'exact_mappings': ['cdp-common:development_stage_name'], + 'recommended': True} }) + id: Optional[str] = Field(None, description="""A placeholder for any type of data.""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'any_of': [{'range': 'UNKNOWN_LITERAL'}, + {'range': 'WORMBASE_DEVELOPMENT_ID'}, + {'range': 'UBERON_ID'}, + {'range': 'HSAPDV_ID'}], + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', + 'CellType', + 'CellStrain', + 'CellComponent', + 'AnnotationObject'], + 'exact_mappings': ['cdp-common:development_stage_id'], + 'recommended': True} }) + + @field_validator('id') + def pattern_id(cls, v): + pattern=re.compile(r"(^unknown$)|(WBls:[0-9]{7}$)|(^UBERON:[0-9]{7}$)|(HsapDv:[0-9]{7}$)") + if isinstance(v,list): + for element in v: + if not pattern.match(element): + raise ValueError(f"Invalid id format: {element}") + elif isinstance(v,str): + if not pattern.match(v): + raise ValueError(f"Invalid id format: {v}") + return v + + +class Disease(ConfiguredBaseModel): + """ + The disease or condition of the patients from which assayed biosamples were derived. + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) + + name: Optional[str] = Field(None, description="""Name of the disease.""", json_schema_extra = { "linkml_meta": {'alias': 'name', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', + 'TissueDetails', + 'CellType', + 'CellStrain', + 'CellComponent', + 'AnnotationObject', + 'AnnotationTriangularMeshGroupFile', + 'AuthorMixin', + 'Author'], + 'exact_mappings': ['cdp-common:disease_name'], + 'recommended': True} }) + id: Optional[str] = Field(None, description="""A placeholder for any type of data.""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'any_of': [{'range': 'MONDO_ID'}, {'range': 'PATO_ID'}], + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', + 'CellType', + 'CellStrain', + 'CellComponent', + 'AnnotationObject'], + 'exact_mappings': ['cdp-common:disease_id'], + 'recommended': True} }) + + @field_validator('id') + def pattern_id(cls, v): + pattern=re.compile(r"(^MONDO:[0-9]{7}$)|(^PATO:[0-9]{7}$)") + if isinstance(v,list): + for element in v: + if not pattern.match(element): + raise ValueError(f"Invalid id format: {element}") + elif isinstance(v,str): + if not pattern.match(v): + raise ValueError(f"Invalid id format: {v}") + return v + + class OrganismDetails(ConfiguredBaseModel): """ The species from which the sample was derived. @@ -820,7 +1024,10 @@ class OrganismDetails(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) name: str = Field(..., description="""Name of the organism from which a biological sample used in a CryoET study is derived from, e.g. homo sapiens.""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -843,7 +1050,10 @@ class TissueDetails(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) name: str = Field(..., description="""Name of the tissue from which a biological sample used in a CryoET study is derived from.""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -853,8 +1063,14 @@ class TissueDetails(ConfiguredBaseModel): 'AuthorMixin', 'Author'], 'exact_mappings': ['cdp-common:tissue_name']} }) - id: Optional[str] = Field(None, description="""The UBERON identifier for the tissue.""", json_schema_extra = { "linkml_meta": {'alias': 'id', - 'domain_of': ['TissueDetails', + id: Optional[str] = Field(None, description="""A placeholder for any type of data.""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'any_of': [{'range': 'CL_ID'}, + {'range': 'WORMBASE_TISSUE_ID'}, + {'range': 'UBERON_ID'}], + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', 'CellType', 'CellStrain', 'CellComponent', @@ -864,7 +1080,7 @@ class TissueDetails(ConfiguredBaseModel): @field_validator('id') def pattern_id(cls, v): - pattern=re.compile(r"^BTO:[0-9]{7}$") + pattern=re.compile(r"(^CL:[0-9]{7}$)|(WBbt:[0-9]{7}$)|(^UBERON:[0-9]{7}$)") if isinstance(v,list): for element in v: if not pattern.match(element): @@ -882,7 +1098,10 @@ class CellType(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) name: str = Field(..., description="""Name of the cell type from which a biological sample used in a CryoET study is derived from.""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -892,8 +1111,12 @@ class CellType(ConfiguredBaseModel): 'AuthorMixin', 'Author'], 'exact_mappings': ['cdp-common:cell_name']} }) - id: Optional[str] = Field(None, description="""Cell Ontology identifier for the cell type""", json_schema_extra = { "linkml_meta": {'alias': 'id', - 'domain_of': ['TissueDetails', + id: Optional[str] = Field(None, description="""A placeholder for any type of data.""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'any_of': [{'range': 'CL_ID'}, {'range': 'UBERON_ID'}], + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', 'CellType', 'CellStrain', 'CellComponent', @@ -903,7 +1126,7 @@ class CellType(ConfiguredBaseModel): @field_validator('id') def pattern_id(cls, v): - pattern=re.compile(r"^CL:[0-9]{7}$") + pattern=re.compile(r"(^CL:[0-9]{7}$)|(^UBERON:[0-9]{7}$)") if isinstance(v,list): for element in v: if not pattern.match(element): @@ -921,7 +1144,10 @@ class CellStrain(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) name: str = Field(..., description="""Cell line or strain for the sample.""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -932,8 +1158,14 @@ class CellStrain(ConfiguredBaseModel): 'Author'], 'exact_mappings': ['cdp-common:cell_strain_name']} }) id: Optional[str] = Field(None, description="""A placeholder for any type of data.""", json_schema_extra = { "linkml_meta": {'alias': 'id', - 'any_of': [{'range': 'WORMBASE_ID'}, {'range': 'ONTOLOGY_ID'}], - 'domain_of': ['TissueDetails', + 'any_of': [{'range': 'WORMBASE_STRAIN_ID'}, + {'range': 'NCBI_TAXON_ID'}, + {'range': 'CVCL_ID'}, + {'range': 'CC_ID'}], + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', 'CellType', 'CellStrain', 'CellComponent', @@ -943,7 +1175,7 @@ class CellStrain(ConfiguredBaseModel): @field_validator('id') def pattern_id(cls, v): - pattern=re.compile(r"(WBStrain[0-9]{8}$)|(^[a-zA-Z]+:[0-9]+$)") + pattern=re.compile(r"(WBStrain[0-9]{8}$)|(^NCBITaxon:[0-9]+$)|(^CVCL_[A-Z0-9]{4,}$)|(^CC-[0-9]{4}$)") if isinstance(v,list): for element in v: if not pattern.match(element): @@ -961,7 +1193,10 @@ class CellComponent(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'metadata'}) name: str = Field(..., description="""Name of the cellular component.""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -972,7 +1207,10 @@ class CellComponent(ConfiguredBaseModel): 'Author'], 'exact_mappings': ['cdp-common:cell_component_name']} }) id: Optional[str] = Field(None, description="""The GO identifier for the cellular component.""", json_schema_extra = { "linkml_meta": {'alias': 'id', - 'domain_of': ['TissueDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', 'CellType', 'CellStrain', 'CellComponent', @@ -1024,10 +1262,16 @@ class ExperimentMetadata(ConfiguredBaseModel): 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) cell_component: Optional[CellComponent] = Field(None, description="""The cellular component from which the sample was derived.""", json_schema_extra = { "linkml_meta": {'alias': 'cell_component', 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + assay: Assay = Field(..., description="""The assay that was used to create the dataset.""", json_schema_extra = { "linkml_meta": {'alias': 'assay', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + development_stage: DevelopmentStageDetails = Field(..., description="""The development stage of the patients or organisms from which assayed biosamples were derived.""", json_schema_extra = { "linkml_meta": {'alias': 'development_stage', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + disease: Disease = Field(..., description="""The disease or condition of the patients from which assayed biosamples were derived.""", json_schema_extra = { "linkml_meta": {'alias': 'disease', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) @field_validator('sample_type') def pattern_sample_type(cls, v): - pattern=re.compile(r"(^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$)") + pattern=re.compile(r"(^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$)") if isinstance(v,list): for element in v: if not pattern.match(element): @@ -1116,10 +1360,16 @@ class Dataset(ExperimentMetadata, CrossReferencedEntity, FundedEntity, AuthoredE 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) cell_component: Optional[CellComponent] = Field(None, description="""The cellular component from which the sample was derived.""", json_schema_extra = { "linkml_meta": {'alias': 'cell_component', 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + assay: Assay = Field(..., description="""The assay that was used to create the dataset.""", json_schema_extra = { "linkml_meta": {'alias': 'assay', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + development_stage: DevelopmentStageDetails = Field(..., description="""The development stage of the patients or organisms from which assayed biosamples were derived.""", json_schema_extra = { "linkml_meta": {'alias': 'development_stage', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + disease: Disease = Field(..., description="""The disease or condition of the patients from which assayed biosamples were derived.""", json_schema_extra = { "linkml_meta": {'alias': 'disease', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) @field_validator('sample_type') def pattern_sample_type(cls, v): - pattern=re.compile(r"(^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$)") + pattern=re.compile(r"(^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$)") if isinstance(v,list): for element in v: if not pattern.match(element): @@ -1765,6 +2015,7 @@ class Tomogram(AuthoredEntity): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -1879,14 +2130,20 @@ class AnnotationObject(ConfiguredBaseModel): id: str = Field(..., description="""A placeholder for any type of data.""", json_schema_extra = { "linkml_meta": {'alias': 'id', 'any_of': [{'range': 'GO_ID'}, {'range': 'UNIPROT_ID'}], - 'domain_of': ['TissueDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'TissueDetails', 'CellType', 'CellStrain', 'CellComponent', 'AnnotationObject'], 'exact_mappings': ['cdp-common:annotation_object_id']} }) name: str = Field(..., description="""Name of the object being annotated (e.g. ribosome, nuclear pore complex, actin filament, membrane)""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -1956,6 +2213,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -1966,6 +2224,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -1976,6 +2235,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -1987,6 +2247,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2001,6 +2262,7 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2020,24 +2282,28 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2048,6 +2314,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2058,6 +2325,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2069,6 +2337,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2083,6 +2352,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2102,24 +2372,118 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_binning'], + 'ifabsent': 'float(1)'} }) + filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationPointFile', + 'IdentifiedObjectList', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) + order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_order'], + 'ifabsent': 'string(xyz)'} }) + file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', + 'domain_of': ['AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) + glob_string: Optional[str] = Field(None, description="""Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.""", json_schema_extra = { "linkml_meta": {'alias': 'glob_string', + 'domain_of': ['AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) + glob_strings: Optional[List[str]] = Field(None, description="""Glob strings to match annotation files in the dataset. Required if annotation_source_file_glob_string is not provided.""", json_schema_extra = { "linkml_meta": {'alias': 'glob_strings', + 'domain_of': ['AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) + is_visualization_default: Optional[bool] = Field(False, description="""This annotation will be rendered in neuroglancer by default.""", json_schema_extra = { "linkml_meta": {'alias': 'is_visualization_default', + 'domain_of': ['Tomogram', + 'AnnotationSourceFile', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile', + 'AnnotationFileMetadata', + 'TomogramMetadata'], + 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], + 'ifabsent': 'False'} }) + is_portal_standard: Optional[bool] = Field(False, description="""Whether the annotation source is a portal standard.""", json_schema_extra = { "linkml_meta": {'alias': 'is_portal_standard', + 'domain_of': ['AnnotationSourceFile', + 'Alignment', + 'AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', + 'AnnotationPointFile', + 'AnnotationSegmentationMaskFile', + 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationTriangularMeshFile', + 'AnnotationTriangularMeshGroupFile', + 'AlignmentMetadata'], + 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], + 'ifabsent': 'False'} }) + + +class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): + """ + File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + """ + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['InstanceSegmentationMask'], 'from_schema': 'metadata'}) + + binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2130,6 +2494,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2140,6 +2505,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2151,6 +2517,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2165,6 +2532,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2184,7 +2552,8 @@ class AnnotationPointFile(AnnotationSourceFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) columns: Optional[str] = Field("xyz", description="""The columns used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'columns', @@ -2199,12 +2568,14 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2215,6 +2586,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2225,6 +2597,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2236,6 +2609,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2250,6 +2624,7 @@ class AnnotationPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2270,6 +2645,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2280,6 +2656,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2290,6 +2667,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2301,6 +2679,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2315,6 +2694,7 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2346,6 +2726,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2356,6 +2737,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2366,6 +2748,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2377,6 +2760,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2391,6 +2775,7 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2416,6 +2801,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2426,6 +2812,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2436,6 +2823,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2447,6 +2835,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2461,6 +2850,7 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2483,7 +2873,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'exact_mappings': ['cdp-common:annotation_source_file_scale_factor'], 'ifabsent': 'float(1)'} }) name: Optional[str] = Field(None, description="""The name that identifies to a single annotation mesh among multiple meshes.""", json_schema_extra = { "linkml_meta": {'alias': 'name', - 'domain_of': ['OrganismDetails', + 'domain_of': ['Assay', + 'DevelopmentStageDetails', + 'Disease', + 'OrganismDetails', 'TissueDetails', 'CellType', 'CellStrain', @@ -2497,6 +2890,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2507,6 +2901,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2517,6 +2912,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2528,6 +2924,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2542,6 +2939,7 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -2595,7 +2993,8 @@ class IdentifiedObjectList(ConfiguredBaseModel): 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:identified_object_filter_value']} }) @@ -2889,6 +3288,7 @@ class Alignment(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -3133,6 +3533,9 @@ class AuthorMixin(ConfiguredBaseModel): name: str = Field(..., description="""The full name of the author.""", json_schema_extra = { "linkml_meta": {'alias': 'name', 'domain_of': ['AuthorMixin', 'Author', + 'Assay', + 'DevelopmentStageDetails', + 'Disease', 'OrganismDetails', 'TissueDetails', 'CellType', @@ -3182,6 +3585,9 @@ class Author(AuthorMixin): 'exact_mappings': ['cdp-common:kaggle_id']} }) name: str = Field(..., description="""The full name of the author.""", json_schema_extra = { "linkml_meta": {'alias': 'name', 'domain_of': ['AuthorMixin', + 'Assay', + 'DevelopmentStageDetails', + 'Disease', 'OrganismDetails', 'TissueDetails', 'CellType', @@ -3324,6 +3730,7 @@ class AlignmentMetadata(DefaultMetadata, Alignment): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -3409,6 +3816,7 @@ class AnnotationFileMetadata(ConfiguredBaseModel): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -3728,10 +4136,16 @@ class DatasetMetadata(DefaultMetadata, Dataset, PicturedMetadataEntity): 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) cell_component: Optional[CellComponent] = Field(None, description="""The cellular component from which the sample was derived.""", json_schema_extra = { "linkml_meta": {'alias': 'cell_component', 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + assay: Assay = Field(..., description="""The assay that was used to create the dataset.""", json_schema_extra = { "linkml_meta": {'alias': 'assay', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + development_stage: DevelopmentStageDetails = Field(..., description="""The development stage of the patients or organisms from which assayed biosamples were derived.""", json_schema_extra = { "linkml_meta": {'alias': 'development_stage', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) + disease: Disease = Field(..., description="""The disease or condition of the patients from which assayed biosamples were derived.""", json_schema_extra = { "linkml_meta": {'alias': 'disease', + 'domain_of': ['ExperimentMetadata', 'Dataset', 'DatasetMetadata']} }) @field_validator('sample_type') def pattern_sample_type(cls, v): - pattern=re.compile(r"(^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$)") + pattern=re.compile(r"(^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$)") if isinstance(v,list): for element in v: if not pattern.match(element): @@ -4221,6 +4635,7 @@ class TomogramMetadata(DefaultMetadata, Tomogram): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', @@ -4319,6 +4734,9 @@ def pattern_processing(cls, v): CrossReferencedEntity.model_rebuild() PicturedEntity.model_rebuild() PicturedMetadataEntity.model_rebuild() +Assay.model_rebuild() +DevelopmentStageDetails.model_rebuild() +Disease.model_rebuild() OrganismDetails.model_rebuild() TissueDetails.model_rebuild() CellType.model_rebuild() @@ -4343,6 +4761,7 @@ def pattern_processing(cls, v): AnnotationSourceFile.model_rebuild() AnnotationOrientedPointFile.model_rebuild() AnnotationInstanceSegmentationFile.model_rebuild() +AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationPointFile.model_rebuild() AnnotationSegmentationMaskFile.model_rebuild() AnnotationSemanticSegmentationMaskFile.model_rebuild() diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json b/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json index 01e24166f..0655f3ac9 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json @@ -666,6 +666,74 @@ "title": "AnnotationInstanceSegmentationFile", "type": "object" }, + "AnnotationInstanceSegmentationMaskFile": { + "additionalProperties": false, + "description": "File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks.", + "properties": { + "binning": { + "description": "The binning factor for a point / oriented point / instance segmentation annotation file.", + "minimum": 0, + "type": [ + "number", + "null" + ] + }, + "file_format": { + "description": "File format for this file", + "type": "string" + }, + "filter_value": { + "description": "The filter value for an oriented point / instance segmentation annotation file.", + "type": [ + "string", + "null" + ] + }, + "glob_string": { + "description": "Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.", + "type": [ + "string", + "null" + ] + }, + "glob_strings": { + "description": "Glob strings to match annotation files in the dataset. Required if annotation_source_file_glob_string is not provided.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "is_portal_standard": { + "description": "Whether the annotation source is a portal standard.", + "type": [ + "boolean", + "null" + ] + }, + "is_visualization_default": { + "description": "This annotation will be rendered in neuroglancer by default.", + "type": [ + "boolean", + "null" + ] + }, + "order": { + "description": "The order of axes for an oriented point / instance segmentation annotation file.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "file_format" + ], + "title": "AnnotationInstanceSegmentationMaskFile", + "type": "object" + }, "AnnotationMetadata": { "additionalProperties": false, "description": "Metadata describing an annotation.", @@ -1323,6 +1391,29 @@ "string" ] }, + "Assay": { + "additionalProperties": false, + "description": "The assay that was used to create the dataset.", + "properties": { + "id": { + "description": "The EFO identifier for the cellular component.", + "pattern": "^EFO:[0-9]{7}$", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Name of the assay component.", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Assay", + "type": "object" + }, "Author": { "additionalProperties": false, "description": "Author of a scientific data entity.", @@ -1485,7 +1576,15 @@ "type": "string" }, { - "pattern": "^[a-zA-Z]+:[0-9]+$", + "pattern": "^NCBITaxon:[0-9]+$", + "type": "string" + }, + { + "pattern": "^CVCL_[A-Z0-9]{4,}$", + "type": "string" + }, + { + "pattern": "^CC-[0-9]{4}$", "type": "string" }, { @@ -1493,7 +1592,7 @@ } ], "description": "A placeholder for any type of data.", - "pattern": "(WBStrain[0-9]{8}$)|(^[a-zA-Z]+:[0-9]+$)" + "pattern": "(WBStrain[0-9]{8}$)|(^NCBITaxon:[0-9]+$)|(^CVCL_[A-Z0-9]{4,}$)|(^CC-[0-9]{4}$)" }, "name": { "description": "Cell line or strain for the sample.", @@ -1511,12 +1610,21 @@ "description": "The cell type from which the sample was derived.", "properties": { "id": { - "description": "Cell Ontology identifier for the cell type", - "pattern": "^CL:[0-9]{7}$", - "type": [ - "string", - "null" - ] + "anyOf": [ + { + "pattern": "^CL:[0-9]{7}$", + "type": "string" + }, + { + "pattern": "^UBERON:[0-9]{7}$", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A placeholder for any type of data.", + "pattern": "(^CL:[0-9]{7}$)|(^UBERON:[0-9]{7}$)" }, "name": { "description": "Name of the cell type from which a biological sample used in a CryoET study is derived from.", @@ -1595,6 +1703,10 @@ "additionalProperties": false, "description": "High-level description of a cryoET dataset.", "properties": { + "assay": { + "$ref": "#/$defs/Assay", + "description": "The assay that was used to create the dataset." + }, "authors": { "description": "Author of a scientific data entity.", "items": { @@ -1663,6 +1775,14 @@ "$ref": "#/$defs/DateStamp", "description": "A set of dates at which a data item was deposited, published and last modified." }, + "development_stage": { + "$ref": "#/$defs/DevelopmentStageDetails", + "description": "The development stage of the patients or organisms from which assayed biosamples were derived." + }, + "disease": { + "$ref": "#/$defs/Disease", + "description": "The disease or condition of the patients from which assayed biosamples were derived." + }, "funding": { "description": "A funding source for a scientific data entity (base for JSON and DB representation).", "items": { @@ -1708,7 +1828,7 @@ "sample_type": { "$ref": "#/$defs/SampleTypeEnum", "description": "Type of sample imaged in a CryoET study.", - "pattern": "(^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$)" + "pattern": "(^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$)" }, "tissue": { "anyOf": [ @@ -1728,7 +1848,10 @@ "dataset_description", "dates", "authors", - "sample_type" + "sample_type", + "assay", + "development_stage", + "disease" ], "title": "Dataset", "type": "object" @@ -1737,6 +1860,10 @@ "additionalProperties": false, "description": "Metadata describing a dataset.", "properties": { + "assay": { + "$ref": "#/$defs/Assay", + "description": "The assay that was used to create the dataset." + }, "authors": { "description": "Author of a scientific data entity.", "items": { @@ -1809,6 +1936,14 @@ "description": "An identifier for a CryoET deposition, assigned by the Data Portal. Used to identify the deposition the entity is a part of.", "type": "integer" }, + "development_stage": { + "$ref": "#/$defs/DevelopmentStageDetails", + "description": "The development stage of the patients or organisms from which assayed biosamples were derived." + }, + "disease": { + "$ref": "#/$defs/Disease", + "description": "The disease or condition of the patients from which assayed biosamples were derived." + }, "funding": { "description": "A funding source for a scientific data entity (base for JSON and DB representation).", "items": { @@ -1862,7 +1997,7 @@ "sample_type": { "$ref": "#/$defs/SampleTypeEnum", "description": "Type of sample imaged in a CryoET study.", - "pattern": "(^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$)" + "pattern": "(^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$)" }, "tissue": { "anyOf": [ @@ -1885,7 +2020,10 @@ "dataset_description", "dates", "authors", - "sample_type" + "sample_type", + "assay", + "development_stage", + "disease" ], "title": "DatasetMetadata", "type": "object" @@ -2112,10 +2250,86 @@ "title": "DepositionTypesEnum", "type": "string" }, + "DevelopmentStageDetails": { + "additionalProperties": false, + "description": "The development stage of the patients or organisms from which assayed biosamples were derived.", + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^unknown$", + "type": "string" + }, + { + "pattern": "WBls:[0-9]{7}$", + "type": "string" + }, + { + "pattern": "^UBERON:[0-9]{7}$", + "type": "string" + }, + { + "pattern": "HsapDv:[0-9]{7}$", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A placeholder for any type of data.", + "pattern": "(^unknown$)|(WBls:[0-9]{7}$)|(^UBERON:[0-9]{7}$)|(HsapDv:[0-9]{7}$)" + }, + "name": { + "description": "Name of the developmental stage component.", + "type": [ + "string", + "null" + ] + } + }, + "title": "DevelopmentStageDetails", + "type": "object" + }, + "Disease": { + "additionalProperties": false, + "description": "The disease or condition of the patients from which assayed biosamples were derived.", + "properties": { + "id": { + "anyOf": [ + { + "pattern": "^MONDO:[0-9]{7}$", + "type": "string" + }, + { + "pattern": "^PATO:[0-9]{7}$", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A placeholder for any type of data.", + "pattern": "(^MONDO:[0-9]{7}$)|(^PATO:[0-9]{7}$)" + }, + "name": { + "description": "Name of the disease.", + "type": [ + "string", + "null" + ] + } + }, + "title": "Disease", + "type": "object" + }, "ExperimentMetadata": { "additionalProperties": false, "description": "Metadata describing sample and sample preparation methods used in a cryoET dataset.", "properties": { + "assay": { + "$ref": "#/$defs/Assay", + "description": "The assay that was used to create the dataset." + }, "cell_component": { "anyOf": [ { @@ -2149,6 +2363,14 @@ ], "description": "The cell type from which the sample was derived." }, + "development_stage": { + "$ref": "#/$defs/DevelopmentStageDetails", + "description": "The development stage of the patients or organisms from which assayed biosamples were derived." + }, + "disease": { + "$ref": "#/$defs/Disease", + "description": "The disease or condition of the patients from which assayed biosamples were derived." + }, "grid_preparation": { "description": "Describes Cryo-ET grid preparation.", "type": [ @@ -2184,7 +2406,7 @@ "sample_type": { "$ref": "#/$defs/SampleTypeEnum", "description": "Type of sample imaged in a CryoET study.", - "pattern": "(^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$)" + "pattern": "(^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$)" }, "tissue": { "anyOf": [ @@ -2199,7 +2421,10 @@ } }, "required": [ - "sample_type" + "sample_type", + "assay", + "development_stage", + "disease" ], "title": "ExperimentMetadata", "type": "object" @@ -2775,14 +3000,16 @@ "SampleTypeEnum": { "description": "Type of sample imaged in a CryoET study.", "enum": [ - "cell", - "tissue", - "organism", - "organelle", - "virus", - "in_vitro", + "cell_line", "in_silico", - "other" + "in_vitro", + "organelle", + "organism", + "organoid", + "other", + "primary_cell_culture", + "tissue", + "virus" ], "title": "SampleTypeEnum", "type": "string" @@ -3423,12 +3650,25 @@ "description": "The type of tissue from which the sample was derived.", "properties": { "id": { - "description": "The UBERON identifier for the tissue.", - "pattern": "^BTO:[0-9]{7}$", - "type": [ - "string", - "null" - ] + "anyOf": [ + { + "pattern": "^CL:[0-9]{7}$", + "type": "string" + }, + { + "pattern": "WBbt:[0-9]{7}$", + "type": "string" + }, + { + "pattern": "^UBERON:[0-9]{7}$", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A placeholder for any type of data.", + "pattern": "(^CL:[0-9]{7}$)|(WBbt:[0-9]{7}$)|(^UBERON:[0-9]{7}$)" }, "name": { "description": "Name of the tissue from which a biological sample used in a CryoET study is derived from.", diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml b/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml index 2a3675d2b..cc9fa1664 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml @@ -299,30 +299,78 @@ types: from_schema: metadata base: str pattern: ^BTO:[0-9]{7}$ + UBERON_ID: + name: UBERON_ID + description: An UBERON identifier + from_schema: metadata + base: str + pattern: ^UBERON:[0-9]{7}$ CL_ID: name: CL_ID description: A Cell Ontology identifier from_schema: metadata base: str pattern: ^CL:[0-9]{7}$ + CVCL_ID: + name: CVCL_ID + description: A Cellosaurus identifier + from_schema: metadata + base: str + pattern: ^CVCL_[A-Z0-9]{4,}$ + CC_ID: + name: CC_ID + description: A Cell Culture Collection identifier + from_schema: metadata + base: str + pattern: ^CC-[0-9]{4}$ GO_ID: name: GO_ID description: A Gene Ontology identifier from_schema: metadata base: str pattern: ^GO:[0-9]{7}$ + EFO_ID: + name: EFO_ID + description: An Experimental Factor Ontology identifier + from_schema: metadata + base: str + pattern: ^EFO:[0-9]{7}$ UNIPROT_ID: name: UNIPROT_ID description: A UniProt identifier from_schema: metadata base: str pattern: ^UniProtKB:[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}$ - WORMBASE_ID: - name: WORMBASE_ID - description: A WormBase identifier + NCBI_TAXON_ID: + name: NCBI_TAXON_ID + description: A NCBI Taxonomy identifier + from_schema: metadata + base: str + pattern: ^NCBITaxon:[0-9]+$ + WORMBASE_STRAIN_ID: + name: WORMBASE_STRAIN_ID + description: A WormBase strain identifier from_schema: metadata base: str pattern: WBStrain[0-9]{8}$ + WORMBASE_TISSUE_ID: + name: WORMBASE_TISSUE_ID + description: A WormBase tissue identifier + from_schema: metadata + base: str + pattern: WBbt:[0-9]{7}$ + WORMBASE_DEVELOPMENT_ID: + name: WORMBASE_DEVELOPMENT_ID + description: A WormBase identifier + from_schema: metadata + base: str + pattern: WBls:[0-9]{7}$ + HSAPDV_ID: + name: HSAPDV_ID + description: A Human Developmental Phenotype Ontology identifier + from_schema: metadata + base: str + pattern: HsapDv:[0-9]{7}$ ONTOLOGY_ID: name: ONTOLOGY_ID description: An ontology identifier @@ -371,6 +419,24 @@ types: from_schema: metadata base: str pattern: ^(EMPIAR-[0-9]{5}|EMD-[0-9]{4,5}|(doi:)?10\.[0-9]{4,9}/[-._;()/:a-zA-Z0-9]+|PDB-[0-9a-zA-Z]{4,8})(\s*,\s*(EMPIAR-[0-9]{5}|EMD-[0-9]{4,5}|(doi:)?10\.[0-9]{4,9}/[-._;()/:a-zA-Z0-9]+|PDB-[0-9a-zA-Z]{4,8}))*$ + MONDO_ID: + name: MONDO_ID + description: An identifier of type MONDO + from_schema: metadata + base: str + pattern: ^MONDO:[0-9]{7}$ + PATO_ID: + name: PATO_ID + description: An identifier of type PATO + from_schema: metadata + base: str + pattern: ^PATO:[0-9]{7}$ + UNKNOWN_LITERAL: + name: UNKNOWN_LITERAL + description: A placeholder for an unknown value. + from_schema: metadata + base: str + pattern: ^unknown$ enums: alignment_type_enum: name: alignment_type_enum @@ -527,31 +593,37 @@ enums: description: Type of sample imaged in a CryoET study. from_schema: metadata permissible_values: - cell: - text: cell - description: Tomographic data of whole cells or cell sections. - tissue: - text: tissue - description: Tomographic data of tissue sections. - organism: - text: organism - description: Tomographic data of sections through multicellular organisms. - organelle: - text: organelle - description: Tomographic data of purified organelles. - virus: - text: virus - description: Tomographic data of purified viruses or VLPs. + cell_line: + text: cell_line + description: Tomographic data of immortalized cells or immortalized cell sections + in_silico: + text: in_silico + description: Simulated tomographic data. in_vitro: text: in_vitro description: Tomographic data of in vitro reconstituted systems or mixtures of proteins. - in_silico: - text: in_silico - description: Simulated tomographic data. + organelle: + text: organelle + description: Tomographic data of purified organelles. + organism: + text: organism + description: Tomographic data of sections through multicellular organisms. + organoid: + text: organoid + description: Tomographic data of organoid-derived samples. other: text: other description: Other type of sample. + primary_cell_culture: + text: primary_cell_culture + description: Tomographic data of whole primary cells or primary cell sections. + tissue: + text: tissue + description: Tomographic data of tissue sections. + virus: + text: virus + description: Tomographic data of purified viruses or VLPs. tiltseries_camera_acquire_mode_enum: name: tiltseries_camera_acquire_mode_enum description: Camera acquisition mode @@ -915,6 +987,7 @@ classes: - Alignment - AnnotationOrientedPointFile - AnnotationInstanceSegmentationFile + - AnnotationInstanceSegmentationMaskFile - AnnotationPointFile - AnnotationSegmentationMaskFile - AnnotationSemanticSegmentationMaskFile @@ -1009,6 +1082,7 @@ classes: - AnnotationSourceFile - AnnotationOrientedPointFile - AnnotationInstanceSegmentationFile + - AnnotationInstanceSegmentationMaskFile - AnnotationPointFile - AnnotationSegmentationMaskFile - AnnotationSemanticSegmentationMaskFile @@ -1637,7 +1711,7 @@ classes: required: true inlined: true inlined_as_list: true - pattern: (^cell$)|(^tissue$)|(^organism$)|(^organelle$)|(^virus$)|(^in_vitro$)|(^in_silico$)|(^other$) + pattern: (^cell_line$)|(^in_silico$)|(^in_vitro$)|(^organelle$)|(^organism$)|(^organoid$)|(^other$)|(^primary_cell_culture$)|(^tissue$)|(^virus$) sample_preparation: name: sample_preparation description: Describes how the sample was prepared. @@ -1744,6 +1818,47 @@ classes: range: CellComponent inlined: true inlined_as_list: true + assay: + name: assay + description: The assay that was used to create the dataset. + from_schema: metadata + alias: assay + owner: DatasetMetadata + domain_of: + - ExperimentMetadata + - Dataset + range: Assay + required: true + inlined: true + inlined_as_list: true + development_stage: + name: development_stage + description: The development stage of the patients or organisms from which + assayed biosamples were derived. + from_schema: metadata + alias: development_stage + owner: DatasetMetadata + domain_of: + - ExperimentMetadata + - Dataset + range: DevelopmentStageDetails + required: true + inlined: true + inlined_as_list: true + disease: + name: disease + description: The disease or condition of the patients from which assayed biosamples + were derived. + from_schema: metadata + alias: disease + owner: DatasetMetadata + domain_of: + - ExperimentMetadata + - Dataset + range: Disease + required: true + inlined: true + inlined_as_list: true DepositionMetadata: name: DepositionMetadata description: 'Metadata describing a deposition. @@ -2809,6 +2924,7 @@ classes: - AnnotationSourceFile - AnnotationOrientedPointFile - AnnotationInstanceSegmentationFile + - AnnotationInstanceSegmentationMaskFile - AnnotationPointFile - AnnotationSegmentationMaskFile - AnnotationSemanticSegmentationMaskFile @@ -3004,6 +3120,9 @@ classes: domain_of: - AuthorMixin - Author + - Assay + - DevelopmentStageDetails + - Disease - OrganismDetails - TissueDetails - CellType From c4527dae439f9328c2fce077be5bcd823ec5a117 Mon Sep 17 00:00:00 2001 From: aranega Date: Thu, 4 Sep 2025 08:17:47 -0600 Subject: [PATCH 03/29] feat: add instance segmentation mask class and instance creation --- apiv2/schema/schema.yaml | 3 +++ ingestion_tools/dataset_configs/10441.yaml | 4 ++++ ingestion_tools/scripts/importers/annotation.py | 7 +++++++ ingestion_tools/scripts/importers/visualization_config.py | 1 + 4 files changed, 15 insertions(+) diff --git a/apiv2/schema/schema.yaml b/apiv2/schema/schema.yaml index fc5314b31..f1b7c64d6 100644 --- a/apiv2/schema/schema.yaml +++ b/apiv2/schema/schema.yaml @@ -279,6 +279,9 @@ enums: InstanceSegmentation: text: InstanceSegmentation description: A volume with labels for multiple instances + InstanceSegmentationMask: + text: InstanceSegmentationMask + description: A mask with labels for multiple instances Mesh: text: Mesh description: A surface mesh volumes diff --git a/ingestion_tools/dataset_configs/10441.yaml b/ingestion_tools/dataset_configs/10441.yaml index a5d01169c..918235daa 100644 --- a/ingestion_tools/dataset_configs/10441.yaml +++ b/ingestion_tools/dataset_configs/10441.yaml @@ -210,6 +210,10 @@ annotations: glob_strings: *id004 is_visualization_default: true mask_label: 7 + - InstanceSegmentationMask: + file_format: mrc + glob_strings: *id004 + is_visualization_default: true - OrientedPoint: binning: 10 file_format: relion3_star diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index 2a32e4fd0..eec47e39f 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -104,6 +104,8 @@ def _instantiate( anno = PointAnnotation(**instance_args) if shape == "InstanceSegmentation": anno = InstanceSegmentationAnnotation(**instance_args) + if shape == "InstanceSegmentationMask": + anno = InstanceSegmentationMaskAnnotation(**instance_args) if shape == "TriangularMesh": anno = TriangularMeshAnnotation(**instance_args) if shape == "TriangularMeshGroup": @@ -313,6 +315,11 @@ def convert(self, output_prefix: str): ) +class InstanceSegmentationMaskAnnotation(SegmentationMaskAnnotation): + shape = "InstanceSegmentationMask" + + + class SemanticSegmentationMaskAnnotation(VolumeAnnotationSource): shape = "SegmentationMask" # Don't expose SemanticSegmentationMask to the public portal. mask_label: int diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 73031952a..f84587cc0 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -162,6 +162,7 @@ def get_annotation_layer_info(self, alignment_metadata_path: str) -> dict[str, A "Point", "OrientedPoint", "InstanceSegmentation", + "InstanceSegmentationMask", "TriangularMesh", "TriangularMeshGroup", }: From 2bb7506d68ef8d2c8f9c13ac38c3b5c22bedf547 Mon Sep 17 00:00:00 2001 From: aranega Date: Thu, 4 Sep 2025 08:21:17 -0600 Subject: [PATCH 04/29] chore: remove debug/test code in configuration 10441.yaml --- ingestion_tools/dataset_configs/10441.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ingestion_tools/dataset_configs/10441.yaml b/ingestion_tools/dataset_configs/10441.yaml index 918235daa..a5d01169c 100644 --- a/ingestion_tools/dataset_configs/10441.yaml +++ b/ingestion_tools/dataset_configs/10441.yaml @@ -210,10 +210,6 @@ annotations: glob_strings: *id004 is_visualization_default: true mask_label: 7 - - InstanceSegmentationMask: - file_format: mrc - glob_strings: *id004 - is_visualization_default: true - OrientedPoint: binning: 10 file_format: relion3_star From bdf008517a36c3f1e8af28a1003d820f1f7cf12a Mon Sep 17 00:00:00 2001 From: aranega Date: Fri, 12 Sep 2025 07:58:03 -0600 Subject: [PATCH 05/29] feat: remove the instancesegmentation mask from v1, and enhance it for v2 --- ingestion_tools/dataset_configs/template.yaml | 3 +++ ingestion_tools/scripts/importers/annotation.py | 17 ++++++++++++++++- schema/core/v1.1.0/metadata.yaml | 7 ------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ingestion_tools/dataset_configs/template.yaml b/ingestion_tools/dataset_configs/template.yaml index 84ad934bd..22369b8c1 100644 --- a/ingestion_tools/dataset_configs/template.yaml +++ b/ingestion_tools/dataset_configs/template.yaml @@ -98,6 +98,9 @@ annotations: OPTIONAL glob_string: see InstanceSegmentation.glob_string glob_strings: see InstanceSegmentation.glob_strings is_visualization_default: see InstanceSegmentation.is_visualization_default + is_portal_standard: OPTIONAL, BOOLEAN (DEFAULT FALSE) + scale_factor: OPTIONAL, FLOAT (DEFAULT 1) (POSITIVE) + mask_label: OPTIONAL, INTEGER (DEFAULT 1) parent_filters: see InstanceSegmentation.parent_filters exclude: SEE InstanceSegmentation.exclude - SegmentationMask: diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index eec47e39f..e617b5db7 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -315,9 +315,24 @@ def convert(self, output_prefix: str): ) -class InstanceSegmentationMaskAnnotation(SegmentationMaskAnnotation): +class InstanceSegmentationMaskAnnotation(VolumeAnnotationSource): shape = "InstanceSegmentationMask" + mask_label: int + scale_factor: float + is_portal_standard: bool + def __init__( + self, + mask_label: int | None = None, + scale_factor: float = 1.0, + is_portal_standard: bool = False, + *args, + **kwargs, + ) -> None: + super().__init__(*args, **kwargs) + self.mask_label = mask_label if mask_label else 1 + self.scale_factor = scale_factor + self.is_portal_standard = is_portal_standard class SemanticSegmentationMaskAnnotation(VolumeAnnotationSource): diff --git a/schema/core/v1.1.0/metadata.yaml b/schema/core/v1.1.0/metadata.yaml index 581a37785..5738dc08d 100644 --- a/schema/core/v1.1.0/metadata.yaml +++ b/schema/core/v1.1.0/metadata.yaml @@ -629,13 +629,6 @@ classes: description: File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes. attributes: # no extended attributes - AnnotationInstanceSegmentationMaskFile: - is_a: AnnotationOrientedPointFile - aliases: - - InstanceSegmentationMask - description: File and sourcing data for an instance segmentation mask annotation. Annotation that identifies individual instances of object shape masks. - attributes: # no extended attributes - AnnotationPointFile: is_a: AnnotationSourceFile aliases: From 598e594d460d8cce8dde1f373382cf73b7d1db6a Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 1 Oct 2025 17:08:33 -0600 Subject: [PATCH 06/29] feat: add first steps for the InstanceSegmentationMask ingestion --- .../scripts/importers/annotation.py | 17 +++++++++- .../scripts/importers/visualization_config.py | 8 +++-- .../importers/visualization_precompute.py | 32 ++++++++++++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index 4d95f5310..a5f620f93 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -319,7 +319,7 @@ def convert(self, output_prefix: str): class InstanceSegmentationMaskAnnotation(VolumeAnnotationSource): - shape = "InstanceSegmentationMask" + shape = "SegmentationMask" mask_label: int scale_factor: float is_portal_standard: bool @@ -337,6 +337,21 @@ def __init__( self.scale_factor = scale_factor self.is_portal_standard = is_portal_standard + def convert(self, output_prefix: str): + # output_dims = self.get_output_dim() if self.rescale else None + output_dims = None + + return make_pyramids( + self.config.fs, + self.get_output_filename(output_prefix), + self.path, + label=self.mask_label, + write_mrc=self.config.write_mrc, + write_zarr=self.config.write_zarr, + voxel_spacing=self.get_voxel_spacing().as_float(), + scale_0_dims=output_dims, + ) + class SemanticSegmentationMaskAnnotation(VolumeAnnotationSource): shape = "SegmentationMask" # Don't expose SemanticSegmentationMask to the public portal. diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index bb87fb108..f88315db6 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -164,7 +164,6 @@ def get_annotation_layer_info(self, alignment_metadata_path: str) -> dict[str, A "Point", "OrientedPoint", "InstanceSegmentation", - "InstanceSegmentationMask", "TriangularMesh", "TriangularMeshGroup", }: @@ -246,7 +245,12 @@ def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: for _, info in annotation_layer_info.items(): args = {**info["args"], "resolution": resolution} shape = info["shape"] - if shape == "SegmentationMask": + if shape == "SegmentationMask" and shape == "InstanceSegmentationMask": + if shape == "InstanceSegmentationMask": + print("\nInstanceSegmentationMask!\n") + else: + print("\nSegmentation mask", info) + print() layers.append(self._to_segmentation_mask_layer(**args)) elif shape in {"Point", "OrientedPoint", "InstanceSegmentation"}: if shape == "OrientedPoint": diff --git a/ingestion_tools/scripts/importers/visualization_precompute.py b/ingestion_tools/scripts/importers/visualization_precompute.py index e3640cbc0..d81aa6e7d 100644 --- a/ingestion_tools/scripts/importers/visualization_precompute.py +++ b/ingestion_tools/scripts/importers/visualization_precompute.py @@ -10,6 +10,7 @@ AbstractTriangularMeshAnnotation, BaseAnnotationSource, InstanceSegmentationAnnotation, + InstanceSegmentationMaskAnnotation, OrientedPointAnnotation, VolumeAnnotationSource, ) @@ -71,8 +72,10 @@ def load(cls, annotation: BaseAnnotationSource, config: DepositionImportConfig) return OrientedPointAnnotationPrecompute(**params) elif shape == "InstanceSegmentation": return InstanceSegmentationAnnotationPrecompute(**params) - elif shape == "SegmentationMask" or shape == "SemanticSegmentationMask": + elif shape in ["SegmentationMask", "SemanticSegmentationMask"]: return SegmentationMaskAnnotationPrecompute(**params) + elif shape == "InstanceSegmentationMask": + return InstanceSegmentationMaskAnnotationPrecompute(**params) elif shape == "TriangularMesh": return MeshAnnotatationPrecompute(**params) @@ -213,6 +216,33 @@ def neuroglancer_precompute(self, output_prefix: str, voxel_spacing: float) -> N fs.push(tmp_path) +class InstanceSegmentationMaskAnnotationPrecompute(BaseAnnotationPrecompute): + annotation: InstanceSegmentationMaskAnnotation + + def _get_shape(self) -> str: + return "SegmentationMask" + + def neuroglancer_precompute(self, output_prefix: str, voxel_spacing: float) -> None: + fs = self.config.fs + annotation_path = self.annotation.get_output_path() + precompute_path = self._get_neuroglancer_precompute_path(annotation_path, output_prefix) + tmp_path = fs.localwritable(precompute_path) + zarr_file_path = fs.destformat(self.annotation.get_output_filename(annotation_path, "zarr")) + # Importing this at runtime instead of compile time since zfpy (a dependency of this + # module) cannot be imported successfully on darwin/ARM machines. + from cryoet_data_portal_neuroglancer.precompute import segmentation_mask + + resolution_in_nm = voxel_spacing * 0.1 # original in angstrom + segmentation_mask.encode_segmentation( + zarr_file_path, + Path(tmp_path), + resolution=(resolution_in_nm,) * 3, + delete_existing=True, + include_mesh=True, + ) + fs.push(tmp_path) + + class MeshAnnotatationPrecompute(BaseAnnotationPrecompute): annotation: AbstractTriangularMeshAnnotation From 00a379dd73ff999a7a5fbf9b036ddfe3ba490224 Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 1 Oct 2025 17:46:47 -0600 Subject: [PATCH 07/29] fix: remove bad guard and simplify it --- ingestion_tools/scripts/importers/visualization_config.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index f88315db6..c3d171ae8 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -245,12 +245,7 @@ def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: for _, info in annotation_layer_info.items(): args = {**info["args"], "resolution": resolution} shape = info["shape"] - if shape == "SegmentationMask" and shape == "InstanceSegmentationMask": - if shape == "InstanceSegmentationMask": - print("\nInstanceSegmentationMask!\n") - else: - print("\nSegmentation mask", info) - print() + if shape == "SegmentationMask": layers.append(self._to_segmentation_mask_layer(**args)) elif shape in {"Point", "OrientedPoint", "InstanceSegmentation"}: if shape == "OrientedPoint": From 6dec931828e5daa2da2b09710b7282001161adaa Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 1 Oct 2025 18:20:42 -0600 Subject: [PATCH 08/29] feat: add dedicated shape for the InstanceSegmentationMask --- ingestion_tools/scripts/importers/annotation.py | 2 +- ingestion_tools/scripts/importers/visualization_config.py | 3 +++ ingestion_tools/scripts/importers/visualization_precompute.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index a5f620f93..619dc885b 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -319,7 +319,7 @@ def convert(self, output_prefix: str): class InstanceSegmentationMaskAnnotation(VolumeAnnotationSource): - shape = "SegmentationMask" + shape = "InstanceSegmentationMask" mask_label: int scale_factor: float is_portal_standard: bool diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index c3d171ae8..88b730948 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -166,6 +166,7 @@ def get_annotation_layer_info(self, alignment_metadata_path: str) -> dict[str, A "InstanceSegmentation", "TriangularMesh", "TriangularMeshGroup", + "InstanceSegmentationMask", }: print(f"Skipping file with unknown shape {shape}") continue @@ -247,6 +248,8 @@ def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: shape = info["shape"] if shape == "SegmentationMask": layers.append(self._to_segmentation_mask_layer(**args)) + elif shape == "InstanceSegmentationMask": + print("\nGENERATE DEDICATED CONFIG LAYER HERE\n") elif shape in {"Point", "OrientedPoint", "InstanceSegmentation"}: if shape == "OrientedPoint": # Check if oriented point has produced meshes diff --git a/ingestion_tools/scripts/importers/visualization_precompute.py b/ingestion_tools/scripts/importers/visualization_precompute.py index d81aa6e7d..ff01605fd 100644 --- a/ingestion_tools/scripts/importers/visualization_precompute.py +++ b/ingestion_tools/scripts/importers/visualization_precompute.py @@ -220,7 +220,7 @@ class InstanceSegmentationMaskAnnotationPrecompute(BaseAnnotationPrecompute): annotation: InstanceSegmentationMaskAnnotation def _get_shape(self) -> str: - return "SegmentationMask" + return "InstanceSegmentationMask" def neuroglancer_precompute(self, output_prefix: str, voxel_spacing: float) -> None: fs = self.config.fs From 5d6ac85a3c34929c79f4ef8531a4f9b43646989c Mon Sep 17 00:00:00 2001 From: Sean Martin Date: Thu, 2 Oct 2025 13:42:35 +0200 Subject: [PATCH 09/29] fix: remove labels param to convert function of instance seg masks this was causing all data to be one singular label --- ingestion_tools/scripts/importers/annotation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index 619dc885b..d50793f17 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -345,7 +345,6 @@ def convert(self, output_prefix: str): self.config.fs, self.get_output_filename(output_prefix), self.path, - label=self.mask_label, write_mrc=self.config.write_mrc, write_zarr=self.config.write_zarr, voxel_spacing=self.get_voxel_spacing().as_float(), From 6101bb24cf51354c148e2e5a26cee7d8c1ab2459 Mon Sep 17 00:00:00 2001 From: Sean Martin Date: Thu, 2 Oct 2025 16:57:51 +0200 Subject: [PATCH 10/29] feat: allow passing seg list into gen and v1 of instance seg mask config --- .../scripts/importers/visualization_config.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 88b730948..6b88f2b11 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -76,6 +76,7 @@ def _to_segmentation_mask_layer( name_prefix: str, color: str, resolution: tuple[float, float, float], + visible_segments: tuple[int, ...] = (1,), **kwargs, ) -> dict[str, Any]: return state_generator.generate_segmentation_mask_layer( @@ -85,6 +86,7 @@ def _to_segmentation_mask_layer( color=color, scale=resolution, is_visible=file_metadata.get("is_visualization_default"), + visible_segments=visible_segments, ) def _to_point_layer( @@ -249,7 +251,13 @@ def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: if shape == "SegmentationMask": layers.append(self._to_segmentation_mask_layer(**args)) elif shape == "InstanceSegmentationMask": - print("\nGENERATE DEDICATED CONFIG LAYER HERE\n") + # We have to load the ome zarr file and get the + # unique non zero labels and then set of those as visible + # zarr_path = args["source_path"] + # Unsure how to get the base dir of the above zarr path? + # Hard coding for the segments to show + visible_segments = (1, 2) + layers.append(self._to_segmentation_mask_layer(visible_segments=visible_segments, **args)) elif shape in {"Point", "OrientedPoint", "InstanceSegmentation"}: if shape == "OrientedPoint": # Check if oriented point has produced meshes From 129fde57b568ce42e2be856b9a916efc600d6c32 Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 7 Oct 2025 05:35:18 -0600 Subject: [PATCH 11/29] feat: Add configuration generation for InstanceSegmentationMask --- ingestion_tools/scripts/common/image.py | 51 ++++++++++++++++- .../scripts/importers/annotation.py | 6 +- .../scripts/importers/visualization_config.py | 57 ++++++++++++------- 3 files changed, 90 insertions(+), 24 deletions(-) diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index 656392c62..7c26051ac 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -1,6 +1,7 @@ import json import os import os.path +import time from abc import ABC, abstractmethod from dataclasses import dataclass from datetime import datetime @@ -446,6 +447,50 @@ def has_label(self) -> bool: return bool(np.any(self.volume_reader.get_pyramid_base_data() == self.label)) +class MultiLabelMaskConverter(TomoConverter): + def __init__( + self, + fs: FileSystemApi, + filename: str, + header_only: bool = False, + scale_0_dims: tuple[int, int, int] | None = None, + ): + super().__init__(fs=fs, filename=filename, header_only=header_only, scale_0_dims=scale_0_dims) + + def get_pyramid_base_data(self) -> np.ndarray: + data = self.volume_reader.get_pyramid_base_data() + + if not self.scale_0_dims: + return self.scaled_data_transformation(data) + + t = time.perf_counter() + from scipy.ndimage import zoom + + x, y, z = data.shape + nx, ny, nz = self.scale_0_dims + zoom_factor = (nx / x, ny / y, nz / z) + + # rescaled = rescale( + # data, + # scale=zoom_factor, + # order=0, + # preserve_range=True, + # anti_aliasing=False, + # ) + + rescaled = zoom(data, zoom=zoom_factor, order=0) + print(f"Rescaled in {time.perf_counter() - t:.3f}") + + return self.scaled_data_transformation(rescaled) + + @classmethod + def scaled_data_transformation(cls, data: np.ndarray) -> np.ndarray: + # For instance segmentation masks we have multiple labels, so we want an uint 32 output. + # downscale_local_mean will return float array even for bool input with non-binary values + # return data.astype(np.uint32) + return data + + def get_volume_metadata(config: DepositionImportConfig, output_prefix: str) -> dict[str, Any]: # Generates metadata related to volume files. scales = [] @@ -494,7 +539,10 @@ def get_converter( label: int | None = None, scale_0_dims: tuple[int, int, int] | None = None, threshold: float | None = None, + multilabels: bool = False, ) -> TomoConverter | MaskConverter: + if multilabels: + return MultiLabelMaskConverter(fs, tomo_filename, scale_0_dims=scale_0_dims) if label is not None: return MaskConverter(fs, tomo_filename, label, scale_0_dims=scale_0_dims, threshold=threshold) return TomoConverter(fs, tomo_filename, scale_0_dims=scale_0_dims) @@ -512,8 +560,9 @@ def make_pyramids( label: int = None, scale_0_dims=None, threshold: float | None = None, + multilabels: bool = False, ): - tc = get_converter(fs, tomo_filename, label, scale_0_dims, threshold) + tc = get_converter(fs, tomo_filename, label, scale_0_dims, threshold, multilabels=multilabels) pyramid, pyramid_voxel_spacing = tc.make_pyramid(scale_z_axis=scale_z_axis, voxel_spacing=voxel_spacing) _ = tc.pyramid_to_omezarr( fs, diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index d50793f17..eea2984f7 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -339,16 +339,18 @@ def __init__( def convert(self, output_prefix: str): # output_dims = self.get_output_dim() if self.rescale else None - output_dims = None + output_dims = self.get_output_dim() + # output_dims = None return make_pyramids( self.config.fs, self.get_output_filename(output_prefix), self.path, - write_mrc=self.config.write_mrc, + write_mrc=False, write_zarr=self.config.write_zarr, voxel_spacing=self.get_voxel_spacing().as_float(), scale_0_dims=output_dims, + multilabels=True, ) diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 6b88f2b11..14e7c7163 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -9,7 +9,7 @@ from common import colors from common.colors import generate_hash, to_base_hash_input from common.finders import DefaultImporterFactory -from common.image import VolumeInfo +from common.image import VolumeInfo, ZarrReader from common.metadata import NeuroglancerMetadata from importers.annotation import OrientedPointAnnotation from importers.base_importer import BaseImporter @@ -74,7 +74,7 @@ def _to_segmentation_mask_layer( source_path: str, file_metadata: dict[str, Any], name_prefix: str, - color: str, + color: str | dict[int, str], resolution: tuple[float, float, float], visible_segments: tuple[int, ...] = (1,), **kwargs, @@ -180,26 +180,36 @@ def get_annotation_layer_info(self, alignment_metadata_path: str) -> dict[str, A print(f"Skipping file with unsupported format {file.get('format')}") continue + nb_colors = 1 + visible_segments = None + if shape == "InstanceSegmentationMask": + # We load the ome zarr file and get the unique non zero labels and then set of those as visible + visible_segments = self._get_labels(file.get("path")) + nb_colors = len(visible_segments) + color_seed = generate_hash({**annotation_hash_input, **{"shape": shape}}) - hex_colors, float_colors = colors.get_hex_colors(1, exclude=colors_used, seed=color_seed) + hex_colors, float_colors = colors.get_hex_colors(nb_colors, exclude=colors_used, seed=color_seed) path = self.config.to_formatted_path( os.path.join(precompute_path, f"{metadata_file_name}_{shape.lower()}"), ) - is_instance_seg = shape == "InstanceSegmentation" + is_instance_seg = shape == "InstanceSegmentation" or shape == "InstanceSegmentationMask" - annotation_layer_info[file.get("path")] = { + args = { + "source_path": path, + "file_metadata": file, + "name_prefix": name_prefix, + "color": hex_colors[0], "shape": shape, - "args": { - "source_path": path, - "file_metadata": file, - "name_prefix": name_prefix, - "color": hex_colors[0], - "shape": shape, - }, } + if shape == "InstanceSegmentationMask": + args["visible_segments"] = visible_segments + args["color"] = dict(zip(visible_segments, hex_colors)) + + annotation_layer_info[file.get("path")] = {"shape": shape, "args": args} + if not is_instance_seg: colors_used.append(float_colors[0]) @@ -229,6 +239,18 @@ def _has_oriented_mesh(self, path: str): mesh_folder_path = os.path.join(self.config.output_prefix, oriented_mesh_filename) return fs.exists(mesh_folder_path) + def _get_labels(self, path: str): + segmentation_filename = os.path.join(self.config.output_prefix, path) + + # Get labels iterating by chunks over the tab + # We lazy import dask and numpy + import dask.array as da + import numpy as np + + reader = ZarrReader(self.config.fs, segmentation_filename) + arr = reader.get_data() + return tuple(set(da.unique(arr[arr > 0]).compute().astype(np.integer))) + def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: tomogram = self.get_tomogram() volume_info = tomogram.get_output_volume_info() @@ -240,6 +262,7 @@ def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: t = time() print("Start contrast limit computation for", tomogram) contrast_limits = tomogram.get_contrast_limits() + print(f"Computed contrast limit {contrast_limits} in {(time() - t):.2f}s") layers = [self._to_tomogram_layer(tomogram, volume_info, resolution, contrast_limits)] @@ -248,16 +271,8 @@ def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: for _, info in annotation_layer_info.items(): args = {**info["args"], "resolution": resolution} shape = info["shape"] - if shape == "SegmentationMask": + if shape == "SegmentationMask" or shape == "InstanceSegmentationMask": layers.append(self._to_segmentation_mask_layer(**args)) - elif shape == "InstanceSegmentationMask": - # We have to load the ome zarr file and get the - # unique non zero labels and then set of those as visible - # zarr_path = args["source_path"] - # Unsure how to get the base dir of the above zarr path? - # Hard coding for the segments to show - visible_segments = (1, 2) - layers.append(self._to_segmentation_mask_layer(visible_segments=visible_segments, **args)) elif shape in {"Point", "OrientedPoint", "InstanceSegmentation"}: if shape == "OrientedPoint": # Check if oriented point has produced meshes From 0cf3ffeed7b668ce2441363641cbebdb2389aaf7 Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 7 Oct 2025 05:39:16 -0600 Subject: [PATCH 12/29] feat: Remove mask_label for InstanceSegmentationMask --- .../v2.0.0/codegen/metadata_materialized.yaml | 14 ++++++++++ schema/core/v2.0.0/codegen/metadata_models.py | 27 +++++++++++++++++-- .../v1.0.0/codegen/ingestion_config_models.py | 11 ++++++-- .../ingestion_config_models.schema.json | 7 +++++ .../v2.0.0/codegen/metadata_files.py | 15 +++++++++++ .../v2.0.0/codegen/metadata_files.schema.json | 21 +++++++++++++++ 6 files changed, 91 insertions(+), 4 deletions(-) diff --git a/schema/core/v2.0.0/codegen/metadata_materialized.yaml b/schema/core/v2.0.0/codegen/metadata_materialized.yaml index 23ea80991..ca2906edc 100644 --- a/schema/core/v2.0.0/codegen/metadata_materialized.yaml +++ b/schema/core/v2.0.0/codegen/metadata_materialized.yaml @@ -3984,6 +3984,20 @@ classes: range: string inlined: true inlined_as_list: true + mesh_source_path: + name: mesh_source_path + description: The path to the mesh source file associated with an oriented + point file. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_mesh_source_path + alias: mesh_source_path + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationOrientedPointFile + range: string + inlined: true + inlined_as_list: true file_format: name: file_format description: File format for this file diff --git a/schema/core/v2.0.0/codegen/metadata_models.py b/schema/core/v2.0.0/codegen/metadata_models.py index 0f56af729..feb2e8d55 100644 --- a/schema/core/v2.0.0/codegen/metadata_models.py +++ b/schema/core/v2.0.0/codegen/metadata_models.py @@ -3549,7 +3549,11 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): json_schema_extra={ "linkml_meta": { "alias": "mesh_source_path", - "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], "exact_mappings": ["cdp-common:annotation_source_file_mesh_source_path"], } }, @@ -3729,7 +3733,11 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): json_schema_extra={ "linkml_meta": { "alias": "mesh_source_path", - "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], "exact_mappings": ["cdp-common:annotation_source_file_mesh_source_path"], } }, @@ -3903,6 +3911,21 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): } }, ) + mesh_source_path: Optional[str] = Field( + None, + description="""The path to the mesh source file associated with an oriented point file.""", + json_schema_extra={ + "linkml_meta": { + "alias": "mesh_source_path", + "domain_of": [ + "AnnotationOrientedPointFile", + "AnnotationInstanceSegmentationFile", + "AnnotationInstanceSegmentationMaskFile", + ], + "exact_mappings": ["cdp-common:annotation_source_file_mesh_source_path"], + } + }, + ) file_format: str = Field( ..., description="""File format for this file""", diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py index a38911f7d..b3e364ce5 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py @@ -2206,7 +2206,8 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'ifabsent': 'string(xyz)'} }) mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', @@ -2297,7 +2298,8 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'ifabsent': 'string(xyz)'} }) mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile'], + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', @@ -2386,6 +2388,11 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) + mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json index 608ecbf69..416e74a6c 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json @@ -737,6 +737,13 @@ "null" ] }, + "mesh_source_path": { + "description": "The path to the mesh source file associated with an oriented point file.", + "type": [ + "string", + "null" + ] + }, "order": { "description": "The order of axes for an oriented point / instance segmentation annotation file.", "type": [ diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files.py b/schema/metadata_files/v2.0.0/codegen/metadata_files.py index 7a7179807..bcbdf1d0d 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files.py +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files.py @@ -2299,6 +2299,11 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) + mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', @@ -2389,6 +2394,11 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) + mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', @@ -2479,6 +2489,11 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) + mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', + 'domain_of': ['AnnotationOrientedPointFile', + 'AnnotationInstanceSegmentationFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json b/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json index 0655f3ac9..e87048c3b 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json @@ -652,6 +652,13 @@ "null" ] }, + "mesh_source_path": { + "description": "The path to the mesh source file associated with an oriented point file.", + "type": [ + "string", + "null" + ] + }, "order": { "description": "The order of axes for an oriented point / instance segmentation annotation file.", "type": [ @@ -720,6 +727,13 @@ "null" ] }, + "mesh_source_path": { + "description": "The path to the mesh source file associated with an oriented point file.", + "type": [ + "string", + "null" + ] + }, "order": { "description": "The order of axes for an oriented point / instance segmentation annotation file.", "type": [ @@ -1016,6 +1030,13 @@ "null" ] }, + "mesh_source_path": { + "description": "The path to the mesh source file associated with an oriented point file.", + "type": [ + "string", + "null" + ] + }, "order": { "description": "The order of axes for an oriented point / instance segmentation annotation file.", "type": [ From 7eccd55736a1f00555de9f89177689e01afe443c Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 8 Oct 2025 06:47:45 -0600 Subject: [PATCH 13/29] feat: add label computation and storing before configuration generation --- ingestion_tools/dataset_configs/template.yaml | 1 - ingestion_tools/scripts/common/image.py | 57 +++++++++++++++++-- .../scripts/importers/visualization_config.py | 19 ++++--- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/ingestion_tools/dataset_configs/template.yaml b/ingestion_tools/dataset_configs/template.yaml index 22369b8c1..4254d73f8 100644 --- a/ingestion_tools/dataset_configs/template.yaml +++ b/ingestion_tools/dataset_configs/template.yaml @@ -100,7 +100,6 @@ annotations: OPTIONAL is_visualization_default: see InstanceSegmentation.is_visualization_default is_portal_standard: OPTIONAL, BOOLEAN (DEFAULT FALSE) scale_factor: OPTIONAL, FLOAT (DEFAULT 1) (POSITIVE) - mask_label: OPTIONAL, INTEGER (DEFAULT 1) parent_filters: see InstanceSegmentation.parent_filters exclude: SEE InstanceSegmentation.exclude - SegmentationMask: diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index 7c26051ac..f1d3a90b6 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -1,7 +1,6 @@ import json import os import os.path -import time from abc import ABC, abstractmethod from dataclasses import dataclass from datetime import datetime @@ -54,12 +53,24 @@ class ZarrReader: def __init__(self, fs, zarrdir): self.fs = fs self.zarrdir = zarrdir + self._loc = None def get_data(self): - loc = ome_zarr.io.ZarrLocation(self.fs.destformat(self.zarrdir)) + loc = self._load_zarr_loc() data = loc.load("0") return data + @property + def attrs(self): + loc = self._load_zarr_loc() + group = zarr.group(loc.store) + return group.attrs + + def _load_zarr_loc(self): + if self._loc is None: + self._loc = ome_zarr.io.ZarrLocation(self.fs.destformat(self.zarrdir)) + return self._loc + class ZarrWriter: def __init__(self, fs: FileSystemApi, zarrdir: str): @@ -98,6 +109,7 @@ def write_data( voxel_spacing: List[Tuple[float, float, float]], chunk_size: Tuple[int, int, int] = (256, 256, 256), scale_z_axis: bool = True, + store_labels_metadata: bool = False, ): pyramid = [] scales = [] @@ -111,6 +123,36 @@ def write_data( pyramid.append(d) scales.append(self.ome_zarr_transforms(vs)) + # Store the labels contained in the data if the flag is activated + if store_labels_metadata: + + arr = data[0] + + # t = time.perf_counter() + labels = [int(label) for label in np.unique(arr[arr > 0])] + # print(f"Time full image {time.perf_counter() - t:.3f}s {labels}") + + # t = time.perf_counter() + # sub = arr[::10, :, :] + # labels = set(int(label) for label in np.unique(sub[sub > 0])) + # sub = arr[:, ::10, :] + # labels.update(int(label) for label in np.unique(sub[sub > 0])) + # sub = arr[:, :, :10] + # labels.update(int(label) for label in np.unique(sub[sub > 0])) + # print(f"Time 10th slices {time.perf_counter() - t:.3f}s {list(labels)}") + + # t = time.perf_counter() + # sub = arr[::50, :, :] + # labels = set(int(label) for label in np.unique(sub[sub > 0])) + # sub = arr[:, ::50, :] + # labels.update(int(label) for label in np.unique(sub[sub > 0])) + # sub = arr[:, :, :50] + # labels.update(int(label) for label in np.unique(sub[sub > 0])) + # print(f"Time 50th slices {time.perf_counter() - t:.3f}s {list(labels)}") + + label_values = [{"id": label, "label": f"{label}"} for label in labels] + self.root_group.attrs["labels_metadata"] = {"version": "1.0", "labels": label_values} + # Write the pyramid to the zarr store return ome_zarr.writer.write_multiscale( pyramid, @@ -345,12 +387,18 @@ def pyramid_to_omezarr( zarrdir: str, write: bool = True, pyramid_voxel_spacing: List[Tuple[float, float, float]] = None, + store_labels_metadata: bool = False, ) -> str: destination_zarrdir = fs.destformat(zarrdir) # Write zarr data as 256^3 voxel chunks if write: writer = ZarrWriter(fs, destination_zarrdir) - writer.write_data(pyramid, voxel_spacing=pyramid_voxel_spacing, chunk_size=(256, 256, 256)) + writer.write_data( + pyramid, + voxel_spacing=pyramid_voxel_spacing, + chunk_size=(256, 256, 256), + store_labels_metadata=store_labels_metadata, + ) else: print(f"skipping remote push for {destination_zarrdir}") return os.path.basename(zarrdir) @@ -463,7 +511,6 @@ def get_pyramid_base_data(self) -> np.ndarray: if not self.scale_0_dims: return self.scaled_data_transformation(data) - t = time.perf_counter() from scipy.ndimage import zoom x, y, z = data.shape @@ -479,7 +526,6 @@ def get_pyramid_base_data(self) -> np.ndarray: # ) rescaled = zoom(data, zoom=zoom_factor, order=0) - print(f"Rescaled in {time.perf_counter() - t:.3f}") return self.scaled_data_transformation(rescaled) @@ -570,6 +616,7 @@ def make_pyramids( f"{output_prefix}.zarr", write_zarr, pyramid_voxel_spacing=pyramid_voxel_spacing, + store_labels_metadata=multilabels, ) _ = tc.pyramid_to_mrc(fs, pyramid, f"{output_prefix}.mrc", write_mrc, header_mapper, voxel_spacing) diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 14e7c7163..91deeaa18 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -242,14 +242,19 @@ def _has_oriented_mesh(self, path: str): def _get_labels(self, path: str): segmentation_filename = os.path.join(self.config.output_prefix, path) - # Get labels iterating by chunks over the tab - # We lazy import dask and numpy - import dask.array as da - import numpy as np - reader = ZarrReader(self.config.fs, segmentation_filename) - arr = reader.get_data() - return tuple(set(da.unique(arr[arr > 0]).compute().astype(np.integer))) + try: + labels_info = reader.attrs.get("labels_metadata", {})["labels"] + labels = [label["id"] for label in labels_info] + except Exception: + # Get labels iterating by chunks over the tab + # We lazy import dask and numpy + import dask.array as da + import numpy as np + + arr = reader.get_data() + labels = set(da.unique(arr[arr > 0]).compute().astype(np.integer)) + return tuple(labels) def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: tomogram = self.get_tomogram() From a438369c37967315f4c6ffea6083c15799427b4a Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 06:04:32 -0600 Subject: [PATCH 14/29] feat: clean schema attribute for the InstanceSegmentationMask --- ingestion_tools/dataset_configs/template.yaml | 2 +- ingestion_tools/scripts/importers/annotation.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ingestion_tools/dataset_configs/template.yaml b/ingestion_tools/dataset_configs/template.yaml index 4254d73f8..d751a31f4 100644 --- a/ingestion_tools/dataset_configs/template.yaml +++ b/ingestion_tools/dataset_configs/template.yaml @@ -99,7 +99,7 @@ annotations: OPTIONAL glob_strings: see InstanceSegmentation.glob_strings is_visualization_default: see InstanceSegmentation.is_visualization_default is_portal_standard: OPTIONAL, BOOLEAN (DEFAULT FALSE) - scale_factor: OPTIONAL, FLOAT (DEFAULT 1) (POSITIVE) + rescale: OPTIONAL, BOOLEAN (DEFAULT FALSE) parent_filters: see InstanceSegmentation.parent_filters exclude: SEE InstanceSegmentation.exclude - SegmentationMask: diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index eea2984f7..83651b0af 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -320,27 +320,22 @@ def convert(self, output_prefix: str): class InstanceSegmentationMaskAnnotation(VolumeAnnotationSource): shape = "InstanceSegmentationMask" - mask_label: int - scale_factor: float + rescale: bool = False is_portal_standard: bool def __init__( self, - mask_label: int | None = None, - scale_factor: float = 1.0, + rescale: bool = False, is_portal_standard: bool = False, *args, **kwargs, ) -> None: super().__init__(*args, **kwargs) - self.mask_label = mask_label if mask_label else 1 - self.scale_factor = scale_factor + self.rescale = rescale self.is_portal_standard = is_portal_standard def convert(self, output_prefix: str): - # output_dims = self.get_output_dim() if self.rescale else None - output_dims = self.get_output_dim() - # output_dims = None + output_dims = self.get_output_dim() if self.rescale else None return make_pyramids( self.config.fs, From ac1f46efc1383519aa6a26339755b1d3a5114506 Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 07:15:16 -0600 Subject: [PATCH 15/29] feat: add tests for the instance segmentation mask --- ingestion_tools/scripts/common/image.py | 9 +- .../scripts/importers/annotation.py | 2 +- .../scripts/importers/visualization_config.py | 2 +- .../tests/s3_import/test_annotations.py | 140 ++++++++++++++++++ .../s3_import/test_visualization_config.py | 15 ++ 5 files changed, 163 insertions(+), 5 deletions(-) diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index f1d3a90b6..922fa0317 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -150,6 +150,7 @@ def write_data( # labels.update(int(label) for label in np.unique(sub[sub > 0])) # print(f"Time 50th slices {time.perf_counter() - t:.3f}s {list(labels)}") + # Move to other section label_values = [{"id": label, "label": f"{label}"} for label in labels] self.root_group.attrs["labels_metadata"] = {"version": "1.0", "labels": label_values} @@ -516,6 +517,8 @@ def get_pyramid_base_data(self) -> np.ndarray: x, y, z = data.shape nx, ny, nz = self.scale_0_dims zoom_factor = (nx / x, ny / y, nz / z) + if zoom_factor == (1.0, 1.0, 1.0): + return self.scaled_data_transformation(data) # rescaled = rescale( # data, @@ -531,10 +534,10 @@ def get_pyramid_base_data(self) -> np.ndarray: @classmethod def scaled_data_transformation(cls, data: np.ndarray) -> np.ndarray: - # For instance segmentation masks we have multiple labels, so we want an uint 32 output. + # For instance segmentation masks we have multiple labels, so we want an uint 16 output. + # We used uint16 and not uint32 as it seems MRC format doesn't handle well int > 16. # downscale_local_mean will return float array even for bool input with non-binary values - # return data.astype(np.uint32) - return data + return data.astype(np.uint16) def get_volume_metadata(config: DepositionImportConfig, output_prefix: str) -> dict[str, Any]: diff --git a/ingestion_tools/scripts/importers/annotation.py b/ingestion_tools/scripts/importers/annotation.py index 83651b0af..3ad9faa65 100644 --- a/ingestion_tools/scripts/importers/annotation.py +++ b/ingestion_tools/scripts/importers/annotation.py @@ -341,7 +341,7 @@ def convert(self, output_prefix: str): self.config.fs, self.get_output_filename(output_prefix), self.path, - write_mrc=False, + write_mrc=self.config.write_mrc, write_zarr=self.config.write_zarr, voxel_spacing=self.get_voxel_spacing().as_float(), scale_0_dims=output_dims, diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 9728d5519..54b30254a 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -89,7 +89,7 @@ def _to_segmentation_mask_layer( output_resolution = output_resolution or resolution return state_generator.generate_segmentation_mask_layer( source=source_path, - name=f"{name_prefix} segmentation", + name=f"{name_prefix} {'segmentation' if len(visible_segments) == 1 else 'instancesegmentation' }", url=self.config.https_prefix, color=color, scale=resolution, diff --git a/ingestion_tools/scripts/tests/s3_import/test_annotations.py b/ingestion_tools/scripts/tests/s3_import/test_annotations.py index da19624d5..ea2c3da60 100644 --- a/ingestion_tools/scripts/tests/s3_import/test_annotations.py +++ b/ingestion_tools/scripts/tests/s3_import/test_annotations.py @@ -9,6 +9,7 @@ import trimesh from importers.annotation import ( InstanceSegmentationAnnotation, + InstanceSegmentationMaskAnnotation, OrientedPointAnnotation, PointAnnotation, SegmentationMaskAnnotation, @@ -1637,3 +1638,142 @@ def test_ingest_triangular_mesh_hff( expected_hash = trimesh.comparison.identifier_hash(trimesh.comparison.identifier_simple(expected_mesh)) assert actual_hash == expected_hash + + +ingest_instancemask_test_cases = [ + # Mask with 3 labels (1,2,3) and background 0 + { + "case": "InstanceSegmentationMaskAnnotation, MRC", + "source_cfg": { + "InstanceSegmentationMask": { + "file_format": "mrc", + "is_visualization_default": True, + "glob_string": "annotations/semantic_mask.mrc", + }, + }, + "out_data": [ + { + "volume": [ + [[3, 3, 3, 3], [0, 2, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0]], + [[0, 0, 0, 0], [0, 2, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0]], + [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], + [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], + ], + "shape": (4, 4, 4), + }, + ], + }, + { + "case": "InstanceSegmentationMaskAnnotation, rescale=True, MRC", + "source_cfg": { + "InstanceSegmentationMask": { + "file_format": "mrc", + "is_visualization_default": True, + "rescale": True, + "glob_string": "annotations/semantic_mask.mrc", + }, + }, + "out_data": [ + { + "volume": [ + [[3, 3, 3, 3], [0, 2, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0]], + [[0, 0, 0, 0], [0, 2, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0]], + [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], + [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], + ], + "shape": (4, 4, 4), + }, + ], + }, + { + "case": "InstanceSegmentationMaskAnnotation, small mask, rescale=True, MRC", + "source_cfg": { + "InstanceSegmentationMask": { + "file_format": "mrc", + "is_visualization_default": True, + "rescale": True, + "glob_string": "annotations/small_semantic_mask.mrc", + }, + }, + "out_data": [ + { + "volume": [ + [[2, 2, 2, 2], [2, 2, 2, 2], [0, 0, 0, 0], [0, 0, 0, 0]], + [[2, 2, 2, 2], [2, 2, 2, 2], [0, 0, 0, 0], [0, 0, 0, 0]], + [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], + [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], + ], + "shape": (4, 4, 4), + }, + ], + }, + { + "case": "InstanceSegmentationMaskAnnotation, small mask, rescale=False, MRC", + "source_cfg": { + "InstanceSegmentationMask": { + "file_format": "mrc", + "is_visualization_default": True, + "rescale": False, + "glob_string": "annotations/small_semantic_mask.mrc", + }, + }, + "out_data": [ + { + "volume": [ + [[2, 2], [0, 0]], + [[0, 0], [0, 0]], + ], + "shape": (2, 2, 2), + }, + ], + }, +] + + +@pytest.mark.parametrize("case", ingest_instancemask_test_cases) +def test_ingest_instancesegmentationmask( + s3_fs: FileSystemApi, + test_output_bucket: str, + voxel_spacing_importer_s3, + deposition_config_s3: DepositionImportConfig, + s3_client: S3Client, + case: Dict[str, Any], +): + # loop through test cases + anno_config = { + "metadata": default_anno_metadata, + "sources": [ + case["source_cfg"], + ], + } + deposition_config_s3._set_object_configs("annotation", [anno_config]) + + args = dict( + config=deposition_config_s3, + metadata=default_anno_metadata, + path="test-public-bucket/input_bucket/20002/" + + case["source_cfg"]["InstanceSegmentationMask"].get("glob_string"), + parents={"voxel_spacing": voxel_spacing_importer_s3, **voxel_spacing_importer_s3.parents}, + identifier=100, + alignment_metadata_path="foo", + **case["source_cfg"]["InstanceSegmentationMask"], + ) + + anno = InstanceSegmentationMaskAnnotation(**args) + anno.import_item() + + # Strip the bucket name and annotation name from the annotation's output path. + anno_file = anno.get_output_path() + "_instancesegmentationmask.mrc" + + # Sanity check the mrc file + with s3_fs.open(anno_file, "rb") as fh: + mrc = MrcInterpreter(fh) + data = mrc.data + + exp_data = case["out_data"][0]["volume"] + shape = case["out_data"][0]["shape"] + + # Mask shape + assert data.shape == shape, f"Incorrect shape for {case['case']}" + # Mask data + assert np.all(data == np.array(exp_data, dtype=int)), f"Incorrect data for {case['case']}" diff --git a/ingestion_tools/scripts/tests/s3_import/test_visualization_config.py b/ingestion_tools/scripts/tests/s3_import/test_visualization_config.py index df5951cb0..5c69d9c53 100644 --- a/ingestion_tools/scripts/tests/s3_import/test_visualization_config.py +++ b/ingestion_tools/scripts/tests/s3_import/test_visualization_config.py @@ -146,6 +146,7 @@ def test_viz_config_with_only_tomogram( ("OrientedPointMesh", "ndjson"), ("InstanceSegmentation", "ndjson"), ("SegmentationMask", "zarr"), + ("InstanceSegmentationMask", "zarr"), ("SegmentationMask", "mrc"), ("Mesh", "glb"), ], @@ -196,6 +197,13 @@ def annotation_usecases( elif shape == "SegmentationMask" and format == "zarr": generator_method = "generate_segmentation_mask_layer" input_args["name"] += "segmentation" + input_args["visible_segments"] = (1,) + return_value = {"key": generator_method, "random": "value"} + elif shape == "InstanceSegmentationMask" and format == "zarr": + generator_method = "generate_segmentation_mask_layer" + input_args["name"] += "instancesegmentation" + input_args["visible_segments"] = (1, 2, 3) + input_args["color"] = {1: "#51508b", 2: "#ffff00", 3: "#00ffff"} return_value = {"key": generator_method, "random": "value"} args = { @@ -277,6 +285,7 @@ def test_viz_config_with_tomogram_and_annotation( config: DepositionImportConfig, validate_config: Callable[[str, dict[str, BaseImporter], list[dict]], None], mock_state_generator: MagicMock, + monkeypatch: pytest.MonkeyPatch, annotation_usecases: dict[str, Any], ) -> None: parents = get_parents(config) @@ -313,6 +322,12 @@ def test_viz_config_with_tomogram_and_annotation( anno_layers.append(mock_state_generator.generate_oriented_point_mesh_layer.return_value) anno_layers[0], anno_layers[1] = anno_layers[1], anno_layers[0] # Ensure mesh layer is first + if annotation_usecases["shape"] == "InstanceSegmentationMask": + monkeypatch.setattr( + "importers.visualization_config.VisualizationConfigImporter._get_labels", + MagicMock(return_value=(1, 2, 3)), + ) + viz_config = list(VisualizationConfigImporter.finder(config, **parents)) for item in viz_config: item.import_item() From 0af24403976861e049cfdf61078acc8f18442e95 Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 13:20:57 -0600 Subject: [PATCH 16/29] chore: Updating schema to add InstanceSegmentationMask --- .../versions/20250819_111511_autogenerated.py | 38 ------------------- apiv2/graphql_api/schema.graphql | 1 + apiv2/graphql_api/schema.json | 3 ++ apiv2/support/enums.py | 1 + .../test_infra/factories/annotation_shape.py | 4 +- 5 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 apiv2/database/migrations/versions/20250819_111511_autogenerated.py diff --git a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py deleted file mode 100644 index 96e057bc0..000000000 --- a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py +++ /dev/null @@ -1,38 +0,0 @@ -"""autogenerated - -Create Date: 2025-08-19 15:15:14.066135 - -""" -import sqlalchemy as sa -from alembic import op - -# revision identifiers, used by Alembic. -revision = '20250819_111511' -down_revision = '20250724_123531' -branch_labels = None -depends_on = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('identified_object', - sa.Column('run_id', sa.Integer(), nullable=True), - sa.Column('object_id', sa.String(), nullable=False), - sa.Column('object_name', sa.String(), nullable=False), - sa.Column('object_description', sa.String(), nullable=True), - sa.Column('object_state', sa.String(), nullable=True), - sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), - sa.ForeignKeyConstraint(['run_id'], ['run.id'], name=op.f('fk_identified_object_run_id_run')), - sa.PrimaryKeyConstraint('id', name=op.f('pk_identified_object')), - ) - op.create_index(op.f('ix_identified_object_id'), 'identified_object', ['id'], unique=False) - op.create_index(op.f('ix_identified_object_run_id'), 'identified_object', ['run_id'], unique=False) - # ### end Alembic commands ### - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f('ix_identified_object_run_id'), table_name='identified_object') - op.drop_index(op.f('ix_identified_object_id'), table_name='identified_object') - op.drop_table('identified_object') - # ### end Alembic commands ### diff --git a/apiv2/graphql_api/schema.graphql b/apiv2/graphql_api/schema.graphql index 653aa61a6..2603bf27c 100644 --- a/apiv2/graphql_api/schema.graphql +++ b/apiv2/graphql_api/schema.graphql @@ -7098,6 +7098,7 @@ enum annotation_file_shape_type_enum { OrientedPoint Point InstanceSegmentation + InstanceSegmentationMask Mesh } diff --git a/apiv2/graphql_api/schema.json b/apiv2/graphql_api/schema.json index 3cea3dce7..128d34079 100644 --- a/apiv2/graphql_api/schema.json +++ b/apiv2/graphql_api/schema.json @@ -12321,6 +12321,9 @@ { "name": "InstanceSegmentation" }, + { + "name": "InstanceSegmentationMask" + }, { "name": "Mesh" } diff --git a/apiv2/support/enums.py b/apiv2/support/enums.py index 25963c814..f281dcaf4 100644 --- a/apiv2/support/enums.py +++ b/apiv2/support/enums.py @@ -38,6 +38,7 @@ class annotation_file_shape_type_enum(enum.StrEnum): OrientedPoint = "OrientedPoint" Point = "Point" InstanceSegmentation = "InstanceSegmentation" + InstanceSegmentationMask = "InstanceSegmentationMask" Mesh = "Mesh" diff --git a/apiv2/test_infra/factories/annotation_shape.py b/apiv2/test_infra/factories/annotation_shape.py index c31650944..6de536ad4 100644 --- a/apiv2/test_infra/factories/annotation_shape.py +++ b/apiv2/test_infra/factories/annotation_shape.py @@ -32,7 +32,9 @@ class Meta: annotation = factory.SubFactory( AnnotationFactory, ) - shape_type = fuzzy.FuzzyChoice(["SegmentationMask", "OrientedPoint", "Point", "InstanceSegmentation", "Mesh"]) + shape_type = fuzzy.FuzzyChoice( + ["SegmentationMask", "OrientedPoint", "Point", "InstanceSegmentation", "InstanceSegmentationMask", "Mesh"], + ) # Auto increment integer identifiers starting with 1 id = factory.Sequence(lambda n: n + 1) From 23cd1c57f24db224facb7d47747ea07fb67a4eab Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 16:03:19 -0600 Subject: [PATCH 17/29] fix: change is_a property of InstanceSegmentationMask in metadata.yaml --- .../v2.0.0/codegen/metadata_materialized.yaml | 248 ++++++-------- schema/core/v2.0.0/codegen/metadata_models.py | 317 +++++++----------- schema/core/v2.0.0/metadata.yaml | 41 +-- .../v1.0.0/codegen/ingestion_config_models.py | 216 +++++------- .../ingestion_config_models.schema.json | 28 +- 5 files changed, 338 insertions(+), 512 deletions(-) diff --git a/schema/core/v2.0.0/codegen/metadata_materialized.yaml b/schema/core/v2.0.0/codegen/metadata_materialized.yaml index ca2906edc..76f8e42ea 100644 --- a/schema/core/v2.0.0/codegen/metadata_materialized.yaml +++ b/schema/core/v2.0.0/codegen/metadata_materialized.yaml @@ -3927,153 +3927,6 @@ classes: required: false inlined: true inlined_as_list: true - AnnotationInstanceSegmentationMaskFile: - name: AnnotationInstanceSegmentationMaskFile - description: File and sourcing data for an instance segmentation annotation mask. - Annotation that identifies individual instances of object shape masks. - from_schema: metadata - aliases: - - InstanceSegmentationMask - is_a: AnnotationOrientedPointFile - attributes: - binning: - name: binning - description: The binning factor for a point / oriented point / instance segmentation - annotation file. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_binning - ifabsent: float(1) - alias: binning - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationOrientedPointFile - - AnnotationPointFile - range: float - inlined: true - inlined_as_list: true - minimum_value: 0 - filter_value: - name: filter_value - description: The filter value for an oriented point / instance segmentation - annotation file. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_filter_value - alias: filter_value - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationOrientedPointFile - - AnnotationPointFile - - IdentifiedObjectList - range: string - inlined: true - inlined_as_list: true - order: - name: order - description: The order of axes for an oriented point / instance segmentation - annotation file. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_order - ifabsent: string(xyz) - alias: order - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationOrientedPointFile - range: string - inlined: true - inlined_as_list: true - mesh_source_path: - name: mesh_source_path - description: The path to the mesh source file associated with an oriented - point file. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_mesh_source_path - alias: mesh_source_path - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationOrientedPointFile - range: string - inlined: true - inlined_as_list: true - file_format: - name: file_format - description: File format for this file - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_format - alias: file_format - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationSourceFile - range: string - required: true - inlined: true - inlined_as_list: true - glob_string: - name: glob_string - description: Glob string to match annotation files in the dataset. Required - if annotation_source_file_glob_strings is not provided. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_glob_string - alias: glob_string - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationSourceFile - range: string - required: false - inlined: true - inlined_as_list: true - glob_strings: - name: glob_strings - description: Glob strings to match annotation files in the dataset. Required - if annotation_source_file_glob_string is not provided. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_glob_strings - alias: glob_strings - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationSourceFile - range: string - required: false - multivalued: true - inlined: true - inlined_as_list: true - is_visualization_default: - name: is_visualization_default - description: This annotation will be rendered in neuroglancer by default. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_is_visualization_default - ifabsent: 'False' - alias: is_visualization_default - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - Tomogram - - AnnotationSourceFile - range: boolean - inlined: true - inlined_as_list: true - is_portal_standard: - name: is_portal_standard - description: Whether the annotation source is a portal standard. - from_schema: metadata - exact_mappings: - - cdp-common:annotation_source_file_is_portal_standard - ifabsent: 'False' - alias: is_portal_standard - owner: AnnotationInstanceSegmentationMaskFile - domain_of: - - AnnotationSourceFile - - Alignment - range: boolean - required: false - inlined: true - inlined_as_list: true AnnotationPointFile: name: AnnotationPointFile description: File and sourcing data for a point annotation. Annotation that identifies @@ -4339,6 +4192,7 @@ classes: owner: AnnotationSemanticSegmentationMaskFile domain_of: - AnnotationSemanticSegmentationMaskFile + - AnnotationInstanceSegmentationMaskFile range: boolean inlined: true inlined_as_list: true @@ -4431,6 +4285,106 @@ classes: required: false inlined: true inlined_as_list: true + AnnotationInstanceSegmentationMaskFile: + name: AnnotationInstanceSegmentationMaskFile + description: File and sourcing data for an instance segmentation annotation mask. + Annotation that identifies individual instances of object shape masks. + from_schema: metadata + aliases: + - InstanceSegmentationMask + is_a: AnnotationSourceFile + attributes: + rescale: + name: rescale + description: Whether the annotation file needs to be rescaled. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_rescale + ifabsent: 'False' + alias: rescale + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSemanticSegmentationMaskFile + - AnnotationInstanceSegmentationMaskFile + range: boolean + inlined: true + inlined_as_list: true + file_format: + name: file_format + description: File format for this file + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_format + alias: file_format + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + range: string + required: true + inlined: true + inlined_as_list: true + glob_string: + name: glob_string + description: Glob string to match annotation files in the dataset. Required + if annotation_source_file_glob_strings is not provided. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_glob_string + alias: glob_string + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + range: string + required: false + inlined: true + inlined_as_list: true + glob_strings: + name: glob_strings + description: Glob strings to match annotation files in the dataset. Required + if annotation_source_file_glob_string is not provided. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_glob_strings + alias: glob_strings + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + range: string + required: false + multivalued: true + inlined: true + inlined_as_list: true + is_visualization_default: + name: is_visualization_default + description: This annotation will be rendered in neuroglancer by default. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_is_visualization_default + ifabsent: 'False' + alias: is_visualization_default + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - Tomogram + - AnnotationSourceFile + range: boolean + inlined: true + inlined_as_list: true + is_portal_standard: + name: is_portal_standard + description: Whether the annotation source is a portal standard. + from_schema: metadata + exact_mappings: + - cdp-common:annotation_source_file_is_portal_standard + ifabsent: 'False' + alias: is_portal_standard + owner: AnnotationInstanceSegmentationMaskFile + domain_of: + - AnnotationSourceFile + - Alignment + range: boolean + required: false + inlined: true + inlined_as_list: true AnnotationTriangularMeshFile: name: AnnotationTriangularMeshFile description: File and sourcing data for a triangular mesh annotation. Annotation diff --git a/schema/core/v2.0.0/codegen/metadata_models.py b/schema/core/v2.0.0/codegen/metadata_models.py index feb2e8d55..f6e1c6e78 100644 --- a/schema/core/v2.0.0/codegen/metadata_models.py +++ b/schema/core/v2.0.0/codegen/metadata_models.py @@ -3081,10 +3081,10 @@ class Tomogram(AuthoredEntity): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3384,10 +3384,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3405,10 +3405,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3426,10 +3426,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3448,10 +3448,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3471,10 +3471,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3503,7 +3503,6 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationOrientedPointFile", "AnnotationPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_binning"], "ifabsent": "float(1)", @@ -3521,7 +3520,6 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], } @@ -3533,11 +3531,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): json_schema_extra={ "linkml_meta": { "alias": "order", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], + "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], "exact_mappings": ["cdp-common:annotation_source_file_order"], "ifabsent": "string(xyz)", } @@ -3549,11 +3543,7 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): json_schema_extra={ "linkml_meta": { "alias": "mesh_source_path", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], + "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], "exact_mappings": ["cdp-common:annotation_source_file_mesh_source_path"], } }, @@ -3568,10 +3558,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3589,10 +3579,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3610,10 +3600,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3632,10 +3622,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3655,10 +3645,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3687,7 +3677,6 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationOrientedPointFile", "AnnotationPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_binning"], "ifabsent": "float(1)", @@ -3705,7 +3694,6 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], } @@ -3717,11 +3705,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): json_schema_extra={ "linkml_meta": { "alias": "order", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], + "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], "exact_mappings": ["cdp-common:annotation_source_file_order"], "ifabsent": "string(xyz)", } @@ -3733,11 +3717,7 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): json_schema_extra={ "linkml_meta": { "alias": "mesh_source_path", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], + "domain_of": ["AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile"], "exact_mappings": ["cdp-common:annotation_source_file_mesh_source_path"], } }, @@ -3752,10 +3732,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3773,10 +3753,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3794,10 +3774,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3816,10 +3796,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3839,10 +3819,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3853,12 +3833,12 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): ) -class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): +class AnnotationPointFile(AnnotationSourceFile): """ - File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + File and sourcing data for a point annotation. Annotation that identifies points in the volume. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["InstanceSegmentationMask"], "from_schema": "metadata"}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["Point"], "from_schema": "metadata"}) binning: Optional[float] = Field( 1.0, @@ -3871,58 +3851,49 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): "AnnotationOrientedPointFile", "AnnotationPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:annotation_source_file_binning"], "ifabsent": "float(1)", } }, ) - filter_value: Optional[str] = Field( - None, - description="""The filter value for an oriented point / instance segmentation annotation file.""", + columns: Optional[str] = Field( + "xyz", + description="""The columns used in a point annotation file.""", json_schema_extra={ "linkml_meta": { - "alias": "filter_value", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationPointFile", - "IdentifiedObjectList", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], - "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], + "alias": "columns", + "domain_of": ["AnnotationPointFile"], + "exact_mappings": ["cdp-common:annotation_source_file_columns"], + "ifabsent": "string(xyz)", } }, ) - order: Optional[str] = Field( - "xyz", - description="""The order of axes for an oriented point / instance segmentation annotation file.""", + delimiter: Optional[str] = Field( + ",", + description="""The delimiter used in a point annotation file.""", json_schema_extra={ "linkml_meta": { - "alias": "order", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], - "exact_mappings": ["cdp-common:annotation_source_file_order"], - "ifabsent": "string(xyz)", + "alias": "delimiter", + "domain_of": ["AnnotationPointFile"], + "exact_mappings": ["cdp-common:annotation_source_file_delimiter"], + "ifabsent": "string(,)", } }, ) - mesh_source_path: Optional[str] = Field( + filter_value: Optional[str] = Field( None, - description="""The path to the mesh source file associated with an oriented point file.""", + description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra={ "linkml_meta": { - "alias": "mesh_source_path", + "alias": "filter_value", "domain_of": [ "AnnotationOrientedPointFile", + "AnnotationPointFile", + "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], - "exact_mappings": ["cdp-common:annotation_source_file_mesh_source_path"], + "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], } }, ) @@ -3936,10 +3907,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3957,10 +3928,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -3978,10 +3949,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4000,10 +3971,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4023,10 +3994,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4037,72 +4008,13 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): ) -class AnnotationPointFile(AnnotationSourceFile): +class AnnotationSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a point annotation. Annotation that identifies points in the volume. + File and sourcing data for a segmentation mask annotation. Annotation that identifies an object. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["Point"], "from_schema": "metadata"}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["SegmentationMask"], "from_schema": "metadata"}) - binning: Optional[float] = Field( - 1.0, - description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", - ge=0, - json_schema_extra={ - "linkml_meta": { - "alias": "binning", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationPointFile", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], - "exact_mappings": ["cdp-common:annotation_source_file_binning"], - "ifabsent": "float(1)", - } - }, - ) - columns: Optional[str] = Field( - "xyz", - description="""The columns used in a point annotation file.""", - json_schema_extra={ - "linkml_meta": { - "alias": "columns", - "domain_of": ["AnnotationPointFile"], - "exact_mappings": ["cdp-common:annotation_source_file_columns"], - "ifabsent": "string(xyz)", - } - }, - ) - delimiter: Optional[str] = Field( - ",", - description="""The delimiter used in a point annotation file.""", - json_schema_extra={ - "linkml_meta": { - "alias": "delimiter", - "domain_of": ["AnnotationPointFile"], - "exact_mappings": ["cdp-common:annotation_source_file_delimiter"], - "ifabsent": "string(,)", - } - }, - ) - filter_value: Optional[str] = Field( - None, - description="""The filter value for an oriented point / instance segmentation annotation file.""", - json_schema_extra={ - "linkml_meta": { - "alias": "filter_value", - "domain_of": [ - "AnnotationOrientedPointFile", - "AnnotationPointFile", - "IdentifiedObjectList", - "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", - ], - "exact_mappings": ["cdp-common:annotation_source_file_filter_value"], - } - }, - ) file_format: str = Field( ..., description="""File format for this file""", @@ -4113,10 +4025,10 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4134,10 +4046,10 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4155,10 +4067,10 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4177,10 +4089,10 @@ class AnnotationPointFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4200,10 +4112,10 @@ class AnnotationPointFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4214,13 +4126,48 @@ class AnnotationPointFile(AnnotationSourceFile): ) -class AnnotationSegmentationMaskFile(AnnotationSourceFile): +class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a segmentation mask annotation. Annotation that identifies an object. + File and sourcing data for a semantic segmentation mask annotation. Annotation that identifies classes of objects. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["SegmentationMask"], "from_schema": "metadata"}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["SemanticSegmentationMask"], "from_schema": "metadata"}) + mask_label: Optional[int] = Field( + 1, + description="""The mask label for a semantic segmentation mask annotation file.""", + json_schema_extra={ + "linkml_meta": { + "alias": "mask_label", + "domain_of": ["AnnotationSemanticSegmentationMaskFile"], + "exact_mappings": ["cdp-common:annotation_source_file_mask_label"], + "ifabsent": "int(1)", + } + }, + ) + rescale: Optional[bool] = Field( + False, + description="""Whether the annotation file needs to be rescaled.""", + json_schema_extra={ + "linkml_meta": { + "alias": "rescale", + "domain_of": ["AnnotationSemanticSegmentationMaskFile", "AnnotationInstanceSegmentationMaskFile"], + "exact_mappings": ["cdp-common:annotation_source_file_rescale"], + "ifabsent": "False", + } + }, + ) + threshold: Optional[float] = Field( + None, + description="""The threshold for a segmentation mask annotation file.""", + json_schema_extra={ + "linkml_meta": { + "alias": "threshold", + "domain_of": ["AnnotationSemanticSegmentationMaskFile"], + "exact_mappings": ["cdp-common:annotation_source_file_threshold"], + } + }, + ) file_format: str = Field( ..., description="""File format for this file""", @@ -4231,10 +4178,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4252,10 +4199,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4273,10 +4220,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4295,10 +4242,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4318,10 +4265,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4332,48 +4279,25 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): ) -class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): +class AnnotationInstanceSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a semantic segmentation mask annotation. Annotation that identifies classes of objects. + File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["SemanticSegmentationMask"], "from_schema": "metadata"}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"aliases": ["InstanceSegmentationMask"], "from_schema": "metadata"}) - mask_label: Optional[int] = Field( - 1, - description="""The mask label for a semantic segmentation mask annotation file.""", - json_schema_extra={ - "linkml_meta": { - "alias": "mask_label", - "domain_of": ["AnnotationSemanticSegmentationMaskFile"], - "exact_mappings": ["cdp-common:annotation_source_file_mask_label"], - "ifabsent": "int(1)", - } - }, - ) rescale: Optional[bool] = Field( False, description="""Whether the annotation file needs to be rescaled.""", json_schema_extra={ "linkml_meta": { "alias": "rescale", - "domain_of": ["AnnotationSemanticSegmentationMaskFile"], + "domain_of": ["AnnotationSemanticSegmentationMaskFile", "AnnotationInstanceSegmentationMaskFile"], "exact_mappings": ["cdp-common:annotation_source_file_rescale"], "ifabsent": "False", } }, ) - threshold: Optional[float] = Field( - None, - description="""The threshold for a segmentation mask annotation file.""", - json_schema_extra={ - "linkml_meta": { - "alias": "threshold", - "domain_of": ["AnnotationSemanticSegmentationMaskFile"], - "exact_mappings": ["cdp-common:annotation_source_file_threshold"], - } - }, - ) file_format: str = Field( ..., description="""File format for this file""", @@ -4384,10 +4308,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4405,10 +4329,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4426,10 +4350,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4448,10 +4372,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4471,10 +4395,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4515,10 +4439,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4536,10 +4460,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4557,10 +4481,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4579,10 +4503,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4602,10 +4526,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4670,10 +4594,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4691,10 +4615,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4712,10 +4636,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4734,10 +4658,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "AnnotationSourceFile", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4757,10 +4681,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -4857,7 +4781,6 @@ class IdentifiedObjectList(ConfiguredBaseModel): "AnnotationPointFile", "IdentifiedObjectList", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", ], "exact_mappings": ["cdp-common:identified_object_filter_value"], } @@ -5364,10 +5287,10 @@ class Alignment(ConfiguredBaseModel): "Alignment", "AnnotationOrientedPointFile", "AnnotationInstanceSegmentationFile", - "AnnotationInstanceSegmentationMaskFile", "AnnotationPointFile", "AnnotationSegmentationMaskFile", "AnnotationSemanticSegmentationMaskFile", + "AnnotationInstanceSegmentationMaskFile", "AnnotationTriangularMeshFile", "AnnotationTriangularMeshGroupFile", ], @@ -6016,10 +5939,10 @@ def pattern_ORCID(cls, v): AnnotationSourceFile.model_rebuild() AnnotationOrientedPointFile.model_rebuild() AnnotationInstanceSegmentationFile.model_rebuild() -AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationPointFile.model_rebuild() AnnotationSegmentationMaskFile.model_rebuild() AnnotationSemanticSegmentationMaskFile.model_rebuild() +AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationTriangularMeshFile.model_rebuild() AnnotationTriangularMeshGroupFile.model_rebuild() IdentifiedObject.model_rebuild() diff --git a/schema/core/v2.0.0/metadata.yaml b/schema/core/v2.0.0/metadata.yaml index 8d07f4a4f..fcfeb9d90 100644 --- a/schema/core/v2.0.0/metadata.yaml +++ b/schema/core/v2.0.0/metadata.yaml @@ -459,7 +459,6 @@ classes: unit: descriptive_name: sections - TiltSeries: description: Metadata describing a tilt series. @@ -778,13 +777,6 @@ classes: description: File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes. attributes: # no extended attributes - AnnotationInstanceSegmentationMaskFile: - is_a: AnnotationOrientedPointFile - aliases: - - InstanceSegmentationMask - description: File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. - attributes: # no extended attributes - AnnotationPointFile: is_a: AnnotationSourceFile aliases: @@ -827,6 +819,16 @@ classes: exact_mappings: - cdp-common:annotation_source_file_threshold + AnnotationInstanceSegmentationMaskFile: + is_a: AnnotationSourceFile + aliases: + - InstanceSegmentationMask + description: File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + attributes: + rescale: + exact_mappings: + - cdp-common:annotation_source_file_rescale + AnnotationTriangularMeshFile: is_a: AnnotationSourceFile aliases: @@ -877,7 +879,6 @@ classes: - cdp-common:identified_object_filter_value # ============================================================================ - # ============================================================================ # annotation_metadata.json # ============================================================================ @@ -948,8 +949,8 @@ classes: symbol: Ã… y: any_of: - - range: float - - range: FloatFormattedString + - range: float + - range: FloatFormattedString required: true description: Y dimension of the reconstruction volume in angstrom unit: @@ -957,8 +958,8 @@ classes: symbol: Ã… z: any_of: - - range: float - - range: FloatFormattedString + - range: float + - range: FloatFormattedString required: true description: Z dimension of the reconstruction volume in angstrom unit: @@ -980,8 +981,8 @@ classes: symbol: Ã… y: any_of: - - range: float - - range: cdp-common:FloatFormattedString + - range: float + - range: cdp-common:FloatFormattedString required: true description: Y shift of the reconstruction volume in angstrom ifabsent: "float(0)" @@ -990,8 +991,8 @@ classes: symbol: Ã… z: any_of: - - range: float - - range: cdp-common:FloatFormattedString + - range: float + - range: cdp-common:FloatFormattedString required: true description: Z shift of the reconstruction volume in angstrom ifabsent: "float(0)" @@ -1058,7 +1059,7 @@ classes: dimensions: - exact_cardinality: 4 - exact_cardinality: 4 -# ifabsent: "np.eye(4)" # TODO: comming soon from linkml https://linkml.io/linkml/schemas/arrays#representations + # ifabsent: "np.eye(4)" # TODO: comming soon from linkml https://linkml.io/linkml/schemas/arrays#representations is_portal_standard: description: Whether the alignment is standardized for the portal. range: boolean @@ -1083,8 +1084,8 @@ classes: dose_rate: description: The dose exposure for a given frame. any_of: - - range: float - - range: FloatFormattedString + - range: float + - range: FloatFormattedString required: true is_gain_corrected: description: Is the frame gain corrected diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py index b3e364ce5..6378cf780 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py @@ -1939,10 +1939,10 @@ class Tomogram(AuthoredEntity): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'ifabsent': 'True'} }) @@ -2121,10 +2121,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2132,10 +2132,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2143,10 +2143,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2155,10 +2155,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2168,10 +2168,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], @@ -2187,36 +2187,32 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2224,10 +2220,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2235,10 +2231,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2247,10 +2243,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2260,10 +2256,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], @@ -2279,36 +2275,32 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2316,10 +2308,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2327,10 +2319,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2339,10 +2331,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2352,55 +2344,50 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], 'ifabsent': 'False'} }) -class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): +class AnnotationPointFile(AnnotationSourceFile): """ - File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + File and sourcing data for a point annotation. Annotation that identifies points in the volume. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['InstanceSegmentationMask'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['Point'], 'from_schema': 'metadata'}) binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) + columns: Optional[str] = Field("xyz", description="""The columns used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'columns', + 'domain_of': ['AnnotationPointFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_columns'], + 'ifabsent': 'string(xyz)'} }) + delimiter: Optional[str] = Field(",", description="""The delimiter used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'delimiter', + 'domain_of': ['AnnotationPointFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_delimiter'], + 'ifabsent': 'string(,)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) - order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_order'], - 'ifabsent': 'string(xyz)'} }) - mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2408,10 +2395,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2419,10 +2406,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2431,10 +2418,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2444,52 +2431,30 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], 'ifabsent': 'False'} }) -class AnnotationPointFile(AnnotationSourceFile): +class AnnotationSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a point annotation. Annotation that identifies points in the volume. + File and sourcing data for a segmentation mask annotation. Annotation that identifies an object. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['Point'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SegmentationMask'], 'from_schema': 'metadata'}) - binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_binning'], - 'ifabsent': 'float(1)'} }) - columns: Optional[str] = Field("xyz", description="""The columns used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'columns', - 'domain_of': ['AnnotationPointFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_columns'], - 'ifabsent': 'string(xyz)'} }) - delimiter: Optional[str] = Field(",", description="""The delimiter used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'delimiter', - 'domain_of': ['AnnotationPointFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_delimiter'], - 'ifabsent': 'string(,)'} }) - filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationPointFile', - 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2497,10 +2462,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2508,10 +2473,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2520,10 +2485,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2533,30 +2498,42 @@ class AnnotationPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], 'ifabsent': 'False'} }) -class AnnotationSegmentationMaskFile(AnnotationSourceFile): +class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a segmentation mask annotation. Annotation that identifies an object. + File and sourcing data for a semantic segmentation mask annotation. Annotation that identifies classes of objects. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SegmentationMask'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SemanticSegmentationMask'], 'from_schema': 'metadata'}) + mask_label: Optional[int] = Field(1, description="""The mask label for a semantic segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'mask_label', + 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_mask_label'], + 'ifabsent': 'int(1)'} }) + rescale: Optional[bool] = Field(False, description="""Whether the annotation file needs to be rescaled.""", json_schema_extra = { "linkml_meta": {'alias': 'rescale', + 'domain_of': ['AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_rescale'], + 'ifabsent': 'False'} }) + threshold: Optional[float] = Field(None, description="""The threshold for a segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'threshold', + 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_threshold']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2564,10 +2541,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2575,10 +2552,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2587,10 +2564,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2600,41 +2577,35 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], 'ifabsent': 'False'} }) -class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): +class AnnotationInstanceSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a semantic segmentation mask annotation. Annotation that identifies classes of objects. + File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SemanticSegmentationMask'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['InstanceSegmentationMask'], 'from_schema': 'metadata'}) - mask_label: Optional[int] = Field(1, description="""The mask label for a semantic segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'mask_label', - 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_mask_label'], - 'ifabsent': 'int(1)'} }) rescale: Optional[bool] = Field(False, description="""Whether the annotation file needs to be rescaled.""", json_schema_extra = { "linkml_meta": {'alias': 'rescale', - 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], + 'domain_of': ['AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_rescale'], 'ifabsent': 'False'} }) - threshold: Optional[float] = Field(None, description="""The threshold for a segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'threshold', - 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_threshold']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2642,10 +2613,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2653,10 +2624,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2665,10 +2636,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2678,10 +2649,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], @@ -2703,10 +2674,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2714,10 +2685,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2725,10 +2696,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2737,10 +2708,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2750,10 +2721,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], @@ -2789,10 +2760,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2800,10 +2771,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2811,10 +2782,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2823,10 +2794,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_visualization_default'], @@ -2836,10 +2807,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_is_portal_standard'], @@ -2889,8 +2860,7 @@ class IdentifiedObjectList(ConfiguredBaseModel): 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:identified_object_filter_value']} }) @@ -3165,10 +3135,10 @@ class Alignment(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'ifabsent': 'False'} }) @@ -8076,10 +8046,10 @@ class TomogramHeader(ConfiguredBaseModel): AnnotationSourceFile.model_rebuild() AnnotationOrientedPointFile.model_rebuild() AnnotationInstanceSegmentationFile.model_rebuild() -AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationPointFile.model_rebuild() AnnotationSegmentationMaskFile.model_rebuild() AnnotationSemanticSegmentationMaskFile.model_rebuild() +AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationTriangularMeshFile.model_rebuild() AnnotationTriangularMeshGroupFile.model_rebuild() IdentifiedObject.model_rebuild() diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json index 416e74a6c..1ba55061e 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json @@ -687,25 +687,10 @@ "additionalProperties": false, "description": "File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks.", "properties": { - "binning": { - "description": "The binning factor for a point / oriented point / instance segmentation annotation file.", - "minimum": 0, - "type": [ - "number", - "null" - ] - }, "file_format": { "description": "File format for this file", "type": "string" }, - "filter_value": { - "description": "The filter value for an oriented point / instance segmentation annotation file.", - "type": [ - "string", - "null" - ] - }, "glob_string": { "description": "Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.", "type": [ @@ -737,17 +722,10 @@ "null" ] }, - "mesh_source_path": { - "description": "The path to the mesh source file associated with an oriented point file.", - "type": [ - "string", - "null" - ] - }, - "order": { - "description": "The order of axes for an oriented point / instance segmentation annotation file.", + "rescale": { + "description": "Whether the annotation file needs to be rescaled.", "type": [ - "string", + "boolean", "null" ] } From 2233c941c78b1bce78e5e0f2e998f2b02b62211a Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 16:54:26 -0600 Subject: [PATCH 18/29] chore: update portal-neuroglancer to v1.7.0 --- ingestion_tools/poetry.lock | 82 +++++++++++++++++++++++++++++++--- ingestion_tools/pyproject.toml | 2 +- 2 files changed, 76 insertions(+), 8 deletions(-) diff --git a/ingestion_tools/poetry.lock b/ingestion_tools/poetry.lock index 35e16f762..709bb6c97 100644 --- a/ingestion_tools/poetry.lock +++ b/ingestion_tools/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "aiobotocore" @@ -839,6 +839,10 @@ files = [ {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"}, {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"}, {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5dab0844f2cf82be357a0eb11a9087f70c5430b2c241493fc122bb6f2bb0917c"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4fe605b917c70283db7dfe5ada75e04561479075761a0b3866c081d035b01c1"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:1e9a65b5736232e7a7f91ff3d02277f11d339bf34099a56cdab6a8b3410a02b2"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:58d4b711689366d4a03ac7957ab8c28890415e267f9b6589969e74b6e42225ec"}, {file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"}, {file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"}, {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"}, @@ -851,8 +855,14 @@ files = [ {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"}, {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"}, {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c247dd99d39e0338a604f8c2b3bc7061d5c2e9e2ac7ba9cc1be5a69cb6cd832f"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1b2c248cd517c222d89e74669a4adfa5577e06ab68771a529060cf5a156e9757"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:2a24c50840d89ded6c9a8fdc7b6ed3692ed4e86f1c4a4a938e1e92def92933e0"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f31859074d57b4639318523d6ffdca586ace54271a73ad23ad021acd807eb14b"}, {file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"}, {file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:32d95b80260d79926f5fab3c41701dbb818fde1c9da590e77e571eefd14abe28"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b760c65308ff1e462f65d69c12e4ae085cff3b332d894637f6273a12a482d09f"}, {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"}, {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"}, {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"}, @@ -863,8 +873,24 @@ files = [ {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"}, {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"}, {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:87a3044c3a35055527ac75e419dfa9f4f3667a1e887ee80360589eb8c90aabb9"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c5529b34c1c9d937168297f2c1fde7ebe9ebdd5e121297ff9c043bdb2ae3d6fb"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ca63e1890ede90b2e4454f9a65135a4d387a4585ff8282bb72964fab893f2111"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e79e6520141d792237c70bcd7a3b122d00f2613769ae0cb61c52e89fd3443839"}, {file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"}, {file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"}, + {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8bf32b98b75c13ec7cf774164172683d6e7891088f6316e54425fde1efc276d5"}, + {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bc37c4d6b87fb1017ea28c9508b36bbcb0c3d18b4260fcdf08b200c74a6aee8"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c0ef38c7a7014ffac184db9e04debe495d317cc9c6fb10071f7fefd93100a4f"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91d7cc2a76b5567591d12c01f019dd7afce6ba8cba6571187e21e2fc418ae648"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a93dde851926f4f2678e704fadeb39e16c35d8baebd5252c9fd94ce8ce68c4a0"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0db75f47be8b8abc8d9e31bc7aad0547ca26f24a54e6fd10231d623f183d089"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6967ced6730aed543b8673008b5a391c3b1076d834ca438bbd70635c73775368"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7eedaa5d036d9336c95915035fb57422054014ebdeb6f3b42eac809928e40d0c"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d487f5432bf35b60ed625d7e1b448e2dc855422e87469e3f450aa5552b0eb284"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:832436e59afb93e1836081a20f324cb185836c617659b07b129141a8426973c7"}, + {file = "Brotli-1.1.0-cp313-cp313-win32.whl", hash = "sha256:43395e90523f9c23a3d5bdf004733246fba087f2948f87ab28015f12359ca6a0"}, + {file = "Brotli-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:9011560a466d2eb3f5a6e4929cf4a09be405c64154e12df0dd72713f6500e32b"}, {file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"}, {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"}, {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"}, @@ -874,6 +900,10 @@ files = [ {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"}, {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"}, {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:aea440a510e14e818e67bfc4027880e2fb500c2ccb20ab21c7a7c8b5b4703d75"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:6974f52a02321b36847cd19d1b8e381bf39939c21efd6ee2fc13a28b0d99348c"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_ppc64le.whl", hash = "sha256:a7e53012d2853a07a4a79c00643832161a910674a893d296c9f1259859a289d2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:d7702622a8b40c49bffb46e1e3ba2e81268d5c04a34f460978c6b5517a34dd52"}, {file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"}, {file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"}, {file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"}, @@ -885,6 +915,10 @@ files = [ {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"}, {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"}, {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cb1dac1770878ade83f2ccdf7d25e494f05c9165f5246b46a621cc849341dc01"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:3ee8a80d67a4334482d9712b8e83ca6b1d9bc7e351931252ebef5d8f7335a547"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:5e55da2c8724191e5b557f8e18943b1b4839b8efc3ef60d65985bcf6f587dd38"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:d342778ef319e1026af243ed0a07c97acf3bad33b9f29e7ae6a1f68fd083e90c"}, {file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"}, {file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"}, {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"}, @@ -897,6 +931,10 @@ files = [ {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"}, {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"}, {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d2b35ca2c7f81d173d2fadc2f4f31e88cc5f7a39ae5b6db5513cf3383b0e0ec7"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:af6fa6817889314555aede9a919612b23739395ce767fe7fcbea9a80bf140fe5"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2feb1d960f760a575dbc5ab3b1c00504b24caaf6986e2dc2b01c09c87866a943"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4410f84b33374409552ac9b6903507cdb31cd30d2501fc5ca13d18f73548444a"}, {file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"}, {file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"}, {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"}, @@ -909,6 +947,10 @@ files = [ {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"}, {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"}, {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0737ddb3068957cf1b054899b0883830bb1fec522ec76b1098f9b6e0f02d9419"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4f3607b129417e111e30637af1b56f24f7a49e64763253bbc275c75fa887d4b2"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6c6e0c425f22c1c719c42670d561ad682f7bfeeef918edea971a79ac5252437f"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:494994f807ba0b92092a163a0a283961369a65f6cbe01e8891132b7a320e61eb"}, {file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"}, {file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"}, {file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"}, @@ -1807,7 +1849,7 @@ tqdm = ">=4.67,<5.0" [[package]] name = "cryoet-data-portal-neuroglancer" -version = "1.6.1" +version = "1.7.0" description = "Utility package for working with Neuroglancer data in the CZI Cryo-ET Data Portal" optional = false python-versions = "^3.11" @@ -1831,8 +1873,8 @@ zarr = "^2.18.2" [package.source] type = "git" url = "https://github.com/chanzuckerberg/cryoet-data-portal-neuroglancer.git" -reference = "v1.6.1" -resolved_reference = "e4cf29c84b3e8cb395fd1860894b83a6b1230e6f" +reference = "v1.7.0" +resolved_reference = "8fa94a7b3ef6f5d03f2325b97cfeff79fe4e5ec5" [[package]] name = "cycler" @@ -2158,7 +2200,6 @@ files = [ {file = "dracopy-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:08eac5a2afbab469166a783fcf387ef2657720fd7be20ebb241f5b9cbe4b6872"}, {file = "dracopy-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fac218b6de5d469ddb655e5af8c7003a98346731a846a39c688bd6f3858935aa"}, {file = "dracopy-1.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f457422e6579f7ed90e0615c52018ed390d953603f231762b50c0da84dcb813d"}, - {file = "dracopy-1.5.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:c2b3e95656e398c5b91558a492e02affdf1d89a44f2366a5fc0f167f0876e105"}, {file = "dracopy-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:785c34f8b5b09d7eed8672390aa8218353a8e1d17454098706a242cf556bc699"}, {file = "dracopy-1.5.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3d65258183834c67b0daae455e2c1461005113aa53c402e1fae228b77bbdd22"}, {file = "dracopy-1.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cfb2b932c06d7c2cac6068827e93c3f15caf8fd92868a22ef403140be8abaa4"}, @@ -2166,7 +2207,6 @@ files = [ {file = "dracopy-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:a22f33f1ff5c82de2ec9e297e576bf8be3b75d30c3228f2206caea1a88db0bfc"}, {file = "dracopy-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:15aa99714562888cb1d6a2a837c27fe74d5d6aed3a594746919ba396f6ec7c3b"}, {file = "dracopy-1.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:03aec408ced82abc963c282ae0c7b39fcd0fe639810d9b2962031f3160342e4b"}, - {file = "dracopy-1.5.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:ce8b5699622ac194eb5490254e96ec54946d20f0154787695178a854c6d09858"}, {file = "dracopy-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26ce2e93a6c3a6f86ff961e236002c43858c27dbe2745e815c9495a27cd01179"}, {file = "dracopy-1.5.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4ac18f65d0c61c0dbbafcd5a04e4ed127d66fd5573fb5c50071a2b26e2eaa9f0"}, {file = "dracopy-1.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a053fc924fd819410691b892c121264bb4e6057d2f640e4b789999a9af40b4ee"}, @@ -2992,25 +3032,30 @@ python-versions = ">=3.9" groups = ["main"] files = [ {file = "google_crc32c-1.7.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:b07d48faf8292b4db7c3d64ab86f950c2e94e93a11fd47271c28ba458e4a0d76"}, + {file = "google_crc32c-1.7.1-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:7cc81b3a2fbd932a4313eb53cc7d9dde424088ca3a0337160f35d91826880c1d"}, {file = "google_crc32c-1.7.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1c67ca0a1f5b56162951a9dae987988679a7db682d6f97ce0f6381ebf0fbea4c"}, {file = "google_crc32c-1.7.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc5319db92daa516b653600794d5b9f9439a9a121f3e162f94b0e1891c7933cb"}, {file = "google_crc32c-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcdf5a64adb747610140572ed18d011896e3b9ae5195f2514b7ff678c80f1603"}, {file = "google_crc32c-1.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:754561c6c66e89d55754106739e22fdaa93fafa8da7221b29c8b8e8270c6ec8a"}, {file = "google_crc32c-1.7.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:6fbab4b935989e2c3610371963ba1b86afb09537fd0c633049be82afe153ac06"}, + {file = "google_crc32c-1.7.1-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:ed66cbe1ed9cbaaad9392b5259b3eba4a9e565420d734e6238813c428c3336c9"}, {file = "google_crc32c-1.7.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee6547b657621b6cbed3562ea7826c3e11cab01cd33b74e1f677690652883e77"}, {file = "google_crc32c-1.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d68e17bad8f7dd9a49181a1f5a8f4b251c6dbc8cc96fb79f1d321dfd57d66f53"}, {file = "google_crc32c-1.7.1-cp311-cp311-win_amd64.whl", hash = "sha256:6335de12921f06e1f774d0dd1fbea6bf610abe0887a1638f64d694013138be5d"}, {file = "google_crc32c-1.7.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:2d73a68a653c57281401871dd4aeebbb6af3191dcac751a76ce430df4d403194"}, + {file = "google_crc32c-1.7.1-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:22beacf83baaf59f9d3ab2bbb4db0fb018da8e5aebdce07ef9f09fce8220285e"}, {file = "google_crc32c-1.7.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:19eafa0e4af11b0a4eb3974483d55d2d77ad1911e6cf6f832e1574f6781fd337"}, {file = "google_crc32c-1.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6d86616faaea68101195c6bdc40c494e4d76f41e07a37ffdef270879c15fb65"}, {file = "google_crc32c-1.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:b7491bdc0c7564fcf48c0179d2048ab2f7c7ba36b84ccd3a3e1c3f7a72d3bba6"}, {file = "google_crc32c-1.7.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:df8b38bdaf1629d62d51be8bdd04888f37c451564c2042d36e5812da9eff3c35"}, + {file = "google_crc32c-1.7.1-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:e42e20a83a29aa2709a0cf271c7f8aefaa23b7ab52e53b322585297bb94d4638"}, {file = "google_crc32c-1.7.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:905a385140bf492ac300026717af339790921f411c0dfd9aa5a9e69a08ed32eb"}, {file = "google_crc32c-1.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b211ddaf20f7ebeec5c333448582c224a7c90a9d98826fbab82c0ddc11348e6"}, {file = "google_crc32c-1.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:0f99eaa09a9a7e642a61e06742856eec8b19fc0037832e03f941fe7cf0c8e4db"}, {file = "google_crc32c-1.7.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32d1da0d74ec5634a05f53ef7df18fc646666a25efaaca9fc7dcfd4caf1d98c3"}, {file = "google_crc32c-1.7.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e10554d4abc5238823112c2ad7e4560f96c7bf3820b202660373d769d9e6e4c9"}, {file = "google_crc32c-1.7.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:9fc196f0b8d8bd2789352c6a522db03f89e83a0ed6b64315923c396d7a932315"}, + {file = "google_crc32c-1.7.1-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:bb5e35dcd8552f76eed9461a23de1030920a3c953c1982f324be8f97946e7127"}, {file = "google_crc32c-1.7.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f2226b6a8da04f1d9e61d3e357f2460b9551c5e6950071437e122c958a18ae14"}, {file = "google_crc32c-1.7.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f2b3522222746fff0e04a9bd0a23ea003ba3cccc8cf21385c564deb1f223242"}, {file = "google_crc32c-1.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3bda0fcb632d390e3ea8b6b07bf6b4f4a66c9d02dcd6fbf7ba00a197c143f582"}, @@ -3413,6 +3458,7 @@ files = [ {file = "igneous_pipeline-4.30.0-py3-none-any.whl", hash = "sha256:88bd833613ef185d25e5f59366663a30373d50ede17e7aca90b42757865bfa29"}, {file = "igneous_pipeline-4.30.0.tar.gz", hash = "sha256:1a00440c19838edf4a92aa5315d63f72d076ab70630ded2a9dafc8a558f677bd"}, ] +develop = false [package.dependencies] click = ">=6.7" @@ -3990,8 +4036,11 @@ files = [ {file = "lxml-5.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:7ce1a171ec325192c6a636b64c94418e71a1964f56d002cc28122fceff0b6121"}, {file = "lxml-5.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:795f61bcaf8770e1b37eec24edf9771b307df3af74d1d6f27d812e15a9ff3872"}, {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:29f451a4b614a7b5b6c2e043d7b64a15bd8304d7e767055e8ab68387a8cacf4e"}, + {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:891f7f991a68d20c75cb13c5c9142b2a3f9eb161f1f12a9489c82172d1f133c0"}, {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4aa412a82e460571fad592d0f93ce9935a20090029ba08eca05c614f99b0cc92"}, + {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:ac7ba71f9561cd7d7b55e1ea5511543c0282e2b6450f122672a2694621d63b7e"}, {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:c5d32f5284012deaccd37da1e2cd42f081feaa76981f0eaa474351b68df813c5"}, + {file = "lxml-5.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:ce31158630a6ac85bddd6b830cffd46085ff90498b397bd0a259f59d27a12188"}, {file = "lxml-5.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:31e63621e073e04697c1b2d23fcb89991790eef370ec37ce4d5d469f40924ed6"}, {file = "lxml-5.4.0-cp37-cp37m-win32.whl", hash = "sha256:be2ba4c3c5b7900246a8f866580700ef0d538f2ca32535e991027bdaba944063"}, {file = "lxml-5.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:09846782b1ef650b321484ad429217f5154da4d6e786636c38e434fa32e94e49"}, @@ -6120,24 +6169,28 @@ python-versions = "*" groups = ["main"] files = [ {file = "pyspng-seunglab-1.1.2.tar.gz", hash = "sha256:286e80aec8a75d3717a51acf86e31e22e87bea00b461d810f3a278cebc698358"}, + {file = "pyspng_seunglab-1.1.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:26af2b6fa021b76ce4bbcd55db36465b1b11f0d62eb12f98400981dd92176f2d"}, {file = "pyspng_seunglab-1.1.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:754f467b1b05114f54533a375e6621df98cbe4921bbeb30dd85fe9b93bbce31c"}, {file = "pyspng_seunglab-1.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:745baa7476f700e689b933bb8244eaab7ce99d78c074af2cb3e113704db0bc49"}, {file = "pyspng_seunglab-1.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b3b51361ef2a47e10efb5290f3c88fec5d126bdd969731df4170cad6ccbde55"}, {file = "pyspng_seunglab-1.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d95a7835e8c3020e07516893ce9798ccdd48481e42d0c6013994ca4cd041c4c7"}, {file = "pyspng_seunglab-1.1.2-cp310-cp310-win32.whl", hash = "sha256:ab998a271c9c2885d05de9ef220088d445c70dd0c323975614bcb7297847d73d"}, {file = "pyspng_seunglab-1.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:659b3d41748294b68b1e9de5acaef5618d70a0acbf0723b9c7b8b8abb74c8d8c"}, + {file = "pyspng_seunglab-1.1.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7a6c266241d0c0494132cadfbabcd9856afa921a5080ad051cc4c6785d667d8b"}, {file = "pyspng_seunglab-1.1.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a298e383c282ada45c36fc72cbae234fa678d3fff5d892442b2c89ff49d67f7a"}, {file = "pyspng_seunglab-1.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e8f884bd2cd744b2d285bcbc95c77546712b98fa3bf10a347acbeffd657864c"}, {file = "pyspng_seunglab-1.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:70499c9e464f38a7f9441d0079f1defa05c0f9f5887a4acb767da9deb2dc0f2a"}, {file = "pyspng_seunglab-1.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5b09178e98bebf1b0cd480d5fbc8a1a74b7b98938c863b7f03a645fb64a5c756"}, {file = "pyspng_seunglab-1.1.2-cp311-cp311-win32.whl", hash = "sha256:f9399af7fa8e63fe03604e07851adc7b4cddccba575761a259e15be7bd3f2773"}, {file = "pyspng_seunglab-1.1.2-cp311-cp311-win_amd64.whl", hash = "sha256:c270c7bd3f2bff5abbb785985d7d2594ad6ad34e0551008df12cb9544e83efd2"}, + {file = "pyspng_seunglab-1.1.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d2e68544ffb13ce946d105342b0db18b86c9e86be03bd797c33a47b9b8b59d90"}, {file = "pyspng_seunglab-1.1.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a3d954902ebfb4eee75f9555633218748ce33d581e32066b6f7712ca8d9ad1ca"}, {file = "pyspng_seunglab-1.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e68f05888bcff1bfc5f3f095b9d0992b8bea5a78904e797c8a0ab95e89a454e"}, {file = "pyspng_seunglab-1.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da32bad157d3b33271fb5ccb520aeb9917f50aca6203e0f2d030b7d7c653ba37"}, {file = "pyspng_seunglab-1.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efe8dfa903d1207be5b85206460f4f04423d5698b05caaeea4ffbd97bf5195ca"}, {file = "pyspng_seunglab-1.1.2-cp312-cp312-win32.whl", hash = "sha256:869d58a00f2f6cb158db1b90aafa3c235fc106692f9992d9db5c208f2c27c402"}, {file = "pyspng_seunglab-1.1.2-cp312-cp312-win_amd64.whl", hash = "sha256:07e07f39dcf41c58dbe1be7769c21e18f66644426a64f00affee0716b5fa297d"}, + {file = "pyspng_seunglab-1.1.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:45737a846c67269d634f6b7dad532fa346ca33b6543e42c752938bfc587972bd"}, {file = "pyspng_seunglab-1.1.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:891b2fbee2e1b7568b6ae216f047655edaed4994fddf5d0d42e55fb2d76fe61b"}, {file = "pyspng_seunglab-1.1.2-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10cb827ed501db02e52d68dcbf3e77d33befbbb2a543562467c4767cca865241"}, {file = "pyspng_seunglab-1.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4770d3c2c8aaf3311f53f6ede551c0e8ae42f6b1294097ca0b9fedb509f98518"}, @@ -6154,6 +6207,7 @@ files = [ {file = "pyspng_seunglab-1.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fc61429a4e7c3f6725845ae2bf79668f7a6bfc291e2d4299dc7ea0872fcb8a9"}, {file = "pyspng_seunglab-1.1.2-cp38-cp38-win32.whl", hash = "sha256:2d04aa2d9a1ac54ce4a94639db113639d65d219f04f6d5d804f9ec2186294dc1"}, {file = "pyspng_seunglab-1.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:015e1991ae0651cea3fdae6aad7593baf0cad7f1eebca62ab8eecb7d17391d7c"}, + {file = "pyspng_seunglab-1.1.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:76afc19c1c68d303be0459f04581030c849bf049e7167dd444c5fd25c2574645"}, {file = "pyspng_seunglab-1.1.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:79f50be213f23dd41cd15831abdfad89b15136f55db64301d27ce544b7dd5b9c"}, {file = "pyspng_seunglab-1.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a8e02b0c0b7b020d0b67d7e90bebc5f4d12f1f351e2af046b02cbb70617b9ac6"}, {file = "pyspng_seunglab-1.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:627f7c5cf7c0e06bd36c82ce843e2ad7648ebeec11e384d136a4b2491f514825"}, @@ -7973,29 +8027,43 @@ groups = ["main"] files = [ {file = "zfpy-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1417ec8595c2ccb467d228410f7570b1e804bf042ffe84664d7851a267e03239"}, {file = "zfpy-1.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:893aa8239a9cbae34f8277c6633c145f2dc11230f0f51a39c010a594a4581976"}, + {file = "zfpy-1.0.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55981215b0e4c447c3e715190d5c27e1f67af137088aff35fccee8bdb52a0eed"}, + {file = "zfpy-1.0.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4feea60d3bca2ae48456e2b38831d8715694072266bd4642ff738fb7e5512edc"}, {file = "zfpy-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:910cac6c191f7bf9d100bd348486d2e53a35a2ba4aa7091020f7154b9f26454a"}, {file = "zfpy-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b15012ed906b89b43474d5b1400a955348c6bc9cc4c216c2049c16c249a9b51f"}, {file = "zfpy-1.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:a71c0f8c4bfba2433ad11332d6b8493ae661a1c01048292f5e539103a605ec2d"}, {file = "zfpy-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:13146293a5132627feb2c9f7adc6d95c528dd19dc3260f000e4b6284b2696b1f"}, {file = "zfpy-1.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:06d6d6a46fbd198c6fec7f31b111e11f5be3a254859f5ac3ab9488d05b240337"}, + {file = "zfpy-1.0.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96c8d3702ec6fdb40cd40c8c64c9e47fe7ba07ca63a0392d051fb109e44a85b0"}, + {file = "zfpy-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e0ad9b75ef5135bcd8ba8d0851dda828c6d183c5cd73577782a794387c001ec1"}, {file = "zfpy-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d204b17ee8c1eef6a2e650c123d627c0f64b3d8957df4c788dd2aaf2a72eb4ae"}, {file = "zfpy-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0ea9d0bcf191ec345145592d2e7586413bcfd385034f85d00238e1eaa857185"}, {file = "zfpy-1.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:78ff5cc656da9414e264bbdfb316a0c30bf930a426f9c2a1f1a5131620135439"}, {file = "zfpy-1.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bb83fa31c943475c4ed8182c0bd1db518beca319809612c9851d78545e7d31c9"}, {file = "zfpy-1.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d401da303fe926b18df1e93483a2099762d61db87597ccdaf89e25fb71b107cc"}, + {file = "zfpy-1.0.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c5289c100e9820723b1f78616a0e37ab32416c69b0c934e96f2b8d9138f54d5"}, + {file = "zfpy-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:33e9505c7457937912ed4a2356d802ba1898fe32d636e24f21c7072d03dc68fb"}, {file = "zfpy-1.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b5e7c1f0ebdecc6850e65004e7fbba8d5e78bf4b626654e463c3e0aa5b3fe54"}, {file = "zfpy-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58180c0917656ab0eb2dadad7e033e10271a3c615dc8972657137dba16e2bd42"}, {file = "zfpy-1.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:f15c91425cebca0ab5c88b3b2ba0eb800ec5310e3ea2a6b5f3e4b198a97288d9"}, {file = "zfpy-1.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:791fa42b651a26be67e52043b619e3a039862900e7080711d07a5de956158b8c"}, {file = "zfpy-1.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f811480ebff2e028c50bf3491d1d2e3869eb4388883543d0698f5fdc917e4386"}, + {file = "zfpy-1.0.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:665d3f55665a5b53642842f751f2dc1e7ec5a1307030f88b8137e63bb93c9e24"}, + {file = "zfpy-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7192425d69887a0759aa3f494f942fe5da7fd32debc1ec5ed44bbd754d8b486a"}, {file = "zfpy-1.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4892bc441ce59de98c4b3b29f04e44657aa6ccfe3ae5ca23660efb010b829d6"}, {file = "zfpy-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0a64590ef3c182988f4ac5745ec6e1623b06c348583cbdb96d296e4899f4469"}, {file = "zfpy-1.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:f9a71cfce2fb7a82497e90e7152f847250664f30ca4dfedcca500c35d4c63e44"}, + {file = "zfpy-1.0.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:ba62488da318a1e2a7497164823ac0899993560e41fbdfb0381b0f011b317f26"}, + {file = "zfpy-1.0.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:838926f46c6601bce70068b711d630f74cde89ab33d92851bfaa9ed22ae06009"}, + {file = "zfpy-1.0.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:78dfd1ce01fc79e068be69a7e883203cf47f13806e6f65d66cb30e2b2a4bcb13"}, + {file = "zfpy-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:802633376e86ed19bb07cd8518dd445a81b81f89ef9ac2147f4429a95cd0a69f"}, + {file = "zfpy-1.0.1-cp314-cp314-win_amd64.whl", hash = "sha256:5448056a32da0f5db4dd3a80b008d6d31a06ba1a6d44bf5cf3a112a238ca30ac"}, {file = "zfpy-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:46ec529b729b553604a3509cd0d6d0c28169f0be0cd7744f69f16324912d463b"}, {file = "zfpy-1.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9b717a14b3ae18fc0130d440706dc08cde9c8149423bb0df9f478f52a07a5ed6"}, {file = "zfpy-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf82232d4f6e0092f54a7bf2ec52ae70024f0a2839ce54b77fb2a29fb417791e"}, {file = "zfpy-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c86a576d65557f83e2c758664ee96710c06352f8b79dca5867199e94ccfb2ce"}, {file = "zfpy-1.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:2f0dea9281b6ce1623eb45316f000a0fdaad01459a01bc50dd866a5fff37ec7b"}, + {file = "zfpy-1.0.1.tar.gz", hash = "sha256:75c7014bdb2ad497a08846aaadca6d13de7c154a541c42557e52ec42030ca926"}, ] [[package]] @@ -8249,4 +8317,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.1" python-versions = "^3.11" -content-hash = "b2f02857cf5111f7820579f0d89b8359402f6365b8fe0efd55f58d343d69155d" +content-hash = "220fbe8ad12db00eb8b9f4687b0e8aacc3a6668bca94131ed545fced2b148e4a" diff --git a/ingestion_tools/pyproject.toml b/ingestion_tools/pyproject.toml index d8af7ed8d..c322d7b48 100644 --- a/ingestion_tools/pyproject.toml +++ b/ingestion_tools/pyproject.toml @@ -53,7 +53,7 @@ imageio = "^2.33.1" pytest = "^8.3.2" boto3-stubs = {extras = ["s3"], version = "^1.34.34"} mypy = "^1.8.0" -cryoet-data-portal-neuroglancer = { git = "https://github.com/chanzuckerberg/cryoet-data-portal-neuroglancer.git", tag = "v1.6.1" } +cryoet-data-portal-neuroglancer = { git = "https://github.com/chanzuckerberg/cryoet-data-portal-neuroglancer.git", tag = "v1.7.0" } distinctipy = "^1.3.4" imodmodel = "0.0.12" mdocfile = "^0.1.2" From 6f024dfb649fe5176cf0fcd9f82d516a6eb0dcdd Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 16:56:50 -0600 Subject: [PATCH 19/29] feat: change metadata storing for labels in image-label --- ingestion_tools/scripts/common/image.py | 30 ++----------------- .../scripts/importers/visualization_config.py | 22 +++++++------- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index 922fa0317..a4c988966 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -125,34 +125,10 @@ def write_data( # Store the labels contained in the data if the flag is activated if store_labels_metadata: - arr = data[0] - - # t = time.perf_counter() - labels = [int(label) for label in np.unique(arr[arr > 0])] - # print(f"Time full image {time.perf_counter() - t:.3f}s {labels}") - - # t = time.perf_counter() - # sub = arr[::10, :, :] - # labels = set(int(label) for label in np.unique(sub[sub > 0])) - # sub = arr[:, ::10, :] - # labels.update(int(label) for label in np.unique(sub[sub > 0])) - # sub = arr[:, :, :10] - # labels.update(int(label) for label in np.unique(sub[sub > 0])) - # print(f"Time 10th slices {time.perf_counter() - t:.3f}s {list(labels)}") - - # t = time.perf_counter() - # sub = arr[::50, :, :] - # labels = set(int(label) for label in np.unique(sub[sub > 0])) - # sub = arr[:, ::50, :] - # labels.update(int(label) for label in np.unique(sub[sub > 0])) - # sub = arr[:, :, :50] - # labels.update(int(label) for label in np.unique(sub[sub > 0])) - # print(f"Time 50th slices {time.perf_counter() - t:.3f}s {list(labels)}") - - # Move to other section - label_values = [{"id": label, "label": f"{label}"} for label in labels] - self.root_group.attrs["labels_metadata"] = {"version": "1.0", "labels": label_values} + labels = [int(label) for label in np.unique(arr)] + label_values = [{"label-value": label} for label in labels] + self.root_group.attrs["image-label"] = {"version": "0.4", "colors": label_values} # Write the pyramid to the zarr store return ome_zarr.writer.write_multiscale( diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 54b30254a..06430723d 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -246,15 +246,13 @@ def get_annotation_layer_info(self, alignment_metadata_path: str) -> dict[str, A is_instance_seg = shape == "InstanceSegmentation" or shape == "InstanceSegmentationMask" args = { - - "source_path": path, - "file_metadata": file, - "name_prefix": name_prefix, - "color": hex_colors[0], - "shape": shape, - "resolution": (voxel_spacing * 1e-10,) * 3, - - } + "source_path": path, + "file_metadata": file, + "name_prefix": name_prefix, + "color": hex_colors[0], + "shape": shape, + "resolution": (voxel_spacing * 1e-10,) * 3, + } if shape == "InstanceSegmentationMask": args["visible_segments"] = visible_segments @@ -299,8 +297,8 @@ def _get_labels(self, path: str): reader = ZarrReader(self.config.fs, segmentation_filename) try: - labels_info = reader.attrs.get("labels_metadata", {})["labels"] - labels = [label["id"] for label in labels_info] + labels_info = reader.attrs.get("image-label", {})["colors"] + labels = [label["label-value"] for label in labels_info] except Exception: # Get labels iterating by chunks over the tab # We lazy import dask and numpy @@ -308,7 +306,7 @@ def _get_labels(self, path: str): import numpy as np arr = reader.get_data() - labels = set(da.unique(arr[arr > 0]).compute().astype(np.integer)) + labels = set(da.unique(arr).compute().astype(np.integer)) return tuple(labels) def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: From 8ec69d7cbe9fefb72a8430bce08161f46835ba6d Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 27 Oct 2025 17:12:09 -0600 Subject: [PATCH 20/29] feat: add tests for instance segmentation mask db ingestion --- apiv2/db_import/tests/conftest.py | 2 +- .../tests/test_db_annotation_import.py | 18 ++++++++++++++++++ .../Annotations/100/foo-1.0.json | 12 ++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/apiv2/db_import/tests/conftest.py b/apiv2/db_import/tests/conftest.py index deaf26799..ea7421277 100644 --- a/apiv2/db_import/tests/conftest.py +++ b/apiv2/db_import/tests/conftest.py @@ -133,5 +133,5 @@ def expected_dataset(http_prefix: str) -> dict[str, Any]: "key_photo_url": f"{http_prefix}/{DATASET_ID}/KeyPhoto/snapshot.png", "key_photo_thumbnail_url": f"{http_prefix}/{DATASET_ID}/KeyPhoto/thumbnail.png", "deposition_id": 300, - "file_size": 1374354.0, + "file_size": 1374808.0, } diff --git a/apiv2/db_import/tests/test_db_annotation_import.py b/apiv2/db_import/tests/test_db_annotation_import.py index 283bf13d7..2ac4ef341 100644 --- a/apiv2/db_import/tests/test_db_annotation_import.py +++ b/apiv2/db_import/tests/test_db_annotation_import.py @@ -53,6 +53,24 @@ def expected_annotations(http_prefix: str) -> list[dict[str, Any]]: def expected_annotation_files(http_prefix: str) -> list[dict[str, Any]]: path = f"{DATASET_ID}/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/" return [ + { + "tomogram_voxel_spacing_id": TOMOGRAM_VOXEL_ID1, + "s3_path": f"s3://test-public-bucket/{path}100-foo-1.0_instancesegmask.mrc", + "https_path": f"{http_prefix}/{path}100-foo-1.0_instancesegmask.mrc", + "source": "community", + "format": "mrc", + "is_visualization_default": False, + "file_size": 0, + }, + { + "tomogram_voxel_spacing_id": TOMOGRAM_VOXEL_ID1, + "s3_path": f"s3://test-public-bucket/{path}100-foo-1.0_instancesegmask.zarr", + "https_path": f"{http_prefix}/{path}100-foo-1.0_instancesegmask.zarr", + "source": "community", + "format": "zarr", + "is_visualization_default": False, + "file_size": 0, + }, { "id": ANNOTATION_FILE_ID, "tomogram_voxel_spacing_id": TOMOGRAM_VOXEL_ID1, diff --git a/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100/foo-1.0.json b/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100/foo-1.0.json index 0496e6aa6..94667aac9 100644 --- a/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100/foo-1.0.json +++ b/test_infra/test_files/30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100/foo-1.0.json @@ -53,6 +53,18 @@ "path": "30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100-foo-1.0_segmask.zarr", "shape": "SegmentationMask", "is_visualization_default": false + }, + { + "format": "mrc", + "path": "30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100-foo-1.0_instancesegmask.mrc", + "shape": "InstanceSegmentationMask", + "is_visualization_default": false + }, + { + "format": "zarr", + "path": "30001/RUN1/Reconstructions/VoxelSpacing12.300/Annotations/100-foo-1.0_instancesegmask.zarr", + "shape": "InstanceSegmentationMask", + "is_visualization_default": false } ], "method_links": [ From 6f48941a88248de54b7fd0ca08c2ed7fc21b1e69 Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 28 Oct 2025 04:50:31 -0600 Subject: [PATCH 21/29] feat: add a different method for downscaling multi-label segmentation masks --- ingestion_tools/scripts/common/image.py | 18 ++++++++++++++---- .../scripts/importers/visualization_config.py | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index a4c988966..6e40eb5ac 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -15,7 +15,8 @@ from mrcfile.mrcfile import MrcFile from ome_zarr.io import ZarrLocation from ome_zarr.reader import Reader as Reader -from skimage.transform import downscale_local_mean, resize_local_mean +from skimage.measure import block_reduce +from skimage.transform import resize_local_mean from common.config import DepositionImportConfig from common.fs import FileSystemApi, S3Filesystem @@ -126,7 +127,7 @@ def write_data( # Store the labels contained in the data if the flag is activated if store_labels_metadata: arr = data[0] - labels = [int(label) for label in np.unique(arr)] + labels = [int(label) for label in np.unique(arr) if label > 0] label_values = [{"label-value": label} for label in labels] self.root_group.attrs["image-label"] = {"version": "0.4", "colors": label_values} @@ -299,12 +300,15 @@ def get_contrast_limits(self, method: Literal["gmm", "cdf"] = "gmm"): return compute_contrast_limits(self.volume_reader.data, method=method) + def get_downscale_interpolation_func(self): + return np.mean + # Make an array of an original size image, plus `max_layers` half-scaled images def make_pyramid( self, max_layers: int = 2, scale_z_axis: bool = True, - voxel_spacing: float = None, + voxel_spacing: float | None = None, ) -> Tuple[List[np.ndarray], List[Tuple[float, float, float]]]: # Voxel size for unbinned if not voxel_spacing: @@ -317,8 +321,11 @@ def make_pyramid( pyramid_voxel_spacing = [(voxel_spacing, voxel_spacing, voxel_spacing)] z_scale = 2 if scale_z_axis else 1 # Then make a pyramid of 100/50/25 percent scale volumes + downscale_method = self.get_downscale_interpolation_func() for i in range(max_layers): - downscaled_data = self.scaled_data_transformation(downscale_local_mean(pyramid[i], (z_scale, 2, 2))) + downscaled_data = self.scaled_data_transformation( + block_reduce(pyramid[i], block_size=(z_scale, 2, 2), func=downscale_method), + ) pyramid.append(downscaled_data) pyramid_voxel_spacing.append( ( @@ -515,6 +522,9 @@ def scaled_data_transformation(cls, data: np.ndarray) -> np.ndarray: # downscale_local_mean will return float array even for bool input with non-binary values return data.astype(np.uint16) + def get_downscale_interpolation_func(self): + return np.max + def get_volume_metadata(config: DepositionImportConfig, output_prefix: str) -> dict[str, Any]: # Generates metadata related to volume files. diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index 06430723d..bc32d62e3 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -303,10 +303,10 @@ def _get_labels(self, path: str): # Get labels iterating by chunks over the tab # We lazy import dask and numpy import dask.array as da - import numpy as np arr = reader.get_data() - labels = set(da.unique(arr).compute().astype(np.integer)) + labels = da.unique(arr).compute() + labels = labels[labels > 0].astype(int) return tuple(labels) def _create_config(self, alignment_metadata_path: str) -> dict[str, Any]: From 6702b853d6105ccc21284d35919c628e1247dba2 Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 28 Oct 2025 08:23:20 -0600 Subject: [PATCH 22/29] chore: Add back missing migration script --- .../versions/20250819_111511_autogenerated.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 apiv2/database/migrations/versions/20250819_111511_autogenerated.py diff --git a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py new file mode 100644 index 000000000..96e057bc0 --- /dev/null +++ b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py @@ -0,0 +1,38 @@ +"""autogenerated + +Create Date: 2025-08-19 15:15:14.066135 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = '20250819_111511' +down_revision = '20250724_123531' +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('identified_object', + sa.Column('run_id', sa.Integer(), nullable=True), + sa.Column('object_id', sa.String(), nullable=False), + sa.Column('object_name', sa.String(), nullable=False), + sa.Column('object_description', sa.String(), nullable=True), + sa.Column('object_state', sa.String(), nullable=True), + sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), + sa.ForeignKeyConstraint(['run_id'], ['run.id'], name=op.f('fk_identified_object_run_id_run')), + sa.PrimaryKeyConstraint('id', name=op.f('pk_identified_object')), + ) + op.create_index(op.f('ix_identified_object_id'), 'identified_object', ['id'], unique=False) + op.create_index(op.f('ix_identified_object_run_id'), 'identified_object', ['run_id'], unique=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_identified_object_run_id'), table_name='identified_object') + op.drop_index(op.f('ix_identified_object_id'), table_name='identified_object') + op.drop_table('identified_object') + # ### end Alembic commands ### From 37005bbbe88746c733a7f48a3d682c07124c0656 Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 28 Oct 2025 08:26:29 -0600 Subject: [PATCH 23/29] chore: Update schema to add InstanceSegmentationMask shape --- .../versions/20250819_111511_autogenerated.py | 34 ++++++++++--------- .../versions/20251028_082407_autogenerated.py | 31 +++++++++++++++++ apiv2/graphql_api/schema.graphql | 6 ++-- apiv2/graphql_api/types/annotation_shape.py | 6 ++-- apiv2/schema/schema.yaml | 4 +-- 5 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 apiv2/database/migrations/versions/20251028_082407_autogenerated.py diff --git a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py index 96e057bc0..3d4fc97dc 100644 --- a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py +++ b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py @@ -3,36 +3,38 @@ Create Date: 2025-08-19 15:15:14.066135 """ + import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. -revision = '20250819_111511' -down_revision = '20250724_123531' +revision = "20250819_111511" +down_revision = "20250724_123531" branch_labels = None depends_on = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table('identified_object', - sa.Column('run_id', sa.Integer(), nullable=True), - sa.Column('object_id', sa.String(), nullable=False), - sa.Column('object_name', sa.String(), nullable=False), - sa.Column('object_description', sa.String(), nullable=True), - sa.Column('object_state', sa.String(), nullable=True), - sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), - sa.ForeignKeyConstraint(['run_id'], ['run.id'], name=op.f('fk_identified_object_run_id_run')), - sa.PrimaryKeyConstraint('id', name=op.f('pk_identified_object')), + op.create_table( + "identified_object", + sa.Column("run_id", sa.Integer(), nullable=True), + sa.Column("object_id", sa.String(), nullable=False), + sa.Column("object_name", sa.String(), nullable=False), + sa.Column("object_description", sa.String(), nullable=True), + sa.Column("object_state", sa.String(), nullable=True), + sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), + sa.ForeignKeyConstraint(["run_id"], ["run.id"], name=op.f("fk_identified_object_run_id_run")), + sa.PrimaryKeyConstraint("id", name=op.f("pk_identified_object")), ) - op.create_index(op.f('ix_identified_object_id'), 'identified_object', ['id'], unique=False) - op.create_index(op.f('ix_identified_object_run_id'), 'identified_object', ['run_id'], unique=False) + op.create_index(op.f("ix_identified_object_id"), "identified_object", ["id"], unique=False) + op.create_index(op.f("ix_identified_object_run_id"), "identified_object", ["run_id"], unique=False) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f('ix_identified_object_run_id'), table_name='identified_object') - op.drop_index(op.f('ix_identified_object_id'), table_name='identified_object') - op.drop_table('identified_object') + op.drop_index(op.f("ix_identified_object_run_id"), table_name="identified_object") + op.drop_index(op.f("ix_identified_object_id"), table_name="identified_object") + op.drop_table("identified_object") # ### end Alembic commands ### diff --git a/apiv2/database/migrations/versions/20251028_082407_autogenerated.py b/apiv2/database/migrations/versions/20251028_082407_autogenerated.py new file mode 100644 index 000000000..5dd43e1ff --- /dev/null +++ b/apiv2/database/migrations/versions/20251028_082407_autogenerated.py @@ -0,0 +1,31 @@ +"""autogenerated + +Create Date: 2025-10-28 14:24:13.316629 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = '20251028_082407' +down_revision = '20250819_111511' +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('annotation_shape', 'shape_type', + existing_type=sa.VARCHAR(length=20), + type_=sa.Enum('SegmentationMask', 'OrientedPoint', 'Point', 'InstanceSegmentation', 'InstanceSegmentationMask', 'Mesh', name='annotation_file_shape_type_enum', native_enum=False), + existing_nullable=True) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('annotation_shape', 'shape_type', + existing_type=sa.Enum('SegmentationMask', 'OrientedPoint', 'Point', 'InstanceSegmentation', 'InstanceSegmentationMask', 'Mesh', name='annotation_file_shape_type_enum', native_enum=False), + type_=sa.VARCHAR(length=20), + existing_nullable=True) + # ### end Alembic commands ### diff --git a/apiv2/graphql_api/schema.graphql b/apiv2/graphql_api/schema.graphql index 2603bf27c..e974f064e 100644 --- a/apiv2/graphql_api/schema.graphql +++ b/apiv2/graphql_api/schema.graphql @@ -1429,7 +1429,7 @@ type AnnotationShape implements EntityInterface & Node { annotationFilesAggregate(where: AnnotationFileWhereClause = null): AnnotationFileAggregate """ - The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh) + The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask) """ shapeType: annotation_file_shape_type_enum } @@ -1479,7 +1479,7 @@ input AnnotationShapeCreateInput { annotationId: ID = null """ - The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh) + The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask) """ shapeType: annotation_file_shape_type_enum = null @@ -1522,7 +1522,7 @@ input AnnotationShapeUpdateInput { annotationId: ID = null """ - The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh) + The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask) """ shapeType: annotation_file_shape_type_enum = null diff --git a/apiv2/graphql_api/types/annotation_shape.py b/apiv2/graphql_api/types/annotation_shape.py index 5f8d47536..326fc065a 100644 --- a/apiv2/graphql_api/types/annotation_shape.py +++ b/apiv2/graphql_api/types/annotation_shape.py @@ -197,7 +197,7 @@ class AnnotationShape(EntityInterface): Annotated["AnnotationFileAggregate", strawberry.lazy("graphql_api.types.annotation_file")] ] = load_annotation_file_aggregate_rows # type:ignore shape_type: Optional[annotation_file_shape_type_enum] = strawberry.field( - description="The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh)", + description="The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask)", default=None, ) id: int = strawberry.field(description="Numeric identifier (May change!)") @@ -312,7 +312,7 @@ class AnnotationShapeCreateInput: description="Metadata about an shapes for an annotation", default=None, ) shape_type: Optional[annotation_file_shape_type_enum] = strawberry.field( - description="The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh)", + description="The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask)", default=None, ) id: int = strawberry.field(description="Numeric identifier (May change!)") @@ -324,7 +324,7 @@ class AnnotationShapeUpdateInput: description="Metadata about an shapes for an annotation", default=None, ) shape_type: Optional[annotation_file_shape_type_enum] = strawberry.field( - description="The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh)", + description="The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask)", default=None, ) id: Optional[int] = strawberry.field(description="Numeric identifier (May change!)") diff --git a/apiv2/schema/schema.yaml b/apiv2/schema/schema.yaml index 63b447248..a852adf14 100644 --- a/apiv2/schema/schema.yaml +++ b/apiv2/schema/schema.yaml @@ -925,11 +925,11 @@ classes: annotations: cascade_delete: true shape_type: - description: The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh) + description: The shape of the annotation (SegmentationMask, OrientedPoint, Point, InstanceSegmentation, Mesh, InstanceSegmentationMask) name: shape_type from_schema: cdp-dataset-config range: annotation_file_shape_type_enum - pattern: (^SegmentationMask$)|(^OrientedPoint$)|(^Point$)|(^InstanceSegmentation$)|(^Mesh$) + pattern: (^SegmentationMask$)|(^OrientedPoint$)|(^Point$)|(^InstanceSegmentation$)|(^Mesh$)|(^InstanceSegmentationMask$) Annotation: name: Annotation annotations: From 6bc118c9b4641a3ba5e47731377bfc7bd163d26a Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 28 Oct 2025 08:36:37 -0600 Subject: [PATCH 24/29] chore: Fix comment and poetry version --- ingestion_tools/poetry.lock | 2 +- ingestion_tools/scripts/common/image.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/ingestion_tools/poetry.lock b/ingestion_tools/poetry.lock index 709bb6c97..a549d04bc 100644 --- a/ingestion_tools/poetry.lock +++ b/ingestion_tools/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. [[package]] name = "aiobotocore" diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index 6e40eb5ac..d4d562f09 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -503,14 +503,6 @@ def get_pyramid_base_data(self) -> np.ndarray: if zoom_factor == (1.0, 1.0, 1.0): return self.scaled_data_transformation(data) - # rescaled = rescale( - # data, - # scale=zoom_factor, - # order=0, - # preserve_range=True, - # anti_aliasing=False, - # ) - rescaled = zoom(data, zoom=zoom_factor, order=0) return self.scaled_data_transformation(rescaled) @@ -519,7 +511,7 @@ def get_pyramid_base_data(self) -> np.ndarray: def scaled_data_transformation(cls, data: np.ndarray) -> np.ndarray: # For instance segmentation masks we have multiple labels, so we want an uint 16 output. # We used uint16 and not uint32 as it seems MRC format doesn't handle well int > 16. - # downscale_local_mean will return float array even for bool input with non-binary values + # zoom will return float array even for bool input with non-binary values return data.astype(np.uint16) def get_downscale_interpolation_func(self): From 72a0379df00abcc9e225608421e0466d3942c242 Mon Sep 17 00:00:00 2001 From: aranega Date: Tue, 28 Oct 2025 09:20:08 -0600 Subject: [PATCH 25/29] feat: change the container for the image-label metadata --- ingestion_tools/scripts/common/image.py | 8 ++++++-- ingestion_tools/scripts/importers/visualization_config.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ingestion_tools/scripts/common/image.py b/ingestion_tools/scripts/common/image.py index d4d562f09..3032afa1c 100644 --- a/ingestion_tools/scripts/common/image.py +++ b/ingestion_tools/scripts/common/image.py @@ -125,22 +125,26 @@ def write_data( scales.append(self.ome_zarr_transforms(vs)) # Store the labels contained in the data if the flag is activated + metadata = {} if store_labels_metadata: arr = data[0] labels = [int(label) for label in np.unique(arr) if label > 0] label_values = [{"label-value": label} for label in labels] - self.root_group.attrs["image-label"] = {"version": "0.4", "colors": label_values} + metadata["image-label"] = {"version": "0.4", "colors": label_values} # Write the pyramid to the zarr store - return ome_zarr.writer.write_multiscale( + delayed_values = ome_zarr.writer.write_multiscale( pyramid, group=self.root_group, axes=self.ome_zarr_axes(), coordinate_transformations=scales, storage_options=dict(chunks=chunk_size, overwrite=True), compute=True, + metadata=metadata, ) + return delayed_values + class VolumeReader(ABC): data: np.ndarray | None diff --git a/ingestion_tools/scripts/importers/visualization_config.py b/ingestion_tools/scripts/importers/visualization_config.py index bc32d62e3..a82ee7823 100644 --- a/ingestion_tools/scripts/importers/visualization_config.py +++ b/ingestion_tools/scripts/importers/visualization_config.py @@ -297,7 +297,7 @@ def _get_labels(self, path: str): reader = ZarrReader(self.config.fs, segmentation_filename) try: - labels_info = reader.attrs.get("image-label", {})["colors"] + labels_info = reader.attrs["multiscales"][0]["metadata"]["image-label"]["colors"] labels = [label["label-value"] for label in labels_info] except Exception: # Get labels iterating by chunks over the tab From 9ce3cebfd3f26338c4e9c5b4d092e03d39072fe0 Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 29 Oct 2025 11:08:15 -0600 Subject: [PATCH 26/29] chore: apply old formatter for the migration --- .../versions/20250819_111511_autogenerated.py | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py index 3d4fc97dc..96e057bc0 100644 --- a/apiv2/database/migrations/versions/20250819_111511_autogenerated.py +++ b/apiv2/database/migrations/versions/20250819_111511_autogenerated.py @@ -3,38 +3,36 @@ Create Date: 2025-08-19 15:15:14.066135 """ - import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. -revision = "20250819_111511" -down_revision = "20250724_123531" +revision = '20250819_111511' +down_revision = '20250724_123531' branch_labels = None depends_on = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "identified_object", - sa.Column("run_id", sa.Integer(), nullable=True), - sa.Column("object_id", sa.String(), nullable=False), - sa.Column("object_name", sa.String(), nullable=False), - sa.Column("object_description", sa.String(), nullable=True), - sa.Column("object_state", sa.String(), nullable=True), - sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), - sa.ForeignKeyConstraint(["run_id"], ["run.id"], name=op.f("fk_identified_object_run_id_run")), - sa.PrimaryKeyConstraint("id", name=op.f("pk_identified_object")), + op.create_table('identified_object', + sa.Column('run_id', sa.Integer(), nullable=True), + sa.Column('object_id', sa.String(), nullable=False), + sa.Column('object_name', sa.String(), nullable=False), + sa.Column('object_description', sa.String(), nullable=True), + sa.Column('object_state', sa.String(), nullable=True), + sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), + sa.ForeignKeyConstraint(['run_id'], ['run.id'], name=op.f('fk_identified_object_run_id_run')), + sa.PrimaryKeyConstraint('id', name=op.f('pk_identified_object')), ) - op.create_index(op.f("ix_identified_object_id"), "identified_object", ["id"], unique=False) - op.create_index(op.f("ix_identified_object_run_id"), "identified_object", ["run_id"], unique=False) + op.create_index(op.f('ix_identified_object_id'), 'identified_object', ['id'], unique=False) + op.create_index(op.f('ix_identified_object_run_id'), 'identified_object', ['run_id'], unique=False) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f("ix_identified_object_run_id"), table_name="identified_object") - op.drop_index(op.f("ix_identified_object_id"), table_name="identified_object") - op.drop_table("identified_object") + op.drop_index(op.f('ix_identified_object_run_id'), table_name='identified_object') + op.drop_index(op.f('ix_identified_object_id'), table_name='identified_object') + op.drop_table('identified_object') # ### end Alembic commands ### From 4ac545e31123aad8419f2e376182c86774f970e1 Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 29 Oct 2025 11:24:51 -0600 Subject: [PATCH 27/29] chore: remove InstanceSegmentationMask from v1 schema --- .../v1.0.0/codegen/ingestion_config_models.py | 1 - .../ingestion_config_models.schema.json | 11 - .../ingestion_config_models_materialized.yaml | 12 - .../v1.0.0/ingestion_config_models.yaml | 3 - .../v2.0.0/codegen/metadata_files.py | 222 ++++++++---------- .../v2.0.0/codegen/metadata_files.schema.json | 28 +-- .../codegen/metadata_files_materialized.yaml | 6 +- 7 files changed, 102 insertions(+), 181 deletions(-) diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py index 6378cf780..117f38a23 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.py @@ -4206,7 +4206,6 @@ class AnnotationSource(DefaultSource): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'cdp-ingestion-config'}) InstanceSegmentation: Optional[AnnotationInstanceSegmentationFile] = Field(None, description="""File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes.""", json_schema_extra = { "linkml_meta": {'alias': 'InstanceSegmentation', 'domain_of': ['AnnotationSource']} }) - InstanceSegmentationMask: Optional[AnnotationInstanceSegmentationMaskFile] = Field(None, description="""File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks.""", json_schema_extra = { "linkml_meta": {'alias': 'InstanceSegmentationMask', 'domain_of': ['AnnotationSource']} }) OrientedPoint: Optional[AnnotationOrientedPointFile] = Field(None, description="""File and sourcing data for an oriented point annotation. Annotation that identifies points along with orientation in the volume.""", json_schema_extra = { "linkml_meta": {'alias': 'OrientedPoint', 'domain_of': ['AnnotationSource']} }) Point: Optional[AnnotationPointFile] = Field(None, description="""File and sourcing data for a point annotation. Annotation that identifies points in the volume.""", json_schema_extra = { "linkml_meta": {'alias': 'Point', 'domain_of': ['AnnotationSource']} }) SegmentationMask: Optional[AnnotationSegmentationMaskFile] = Field(None, description="""File and sourcing data for a segmentation mask annotation. Annotation that identifies an object.""", json_schema_extra = { "linkml_meta": {'alias': 'SegmentationMask', 'domain_of': ['AnnotationSource']} }) diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json index 1ba55061e..49f70ede4 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models.schema.json @@ -1188,17 +1188,6 @@ ], "description": "File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes." }, - "InstanceSegmentationMask": { - "anyOf": [ - { - "$ref": "#/$defs/AnnotationInstanceSegmentationMaskFile" - }, - { - "type": "null" - } - ], - "description": "File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks." - }, "OrientedPoint": { "anyOf": [ { diff --git a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml index 3d939d31d..2f0c1d753 100644 --- a/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml +++ b/schema/ingestion_config/v1.0.0/codegen/ingestion_config_models_materialized.yaml @@ -1877,18 +1877,6 @@ classes: range: AnnotationInstanceSegmentationFile inlined: true inlined_as_list: true - InstanceSegmentationMask: - name: InstanceSegmentationMask - description: File and sourcing data for an instance segmentation annotation - mask. Annotation that identifies individual instances of object shape masks. - from_schema: cdp-ingestion-config - alias: InstanceSegmentationMask - owner: AnnotationSource - domain_of: - - AnnotationSource - range: AnnotationInstanceSegmentationMaskFile - inlined: true - inlined_as_list: true OrientedPoint: name: OrientedPoint description: File and sourcing data for an oriented point annotation. Annotation diff --git a/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml b/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml index 71920e3b4..30404d90b 100644 --- a/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml +++ b/schema/ingestion_config/v1.0.0/ingestion_config_models.yaml @@ -302,9 +302,6 @@ classes: InstanceSegmentation: description: The instance segmentation annotation source. range: AnnotationInstanceSegmentationFile - InstanceSegmentationMask: - description: The instance segmentation mask annotation source. - range: AnnotationInstanceSegmentationMaskFile OrientedPoint: description: The oriented point annotation source. range: AnnotationOrientedPointFile diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files.py b/schema/metadata_files/v2.0.0/codegen/metadata_files.py index bcbdf1d0d..d280a48b3 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files.py +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files.py @@ -2015,10 +2015,10 @@ class Tomogram(AuthoredEntity): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2213,10 +2213,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2224,10 +2224,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2235,10 +2235,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2247,10 +2247,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2262,10 +2262,10 @@ class AnnotationSourceFile(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2282,36 +2282,32 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2319,10 +2315,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2330,10 +2326,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2342,10 +2338,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2357,10 +2353,10 @@ class AnnotationOrientedPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2377,36 +2373,32 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_order'], 'ifabsent': 'string(xyz)'} }) mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2414,10 +2406,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2425,10 +2417,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2437,10 +2429,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2452,10 +2444,10 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2463,45 +2455,40 @@ class AnnotationInstanceSegmentationFile(AnnotationOrientedPointFile): 'ifabsent': 'False'} }) -class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): +class AnnotationPointFile(AnnotationSourceFile): """ - File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. + File and sourcing data for a point annotation. Annotation that identifies points in the volume. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['InstanceSegmentationMask'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['Point'], 'from_schema': 'metadata'}) binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_binning'], 'ifabsent': 'float(1)'} }) + columns: Optional[str] = Field("xyz", description="""The columns used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'columns', + 'domain_of': ['AnnotationPointFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_columns'], + 'ifabsent': 'string(xyz)'} }) + delimiter: Optional[str] = Field(",", description="""The delimiter used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'delimiter', + 'domain_of': ['AnnotationPointFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_delimiter'], + 'ifabsent': 'string(,)'} }) filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) - order: Optional[str] = Field("xyz", description="""The order of axes for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'order', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_order'], - 'ifabsent': 'string(xyz)'} }) - mesh_source_path: Optional[str] = Field(None, description="""The path to the mesh source file associated with an oriented point file.""", json_schema_extra = { "linkml_meta": {'alias': 'mesh_source_path', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_mesh_source_path']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2509,10 +2496,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2520,10 +2507,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2532,10 +2519,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2547,10 +2534,10 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2558,42 +2545,20 @@ class AnnotationInstanceSegmentationMaskFile(AnnotationOrientedPointFile): 'ifabsent': 'False'} }) -class AnnotationPointFile(AnnotationSourceFile): +class AnnotationSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a point annotation. Annotation that identifies points in the volume. + File and sourcing data for a segmentation mask annotation. Annotation that identifies an object. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['Point'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SegmentationMask'], 'from_schema': 'metadata'}) - binning: Optional[float] = Field(1.0, description="""The binning factor for a point / oriented point / instance segmentation annotation file.""", ge=0, json_schema_extra = { "linkml_meta": {'alias': 'binning', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationPointFile', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_binning'], - 'ifabsent': 'float(1)'} }) - columns: Optional[str] = Field("xyz", description="""The columns used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'columns', - 'domain_of': ['AnnotationPointFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_columns'], - 'ifabsent': 'string(xyz)'} }) - delimiter: Optional[str] = Field(",", description="""The delimiter used in a point annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'delimiter', - 'domain_of': ['AnnotationPointFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_delimiter'], - 'ifabsent': 'string(,)'} }) - filter_value: Optional[str] = Field(None, description="""The filter value for an oriented point / instance segmentation annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'filter_value', - 'domain_of': ['AnnotationOrientedPointFile', - 'AnnotationPointFile', - 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_filter_value']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2601,10 +2566,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2612,10 +2577,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2624,10 +2589,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2639,10 +2604,10 @@ class AnnotationPointFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2650,20 +2615,32 @@ class AnnotationPointFile(AnnotationSourceFile): 'ifabsent': 'False'} }) -class AnnotationSegmentationMaskFile(AnnotationSourceFile): +class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a segmentation mask annotation. Annotation that identifies an object. + File and sourcing data for a semantic segmentation mask annotation. Annotation that identifies classes of objects. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SegmentationMask'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SemanticSegmentationMask'], 'from_schema': 'metadata'}) + mask_label: Optional[int] = Field(1, description="""The mask label for a semantic segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'mask_label', + 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_mask_label'], + 'ifabsent': 'int(1)'} }) + rescale: Optional[bool] = Field(False, description="""Whether the annotation file needs to be rescaled.""", json_schema_extra = { "linkml_meta": {'alias': 'rescale', + 'domain_of': ['AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_rescale'], + 'ifabsent': 'False'} }) + threshold: Optional[float] = Field(None, description="""The threshold for a segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'threshold', + 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], + 'exact_mappings': ['cdp-common:annotation_source_file_threshold']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2671,10 +2648,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2682,10 +2659,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2694,10 +2671,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2709,10 +2686,10 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2720,31 +2697,25 @@ class AnnotationSegmentationMaskFile(AnnotationSourceFile): 'ifabsent': 'False'} }) -class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): +class AnnotationInstanceSegmentationMaskFile(AnnotationSourceFile): """ - File and sourcing data for a semantic segmentation mask annotation. Annotation that identifies classes of objects. + File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks. """ - linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['SemanticSegmentationMask'], 'from_schema': 'metadata'}) + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'aliases': ['InstanceSegmentationMask'], 'from_schema': 'metadata'}) - mask_label: Optional[int] = Field(1, description="""The mask label for a semantic segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'mask_label', - 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_mask_label'], - 'ifabsent': 'int(1)'} }) rescale: Optional[bool] = Field(False, description="""Whether the annotation file needs to be rescaled.""", json_schema_extra = { "linkml_meta": {'alias': 'rescale', - 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], + 'domain_of': ['AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile'], 'exact_mappings': ['cdp-common:annotation_source_file_rescale'], 'ifabsent': 'False'} }) - threshold: Optional[float] = Field(None, description="""The threshold for a segmentation mask annotation file.""", json_schema_extra = { "linkml_meta": {'alias': 'threshold', - 'domain_of': ['AnnotationSemanticSegmentationMaskFile'], - 'exact_mappings': ['cdp-common:annotation_source_file_threshold']} }) file_format: str = Field(..., description="""File format for this file""", json_schema_extra = { "linkml_meta": {'alias': 'file_format', 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2752,10 +2723,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2763,10 +2734,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2775,10 +2746,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2790,10 +2761,10 @@ class AnnotationSemanticSegmentationMaskFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2816,10 +2787,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2827,10 +2798,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2838,10 +2809,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2850,10 +2821,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2865,10 +2836,10 @@ class AnnotationTriangularMeshFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -2905,10 +2876,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_format']} }) @@ -2916,10 +2887,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_string']} }) @@ -2927,10 +2898,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'domain_of': ['AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile'], 'exact_mappings': ['cdp-common:annotation_source_file_glob_strings']} }) @@ -2939,10 +2910,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -2954,10 +2925,10 @@ class AnnotationTriangularMeshGroupFile(AnnotationSourceFile): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -3008,8 +2979,7 @@ class IdentifiedObjectList(ConfiguredBaseModel): 'domain_of': ['AnnotationOrientedPointFile', 'AnnotationPointFile', 'IdentifiedObjectList', - 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile'], + 'AnnotationInstanceSegmentationFile'], 'exact_mappings': ['cdp-common:identified_object_filter_value']} }) @@ -3303,10 +3273,10 @@ class Alignment(ConfiguredBaseModel): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -3745,10 +3715,10 @@ class AlignmentMetadata(DefaultMetadata, Alignment): 'Alignment', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AlignmentMetadata'], @@ -3831,10 +3801,10 @@ class AnnotationFileMetadata(ConfiguredBaseModel): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -4650,10 +4620,10 @@ class TomogramMetadata(DefaultMetadata, Tomogram): 'AnnotationSourceFile', 'AnnotationOrientedPointFile', 'AnnotationInstanceSegmentationFile', - 'AnnotationInstanceSegmentationMaskFile', 'AnnotationPointFile', 'AnnotationSegmentationMaskFile', 'AnnotationSemanticSegmentationMaskFile', + 'AnnotationInstanceSegmentationMaskFile', 'AnnotationTriangularMeshFile', 'AnnotationTriangularMeshGroupFile', 'AnnotationFileMetadata', @@ -4776,10 +4746,10 @@ def pattern_processing(cls, v): AnnotationSourceFile.model_rebuild() AnnotationOrientedPointFile.model_rebuild() AnnotationInstanceSegmentationFile.model_rebuild() -AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationPointFile.model_rebuild() AnnotationSegmentationMaskFile.model_rebuild() AnnotationSemanticSegmentationMaskFile.model_rebuild() +AnnotationInstanceSegmentationMaskFile.model_rebuild() AnnotationTriangularMeshFile.model_rebuild() AnnotationTriangularMeshGroupFile.model_rebuild() IdentifiedObject.model_rebuild() diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json b/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json index e87048c3b..509d5c331 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files.schema.json @@ -677,25 +677,10 @@ "additionalProperties": false, "description": "File and sourcing data for an instance segmentation annotation mask. Annotation that identifies individual instances of object shape masks.", "properties": { - "binning": { - "description": "The binning factor for a point / oriented point / instance segmentation annotation file.", - "minimum": 0, - "type": [ - "number", - "null" - ] - }, "file_format": { "description": "File format for this file", "type": "string" }, - "filter_value": { - "description": "The filter value for an oriented point / instance segmentation annotation file.", - "type": [ - "string", - "null" - ] - }, "glob_string": { "description": "Glob string to match annotation files in the dataset. Required if annotation_source_file_glob_strings is not provided.", "type": [ @@ -727,17 +712,10 @@ "null" ] }, - "mesh_source_path": { - "description": "The path to the mesh source file associated with an oriented point file.", - "type": [ - "string", - "null" - ] - }, - "order": { - "description": "The order of axes for an oriented point / instance segmentation annotation file.", + "rescale": { + "description": "Whether the annotation file needs to be rescaled.", "type": [ - "string", + "boolean", "null" ] } diff --git a/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml b/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml index cc9fa1664..ee37475be 100644 --- a/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml +++ b/schema/metadata_files/v2.0.0/codegen/metadata_files_materialized.yaml @@ -987,10 +987,10 @@ classes: - Alignment - AnnotationOrientedPointFile - AnnotationInstanceSegmentationFile - - AnnotationInstanceSegmentationMaskFile - AnnotationPointFile - AnnotationSegmentationMaskFile - AnnotationSemanticSegmentationMaskFile + - AnnotationInstanceSegmentationMaskFile - AnnotationTriangularMeshFile - AnnotationTriangularMeshGroupFile range: boolean @@ -1082,10 +1082,10 @@ classes: - AnnotationSourceFile - AnnotationOrientedPointFile - AnnotationInstanceSegmentationFile - - AnnotationInstanceSegmentationMaskFile - AnnotationPointFile - AnnotationSegmentationMaskFile - AnnotationSemanticSegmentationMaskFile + - AnnotationInstanceSegmentationMaskFile - AnnotationTriangularMeshFile - AnnotationTriangularMeshGroupFile - AnnotationFileMetadata @@ -2924,10 +2924,10 @@ classes: - AnnotationSourceFile - AnnotationOrientedPointFile - AnnotationInstanceSegmentationFile - - AnnotationInstanceSegmentationMaskFile - AnnotationPointFile - AnnotationSegmentationMaskFile - AnnotationSemanticSegmentationMaskFile + - AnnotationInstanceSegmentationMaskFile - AnnotationTriangularMeshFile - AnnotationTriangularMeshGroupFile - AnnotationFileMetadata From bf96a29f56708fae3ebff2d0170b601b93a7919c Mon Sep 17 00:00:00 2001 From: aranega Date: Wed, 29 Oct 2025 11:29:55 -0600 Subject: [PATCH 28/29] chore: remove lefovers for v1 for InstanceSegmenationMask --- schema/core/v1.1.0/metadata.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/schema/core/v1.1.0/metadata.yaml b/schema/core/v1.1.0/metadata.yaml index 5738dc08d..240ba0499 100644 --- a/schema/core/v1.1.0/metadata.yaml +++ b/schema/core/v1.1.0/metadata.yaml @@ -622,13 +622,6 @@ classes: exact_mappings: - cdp-common:annotation_source_file_order - AnnotationInstanceSegmentationFile: - is_a: AnnotationOrientedPointFile - aliases: - - InstanceSegmentation - description: File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes. - attributes: # no extended attributes - AnnotationPointFile: is_a: AnnotationSourceFile aliases: From a15f3e6d22aff25e7526ba25f06d08fec3edb6c4 Mon Sep 17 00:00:00 2001 From: aranega Date: Fri, 31 Oct 2025 05:30:11 -0600 Subject: [PATCH 29/29] chore: add back AnnotationInstanceSegmentationFile in metadata.yaml for v1.1.0 --- schema/core/v1.1.0/metadata.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/schema/core/v1.1.0/metadata.yaml b/schema/core/v1.1.0/metadata.yaml index 240ba0499..5738dc08d 100644 --- a/schema/core/v1.1.0/metadata.yaml +++ b/schema/core/v1.1.0/metadata.yaml @@ -622,6 +622,13 @@ classes: exact_mappings: - cdp-common:annotation_source_file_order + AnnotationInstanceSegmentationFile: + is_a: AnnotationOrientedPointFile + aliases: + - InstanceSegmentation + description: File and sourcing data for an instance segmentation annotation. Annotation that identifies individual instances of object shapes. + attributes: # no extended attributes + AnnotationPointFile: is_a: AnnotationSourceFile aliases: