From 8a2b8df0805f8605447e396095f4f3b99ef7a9e8 Mon Sep 17 00:00:00 2001 From: luandalmazo Date: Mon, 27 Jul 2026 10:40:52 -0300 Subject: [PATCH 1/2] added new fields to _upload_volume_segmentation_a --- datamint/api/endpoints/annotations_api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/datamint/api/endpoints/annotations_api.py b/datamint/api/endpoints/annotations_api.py index 9671bfb2..f92656d7 100644 --- a/datamint/api/endpoints/annotations_api.py +++ b/datamint/api/endpoints/annotations_api.py @@ -959,6 +959,10 @@ async def _upload_volume_segmentation_async(self, form.add_field('annotation_worklist_id', worklist_id) if source is not None: form.add_field('source', source) + if imported_from is not None: + form.add_field('imported_from', imported_from) + if author_email is not None: + form.add_field('import_author', author_email) form.add_field('segmentation_map', json.dumps(name), content_type='application/json') try: @@ -994,6 +998,10 @@ async def _upload_volume_segmentation_async(self, form.add_field('annotation_worklist_id', worklist_id) if source is not None: form.add_field('source', source) + if imported_from is not None: + form.add_field('imported_from', imported_from) + if author_email is not None: + form.add_field('import_author', author_email) if name is not None: form.add_field('segmentation_map', json.dumps(name), content_type='application/json') From cc4039e93edb03de2fd9bb7e99a14b3637b2b44c Mon Sep 17 00:00:00 2001 From: luandalmazo Date: Mon, 27 Jul 2026 14:03:43 -0300 Subject: [PATCH 2/2] removed author_email from upload --- datamint/api/endpoints/annotations_api.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/datamint/api/endpoints/annotations_api.py b/datamint/api/endpoints/annotations_api.py index f92656d7..5b0f352e 100644 --- a/datamint/api/endpoints/annotations_api.py +++ b/datamint/api/endpoints/annotations_api.py @@ -283,7 +283,6 @@ async def _upload_segmentations_async(self, file_path=file_path, name=name, imported_from=imported_from, - author_email=author_email, worklist_id=worklist_id, model_id=model_id, transpose_segmentation=transpose_segmentation, @@ -602,7 +601,6 @@ def upload_volume_segmentation(self, file_path: str | Path | np.ndarray, name: dict[int, str] | None = None, imported_from: str | None = None, - author_email: str | None = None, worklist_id: str | None = None, model_name: str | None = None, transpose_segmentation: bool = False, @@ -622,7 +620,6 @@ def upload_volume_segmentation(self, name: Mapping of integer label values to segmentation names. Example: {1: 'liver', 2: 'tumor'} imported_from: The imported from value. - author_email: The author email. worklist_id: The annotation worklist unique id. model_name: The AI model name. transpose_segmentation: Whether to transpose the segmentation before uploading. @@ -678,7 +675,6 @@ def upload_volume_segmentation(self, file_path=file_path, name=name, imported_from=imported_from, - author_email=author_email, worklist_id=worklist_id, model_id=model_id, transpose_segmentation=transpose_segmentation, @@ -905,7 +901,6 @@ async def _upload_volume_segmentation_async(self, file_path: str | np.ndarray, name: str | dict[int, str] | dict[tuple, str] | None, imported_from: str | None = None, - author_email: str | None = None, worklist_id: str | None = None, model_id: str | None = None, transpose_segmentation: bool = False, @@ -920,7 +915,6 @@ async def _upload_volume_segmentation_async(self, file_path: Path to segmentation file or numpy array. name: The name of the segmentation (string only for volumes). imported_from: The imported from value. - author_email: The author email. worklist_id: The annotation worklist unique id. model_id: The model unique id. transpose_segmentation: Whether to transpose the segmentation. @@ -961,8 +955,6 @@ async def _upload_volume_segmentation_async(self, form.add_field('source', source) if imported_from is not None: form.add_field('imported_from', imported_from) - if author_email is not None: - form.add_field('import_author', author_email) form.add_field('segmentation_map', json.dumps(name), content_type='application/json') try: @@ -1000,8 +992,6 @@ async def _upload_volume_segmentation_async(self, form.add_field('source', source) if imported_from is not None: form.add_field('imported_from', imported_from) - if author_email is not None: - form.add_field('import_author', author_email) if name is not None: form.add_field('segmentation_map', json.dumps(name), content_type='application/json')