datamint 1.9.3__py3-none-any.whl → 2.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of datamint might be problematic. Click here for more details.
- datamint/__init__.py +2 -0
- datamint/api/__init__.py +3 -0
- datamint/api/base_api.py +430 -0
- datamint/api/client.py +91 -0
- datamint/api/dto/__init__.py +10 -0
- datamint/api/endpoints/__init__.py +17 -0
- datamint/api/endpoints/annotations_api.py +984 -0
- datamint/api/endpoints/channels_api.py +28 -0
- datamint/api/endpoints/datasetsinfo_api.py +16 -0
- datamint/api/endpoints/projects_api.py +203 -0
- datamint/api/endpoints/resources_api.py +1013 -0
- datamint/api/endpoints/users_api.py +38 -0
- datamint/api/entity_base_api.py +347 -0
- datamint/apihandler/api_handler.py +3 -6
- datamint/apihandler/base_api_handler.py +6 -28
- datamint/apihandler/dto/__init__.py +0 -0
- datamint/apihandler/dto/annotation_dto.py +1 -1
- datamint/client_cmd_tools/datamint_upload.py +19 -30
- datamint/dataset/base_dataset.py +83 -86
- datamint/dataset/dataset.py +2 -2
- datamint/entities/__init__.py +20 -0
- datamint/entities/annotation.py +178 -0
- datamint/entities/base_entity.py +51 -0
- datamint/entities/channel.py +46 -0
- datamint/entities/datasetinfo.py +22 -0
- datamint/entities/project.py +64 -0
- datamint/entities/resource.py +130 -0
- datamint/entities/user.py +21 -0
- datamint/examples/example_projects.py +41 -44
- datamint/exceptions.py +27 -1
- {datamint-1.9.3.dist-info → datamint-2.0.1.dist-info}/METADATA +13 -9
- datamint-2.0.1.dist-info/RECORD +50 -0
- {datamint-1.9.3.dist-info → datamint-2.0.1.dist-info}/WHEEL +1 -1
- datamint-1.9.3.dist-info/RECORD +0 -29
- {datamint-1.9.3.dist-info → datamint-2.0.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from pydantic import ConfigDict, BaseModel
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from datamint.entities.base_entity import BaseEntity
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChannelResourceData(BaseModel):
|
|
7
|
+
"""Represents resource data within a channel.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
created_by: Email of the user who created the resource.
|
|
11
|
+
customer_id: UUID of the customer.
|
|
12
|
+
resource_id: UUID of the resource.
|
|
13
|
+
resource_file_name: Original filename of the resource.
|
|
14
|
+
resource_mimetype: MIME type of the resource.
|
|
15
|
+
"""
|
|
16
|
+
model_config = ConfigDict(extra='allow')
|
|
17
|
+
|
|
18
|
+
created_by: str
|
|
19
|
+
customer_id: str
|
|
20
|
+
resource_id: str
|
|
21
|
+
resource_file_name: str
|
|
22
|
+
resource_mimetype: str
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Channel(BaseEntity):
|
|
26
|
+
"""Represents a channel containing multiple resources.
|
|
27
|
+
|
|
28
|
+
A channel is a collection of resources grouped together,
|
|
29
|
+
typically for batch processing or organization purposes.
|
|
30
|
+
|
|
31
|
+
Attributes:
|
|
32
|
+
channel_name: Name identifier for the channel.
|
|
33
|
+
resource_data: List of resources contained in this channel.
|
|
34
|
+
deleted: Whether the channel has been marked as deleted.
|
|
35
|
+
created_at: Timestamp when the channel was created.
|
|
36
|
+
updated_at: Timestamp when the channel was last updated.
|
|
37
|
+
"""
|
|
38
|
+
channel_name: str
|
|
39
|
+
resource_data: list[ChannelResourceData]
|
|
40
|
+
deleted: bool = False
|
|
41
|
+
created_at: str | None = None
|
|
42
|
+
updated_at: str | None = None
|
|
43
|
+
|
|
44
|
+
def get_resource_ids(self) -> list[str]:
|
|
45
|
+
"""Get list of all resource IDs in this channel."""
|
|
46
|
+
return [resource.resource_id for resource in self.resource_data] if self.resource_data else []
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Project entity module for DataMint API."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
import logging
|
|
5
|
+
from .base_entity import BaseEntity, MISSING_FIELD
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DatasetInfo(BaseEntity):
|
|
11
|
+
"""Pydantic Model representing a DataMint dataset.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
id: str
|
|
15
|
+
name: str
|
|
16
|
+
created_at: str # ISO timestamp string
|
|
17
|
+
created_by: str
|
|
18
|
+
description: str
|
|
19
|
+
customer_id: str
|
|
20
|
+
updated_at: str | None
|
|
21
|
+
total_resource: int
|
|
22
|
+
resource_ids: list[str]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Project entity module for DataMint API."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
import logging
|
|
5
|
+
from .base_entity import BaseEntity, MISSING_FIELD
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Project(BaseEntity):
|
|
11
|
+
"""Pydantic Model representing a DataMint project.
|
|
12
|
+
|
|
13
|
+
This class models a project entity from the DataMint API, containing
|
|
14
|
+
information about the project, its dataset, worklist, AI model, and
|
|
15
|
+
annotation statistics.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
id: Unique identifier for the project
|
|
19
|
+
name: Human-readable name of the project
|
|
20
|
+
description: Optional description of the project
|
|
21
|
+
created_at: ISO timestamp when the project was created
|
|
22
|
+
created_by: Email of the user who created the project
|
|
23
|
+
dataset_id: ID of the associated dataset
|
|
24
|
+
worklist_id: ID of the associated worklist
|
|
25
|
+
ai_model_id: Optional ID of the associated AI model
|
|
26
|
+
viewable_ai_segs: Optional configuration for viewable AI segments
|
|
27
|
+
editable_ai_segs: Optional configuration for editable AI segments
|
|
28
|
+
archived: Whether the project is archived
|
|
29
|
+
resource_count: Total number of resources in the project
|
|
30
|
+
annotated_resource_count: Number of resources that have been annotated
|
|
31
|
+
most_recent_experiment: Optional information about the most recent experiment
|
|
32
|
+
closed_resources_count: Number of resources marked as closed/completed
|
|
33
|
+
resources_to_annotate_count: Number of resources still needing annotation
|
|
34
|
+
annotators: List of annotators assigned to this project
|
|
35
|
+
"""
|
|
36
|
+
id: str
|
|
37
|
+
name: str
|
|
38
|
+
created_at: str # ISO timestamp string
|
|
39
|
+
created_by: str
|
|
40
|
+
dataset_id: str
|
|
41
|
+
worklist_id: str
|
|
42
|
+
archived: bool
|
|
43
|
+
resource_count: int
|
|
44
|
+
annotated_resource_count: int
|
|
45
|
+
description: str | None
|
|
46
|
+
ai_model_id: str | None
|
|
47
|
+
viewable_ai_segs: list | None
|
|
48
|
+
editable_ai_segs: list | None
|
|
49
|
+
closed_resources_count: int = MISSING_FIELD
|
|
50
|
+
resources_to_annotate_count: int = MISSING_FIELD
|
|
51
|
+
most_recent_experiment: str | None = MISSING_FIELD # ISO timestamp string
|
|
52
|
+
annotators: list[dict] = MISSING_FIELD
|
|
53
|
+
customer_id: str | None = MISSING_FIELD
|
|
54
|
+
archived_on: str | None = MISSING_FIELD
|
|
55
|
+
archived_by: str | None = MISSING_FIELD
|
|
56
|
+
is_active_learning: bool = MISSING_FIELD
|
|
57
|
+
two_up_display: bool = MISSING_FIELD
|
|
58
|
+
require_review: bool = MISSING_FIELD
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def url(self) -> str:
|
|
62
|
+
"""Get the URL to access this project in the DataMint web application."""
|
|
63
|
+
base_url = "https://app.datamint.io/projects/edit"
|
|
64
|
+
return f"{base_url}/{self.id}"
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Resource entity module for DataMint API."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import Optional, Any
|
|
5
|
+
import logging
|
|
6
|
+
from .base_entity import BaseEntity, MISSING_FIELD
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
class Resource(BaseEntity):
|
|
12
|
+
"""Represents a DataMint resource with all its properties and metadata.
|
|
13
|
+
|
|
14
|
+
This class models a resource entity from the DataMint API, containing
|
|
15
|
+
information about uploaded files, their metadata, and associated projects.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
id: Unique identifier for the resource
|
|
19
|
+
resource_uri: URI path to access the resource file
|
|
20
|
+
storage: Storage type (e.g., 'DicomResource')
|
|
21
|
+
location: Storage location path
|
|
22
|
+
upload_channel: Channel used for upload (e.g., 'tmp')
|
|
23
|
+
filename: Original filename of the resource
|
|
24
|
+
modality: Medical imaging modality
|
|
25
|
+
mimetype: MIME type of the file
|
|
26
|
+
size: File size in bytes
|
|
27
|
+
upload_mechanism: Mechanism used for upload (e.g., 'api')
|
|
28
|
+
customer_id: Customer/organization identifier
|
|
29
|
+
status: Current status of the resource
|
|
30
|
+
created_at: ISO timestamp when resource was created
|
|
31
|
+
created_by: Email of the user who created the resource
|
|
32
|
+
published: Whether the resource is published
|
|
33
|
+
published_on: ISO timestamp when resource was published
|
|
34
|
+
published_by: Email of the user who published the resource
|
|
35
|
+
publish_transforms: Optional publication transforms
|
|
36
|
+
deleted: Whether the resource is deleted
|
|
37
|
+
deleted_at: Optional ISO timestamp when resource was deleted
|
|
38
|
+
deleted_by: Optional email of the user who deleted the resource
|
|
39
|
+
metadata: Resource metadata with DICOM information
|
|
40
|
+
source_filepath: Original source file path
|
|
41
|
+
tags: List of tags associated with the resource
|
|
42
|
+
instance_uid: DICOM SOP Instance UID (top-level)
|
|
43
|
+
series_uid: DICOM Series Instance UID (top-level)
|
|
44
|
+
study_uid: DICOM Study Instance UID (top-level)
|
|
45
|
+
patient_id: Patient identifier (top-level)
|
|
46
|
+
segmentations: Optional segmentation data
|
|
47
|
+
measurements: Optional measurement data
|
|
48
|
+
categories: Optional category data
|
|
49
|
+
labels: List of labels associated with the resource
|
|
50
|
+
user_info: Information about the user who created the resource
|
|
51
|
+
projects: List of projects this resource belongs to
|
|
52
|
+
"""
|
|
53
|
+
id: str
|
|
54
|
+
resource_uri: str
|
|
55
|
+
storage: str
|
|
56
|
+
location: str
|
|
57
|
+
upload_channel: str
|
|
58
|
+
filename: str
|
|
59
|
+
modality: str
|
|
60
|
+
mimetype: str
|
|
61
|
+
size: int
|
|
62
|
+
upload_mechanism: str
|
|
63
|
+
customer_id: str
|
|
64
|
+
status: str
|
|
65
|
+
created_at: str
|
|
66
|
+
created_by: str
|
|
67
|
+
published: bool
|
|
68
|
+
deleted: bool
|
|
69
|
+
source_filepath: str | None
|
|
70
|
+
metadata: dict
|
|
71
|
+
projects: list[dict] = MISSING_FIELD
|
|
72
|
+
published_on: str | None
|
|
73
|
+
published_by: str | None
|
|
74
|
+
tags: list[str] | None = None
|
|
75
|
+
publish_transforms: Optional[Any] = None
|
|
76
|
+
deleted_at: Optional[str] = None
|
|
77
|
+
deleted_by: Optional[str] = None
|
|
78
|
+
instance_uid: Optional[str] = None
|
|
79
|
+
series_uid: Optional[str] = None
|
|
80
|
+
study_uid: Optional[str] = None
|
|
81
|
+
patient_id: Optional[str] = None
|
|
82
|
+
segmentations: Optional[Any] = None # TODO: Define proper type when spec available
|
|
83
|
+
measurements: Optional[Any] = None # TODO: Define proper type when spec available
|
|
84
|
+
categories: Optional[Any] = None # TODO: Define proper type when spec available
|
|
85
|
+
user_info: Optional[dict] = None
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def size_mb(self) -> float:
|
|
89
|
+
"""Get file size in megabytes.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
File size in MB rounded to 2 decimal places
|
|
93
|
+
"""
|
|
94
|
+
return round(self.size / (1024 * 1024), 2)
|
|
95
|
+
|
|
96
|
+
def is_dicom(self) -> bool:
|
|
97
|
+
"""Check if the resource is a DICOM file.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
True if the resource is a DICOM file, False otherwise
|
|
101
|
+
"""
|
|
102
|
+
return self.mimetype == 'application/dicom' or self.storage == 'DicomResource'
|
|
103
|
+
|
|
104
|
+
def get_project_names(self) -> list[str]:
|
|
105
|
+
"""Get list of project names this resource belongs to.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
List of project names
|
|
109
|
+
"""
|
|
110
|
+
return [proj['name'] for proj in self.projects]
|
|
111
|
+
|
|
112
|
+
def __str__(self) -> str:
|
|
113
|
+
"""String representation of the resource.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
Human-readable string describing the resource
|
|
117
|
+
"""
|
|
118
|
+
return f"Resource(id='{self.id}', filename='{self.filename}', size={self.size_mb}MB)"
|
|
119
|
+
|
|
120
|
+
def __repr__(self) -> str:
|
|
121
|
+
"""Detailed string representation of the resource.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
Detailed string representation for debugging
|
|
125
|
+
"""
|
|
126
|
+
return (
|
|
127
|
+
f"Resource(id='{self.id}', filename='{self.filename}', "
|
|
128
|
+
f"modality='{self.modality}', status='{self.status}', "
|
|
129
|
+
f"published={self.published})"
|
|
130
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from .base_entity import BaseEntity
|
|
2
|
+
|
|
3
|
+
class User(BaseEntity):
|
|
4
|
+
"""User entity model.
|
|
5
|
+
|
|
6
|
+
Attributes:
|
|
7
|
+
email: User email address (unique identifier in most cases).
|
|
8
|
+
firstname: First name.
|
|
9
|
+
lastname: Last name.
|
|
10
|
+
roles: List of role strings assigned to the user.
|
|
11
|
+
customer_id: UUID of the owning customer/tenant.
|
|
12
|
+
created_at: ISO 8601 timestamp of creation.
|
|
13
|
+
"""
|
|
14
|
+
email: str
|
|
15
|
+
firstname: str | None
|
|
16
|
+
lastname: str | None
|
|
17
|
+
roles: list[str]
|
|
18
|
+
customer_id: str
|
|
19
|
+
created_at: str
|
|
20
|
+
|
|
21
|
+
# Potential improvement: convert created_at to datetime for easier comparisons.
|
|
@@ -1,75 +1,72 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
import io
|
|
3
|
-
from datamint import
|
|
3
|
+
from datamint import Api
|
|
4
4
|
import logging
|
|
5
5
|
from PIL import Image
|
|
6
6
|
import numpy as np
|
|
7
|
+
from datamint.entities import Project, Resource
|
|
8
|
+
from pydicom.data import get_testdata_file
|
|
7
9
|
|
|
8
10
|
_LOGGER = logging.getLogger(__name__)
|
|
9
11
|
|
|
10
12
|
|
|
11
|
-
def _download_pydicom_test_file(filename: str) -> io.BytesIO:
|
|
12
|
-
"""Download a pydicom test file from GitHub and return its content as a BytesIO object."""
|
|
13
|
-
url = f'https://raw.githubusercontent.com/pydicom/pydicom/master/tests/data/{filename}'
|
|
14
|
-
response = requests.get(url)
|
|
15
|
-
response.raise_for_status()
|
|
16
|
-
content = io.BytesIO(response.content)
|
|
17
|
-
content.name = filename
|
|
18
|
-
return content
|
|
19
|
-
|
|
20
|
-
|
|
21
13
|
class ProjectMR:
|
|
22
14
|
@staticmethod
|
|
23
|
-
def upload_resource_emri_small(api:
|
|
15
|
+
def upload_resource_emri_small(api: Api | None = None) -> Resource:
|
|
24
16
|
if api is None:
|
|
25
|
-
api =
|
|
17
|
+
api = Api()
|
|
26
18
|
|
|
27
|
-
searched_res = api.
|
|
19
|
+
searched_res = api.resources.get_list(status='published',
|
|
20
|
+
tags=['example'],
|
|
21
|
+
filename='emri_small.dcm')
|
|
28
22
|
for res in searched_res:
|
|
29
23
|
_LOGGER.info('Resource already exists.')
|
|
30
|
-
return res
|
|
24
|
+
return res
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
dcm_path = get_testdata_file("emri_small.dcm",
|
|
27
|
+
read=False)
|
|
33
28
|
|
|
34
|
-
_LOGGER.info(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
_LOGGER.info('Uploading resource emri_small.dcm...')
|
|
30
|
+
resid = api.resources.upload_resource(dcm_path,
|
|
31
|
+
anonymize=False,
|
|
32
|
+
publish=True,
|
|
33
|
+
tags=['example'])
|
|
34
|
+
return api.resources.get_by_id(resid)
|
|
39
35
|
|
|
40
36
|
@staticmethod
|
|
41
|
-
def _upload_annotations(api:
|
|
42
|
-
|
|
43
|
-
proj) -> None:
|
|
37
|
+
def _upload_annotations(api: Api,
|
|
38
|
+
res: Resource,
|
|
39
|
+
proj: Project) -> None:
|
|
44
40
|
_LOGGER.info('Uploading annotations...')
|
|
45
|
-
proj_id = proj['id']
|
|
46
|
-
proj_info = api.get_project_by_id(proj_id)
|
|
47
41
|
segurl = 'https://github.com/user-attachments/assets/8c5d7dfe-1b5a-497d-b76e-fe790f09bb90'
|
|
48
42
|
resp = requests.get(segurl, stream=True)
|
|
49
43
|
resp.raise_for_status()
|
|
50
44
|
img = Image.open(io.BytesIO(resp.content)).convert('L')
|
|
51
|
-
api.upload_segmentations(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
api.
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
api.annotations.upload_segmentations(res, np.array(img),
|
|
46
|
+
name='object1', frame_index=1,
|
|
47
|
+
worklist_id=proj.worklist_id)
|
|
48
|
+
api.projects.set_work_status(resource=res,
|
|
49
|
+
project=proj,
|
|
50
|
+
status='closed')
|
|
57
51
|
|
|
58
52
|
@staticmethod
|
|
59
53
|
def create(project_name: str = 'Example Project MR',
|
|
60
|
-
with_annotations=True) ->
|
|
61
|
-
api =
|
|
54
|
+
with_annotations=True) -> Project:
|
|
55
|
+
api = Api()
|
|
56
|
+
|
|
57
|
+
res = ProjectMR.upload_resource_emri_small(api)
|
|
58
|
+
proj = api.projects.get_by_name(name=project_name)
|
|
59
|
+
if proj:
|
|
60
|
+
_LOGGER.warning(f'Project {project_name} already exists. Returning it without modifications...')
|
|
61
|
+
return proj
|
|
62
62
|
|
|
63
|
-
resid = ProjectMR.upload_resource_emri_small(api)
|
|
64
|
-
proj = api.get_project_by_name(project_name)
|
|
65
|
-
if 'id' in proj:
|
|
66
|
-
msg = f'Project {project_name} already exists. Delete it first or choose another name.'
|
|
67
|
-
raise ValueError(msg)
|
|
68
63
|
_LOGGER.info(f'Creating project {project_name}...')
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
projid = api.projects.create(name=project_name,
|
|
65
|
+
description='This is an example project',
|
|
66
|
+
resources_ids=[res.id])
|
|
67
|
+
proj = api.projects.get_by_id(projid)
|
|
68
|
+
|
|
72
69
|
if with_annotations:
|
|
73
|
-
ProjectMR._upload_annotations(api,
|
|
70
|
+
ProjectMR._upload_annotations(api, res, proj)
|
|
74
71
|
|
|
75
|
-
return proj
|
|
72
|
+
return proj
|
datamint/exceptions.py
CHANGED
|
@@ -2,4 +2,30 @@ class DatamintException(Exception):
|
|
|
2
2
|
"""
|
|
3
3
|
Base class for exceptions in this module.
|
|
4
4
|
"""
|
|
5
|
-
pass
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
class ResourceNotFoundError(DatamintException):
|
|
8
|
+
"""
|
|
9
|
+
Exception raised when a resource is not found.
|
|
10
|
+
For instance, when trying to get a resource by a non-existing id.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self,
|
|
14
|
+
resource_type: str,
|
|
15
|
+
params: dict):
|
|
16
|
+
""" Constructor.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
resource_type (str): A resource type.
|
|
20
|
+
params (dict): Dict of params identifying the sought resource.
|
|
21
|
+
"""
|
|
22
|
+
super().__init__()
|
|
23
|
+
self.resource_type = resource_type
|
|
24
|
+
self.params = params
|
|
25
|
+
|
|
26
|
+
def set_params(self, resource_type: str, params: dict):
|
|
27
|
+
self.resource_type = resource_type
|
|
28
|
+
self.params = params
|
|
29
|
+
|
|
30
|
+
def __str__(self):
|
|
31
|
+
return f"Resource '{self.resource_type}' not found for parameters: {self.params}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: datamint
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -8,6 +8,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3.11
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.12
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
11
12
|
Provides-Extra: dev
|
|
12
13
|
Provides-Extra: docs
|
|
13
14
|
Requires-Dist: Deprecated (>=1.2.0)
|
|
@@ -19,13 +20,14 @@ Requires-Dist: humanize (>=4.0.0,<5.0.0)
|
|
|
19
20
|
Requires-Dist: lazy-loader (>=0.3.0)
|
|
20
21
|
Requires-Dist: lightning
|
|
21
22
|
Requires-Dist: matplotlib
|
|
22
|
-
Requires-Dist: medimgkit (>=0.
|
|
23
|
+
Requires-Dist: medimgkit (>=0.6.0)
|
|
23
24
|
Requires-Dist: nest-asyncio (>=1.0.0,<2.0.0)
|
|
24
25
|
Requires-Dist: nibabel (>=4.0.0)
|
|
25
26
|
Requires-Dist: numpy
|
|
26
27
|
Requires-Dist: opencv-python (>=4.0.0)
|
|
27
28
|
Requires-Dist: pandas (>=2.0.0)
|
|
28
29
|
Requires-Dist: platformdirs (>=4.0.0,<5.0.0)
|
|
30
|
+
Requires-Dist: pydantic (>=2.6.4)
|
|
29
31
|
Requires-Dist: pydicom (>=3.0.0,<4.0.0)
|
|
30
32
|
Requires-Dist: pylibjpeg (>=2.0.0,<3.0.0)
|
|
31
33
|
Requires-Dist: pylibjpeg-libjpeg (>=2.0.0,<3.0.0)
|
|
@@ -42,6 +44,7 @@ Requires-Dist: sphinx_rtd_theme (>=2.0.0) ; extra == "docs"
|
|
|
42
44
|
Requires-Dist: torch (>=1.2.0,!=2.3.0)
|
|
43
45
|
Requires-Dist: torchvision (>=0.18.0)
|
|
44
46
|
Requires-Dist: tqdm (>=4.0.0,<5.0.0)
|
|
47
|
+
Requires-Dist: typing_extensions (>=4.0.0)
|
|
45
48
|
Description-Content-Type: text/markdown
|
|
46
49
|
|
|
47
50
|
|
|
@@ -91,13 +94,13 @@ import os
|
|
|
91
94
|
os.environ["DATAMINT_API_KEY"] = "my_api_key"
|
|
92
95
|
```
|
|
93
96
|
|
|
94
|
-
### Method 3:
|
|
97
|
+
### Method 3: Api constructor
|
|
95
98
|
|
|
96
|
-
Specify API key in the
|
|
99
|
+
Specify API key in the Api constructor:
|
|
97
100
|
|
|
98
101
|
```python
|
|
99
|
-
from datamint import
|
|
100
|
-
api =
|
|
102
|
+
from datamint import Api
|
|
103
|
+
api = Api(api_key='my_api_key')
|
|
101
104
|
```
|
|
102
105
|
|
|
103
106
|
## Tutorials
|
|
@@ -110,8 +113,9 @@ You can find example notebooks in the `notebooks` folder:
|
|
|
110
113
|
|
|
111
114
|
and example scripts in [examples](examples) folder:
|
|
112
115
|
|
|
113
|
-
- [
|
|
114
|
-
- [
|
|
116
|
+
- [API usage examples](examples/api_usage.ipynb)
|
|
117
|
+
- [Project and entity usage](examples/project_entity_usage.ipynb)
|
|
118
|
+
- [Channels example](examples/channels_example.ipynb)
|
|
115
119
|
|
|
116
120
|
## Full documentation
|
|
117
121
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
datamint/__init__.py,sha256=ucsnxrYClh6pdy7psRJXWam_9rjAQB4NXzvy7xLovmo,824
|
|
2
|
+
datamint/api/__init__.py,sha256=7QYkmDBXbKh8-zchV7k6Lpolaw6h-IK6ezfXROIWh2A,43
|
|
3
|
+
datamint/api/base_api.py,sha256=MIq1sQA4mD9_SWxAEDjxtxm3Q-tj6kZ05KRnNoLPM7E,16576
|
|
4
|
+
datamint/api/client.py,sha256=1XTZUlbAISe0jwug1rrANgWJToXxYeXx8_HD-ZWJurU,3354
|
|
5
|
+
datamint/api/dto/__init__.py,sha256=KOSNl1axDDE5eBt68MmsgkyE0Ds_1DDzWUg73iyoWvc,281
|
|
6
|
+
datamint/api/endpoints/__init__.py,sha256=S46nVAlXgGe8wNcBEhW8ffGJjGNAmhhRTDTsvG9fWBE,402
|
|
7
|
+
datamint/api/endpoints/annotations_api.py,sha256=zzCiL2z7czB1ojU3CCM5QgeOuDoNB_2D3Fc8NPc41HM,46240
|
|
8
|
+
datamint/api/endpoints/channels_api.py,sha256=oQqxSw9DJzAqtVQI7-tc1llTdnsm-URx8jwtXNXnhio,867
|
|
9
|
+
datamint/api/endpoints/datasetsinfo_api.py,sha256=WdzrUzK63w9gvAP6U--P65FbD-3X-jm9TPCcYnRNjas,597
|
|
10
|
+
datamint/api/endpoints/projects_api.py,sha256=9tYIQsnMFOGTXrsoizweoWNqNue5907nbI6G9PAcYcA,7784
|
|
11
|
+
datamint/api/endpoints/resources_api.py,sha256=jlap40_wpzz8L8a-sX9tNGxsgPgP2_hv8kdb3g75-NU,48455
|
|
12
|
+
datamint/api/endpoints/users_api.py,sha256=pnkuTZ1B9Y0FtwwvXO8J64e02RSkRxnBmTl9UGSuC5I,1186
|
|
13
|
+
datamint/api/entity_base_api.py,sha256=gPE28bwv7B6JngMk9szD2XwaVhB8OwB1HJjaMYD354k,12935
|
|
14
|
+
datamint/apihandler/annotation_api_handler.py,sha256=W3vV4z3BqX1OQe1r7zr8dI-IVu4zUDxED4QttdiWV-E,57098
|
|
15
|
+
datamint/apihandler/api_handler.py,sha256=mL0gMaWePYa7zwkw92E-VMK2WjpcPt7au0KqnmsWSYw,439
|
|
16
|
+
datamint/apihandler/base_api_handler.py,sha256=Hqt3oUvXfEqF25DJkk0WOWAtNLnKaZRGtnCchKFA1ag,11669
|
|
17
|
+
datamint/apihandler/dto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
datamint/apihandler/dto/annotation_dto.py,sha256=KUeHbxLYols16q-ANNxC48eH4EA8Tc-nKmW_8xrqhy4,7119
|
|
19
|
+
datamint/apihandler/exp_api_handler.py,sha256=hFUgUgBc5rL7odK7gTW3MnrvMY1pVfJUpUdzRNobMQE,6226
|
|
20
|
+
datamint/apihandler/root_api_handler.py,sha256=jBof_XPTeq4o41CW-l-I5GHQKVa76kaX75RovS_qAM4,63384
|
|
21
|
+
datamint/client_cmd_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
datamint/client_cmd_tools/datamint_config.py,sha256=5S9sgS64F141ZcvvjCHEEgfNKwhGt4g2oJQaJqeiugA,7228
|
|
23
|
+
datamint/client_cmd_tools/datamint_upload.py,sha256=jPzvlNeBZfOOxuG6ryswJ8OG4jXuTrPtArUetoKVGj0,36073
|
|
24
|
+
datamint/configs.py,sha256=Bdp6NydYwyCJ2dk19_gf_o3M2ZyQOmMHpLi8wEWNHUk,1426
|
|
25
|
+
datamint/dataset/__init__.py,sha256=4PlUKSvVhdfQvvuq8jQXrkdqnot-iTTizM3aM1vgSwg,47
|
|
26
|
+
datamint/dataset/annotation.py,sha256=qN1IMjdfLD2ceQ6va3l76jOXA8Vb_c-eBk1oWQu6hW0,7994
|
|
27
|
+
datamint/dataset/base_dataset.py,sha256=FtbuZ0YXjj44CTt5IN30XqCWetCSNGL8rTYpO0UWpNM,49472
|
|
28
|
+
datamint/dataset/dataset.py,sha256=It-HOTi83ls4ww2qCAvFYU0_OLLrFclj0QQapMYgDAE,27333
|
|
29
|
+
datamint/entities/__init__.py,sha256=tbHE7rZb0R9Hm-Dc8VWEq3PlRl7BYOzffumrV0ZdsMs,444
|
|
30
|
+
datamint/entities/annotation.py,sha256=ochAEh_JqxAe_FyYTNUfPT47KiIAG7CkBTim52bu7M8,6636
|
|
31
|
+
datamint/entities/base_entity.py,sha256=DniakCgJ-gV7Hz8VKQA_dRYTp4DU5rcjLBVOuD1aZuA,1902
|
|
32
|
+
datamint/entities/channel.py,sha256=9fl22eSx_ng98NosfQGs18cdaRdbeC3wXL61KhSg4Zo,1601
|
|
33
|
+
datamint/entities/datasetinfo.py,sha256=O73Aq0tLflQomFzseful8a_cXqKdO9w2yP0p3zBcA-s,489
|
|
34
|
+
datamint/entities/project.py,sha256=cK03qfVBVUTFJF0IZQCGfjX-ivzDytySakKoVbjfnz0,2588
|
|
35
|
+
datamint/entities/resource.py,sha256=7YCVihswd-bH-2AH4aMPIddt5ejwRqRFQAszI_sTWaU,4882
|
|
36
|
+
datamint/entities/user.py,sha256=MREHDOsV9NOBEbXqiQ2ww6DmetN07CELId-ZQVpZCb8,620
|
|
37
|
+
datamint/examples/__init__.py,sha256=zcYnd5nLVme9GCTPYH-1JpGo8xXK2WEYvhzcy_2alZc,39
|
|
38
|
+
datamint/examples/example_projects.py,sha256=sU-Gxy7PPqA0WUfN-ZmXV-0YnwrnzpJ79lMXTJp2DzU,2804
|
|
39
|
+
datamint/exceptions.py,sha256=jjtoc5EUbGZhAhaoIbnRrolV7O8jRerYdjzeFwx1fmA,909
|
|
40
|
+
datamint/experiment/__init__.py,sha256=5qQOMzoG17DEd1YnTF-vS0qiM-DGdbNh42EUo91CRhQ,34
|
|
41
|
+
datamint/experiment/_patcher.py,sha256=ZgbezoevAYhJsbiJTvWPALGTcUiMT371xddcTllt3H4,23296
|
|
42
|
+
datamint/experiment/experiment.py,sha256=aHK9dRFdQTi569xgUg1KqlCZLHZpDmSH3g3ndPIZvXw,44546
|
|
43
|
+
datamint/logging.yaml,sha256=tOMxtc2UmwlIMTK6ljtnBwTco1PNrPeq3mx2iMuSbiw,482
|
|
44
|
+
datamint/utils/logging_utils.py,sha256=9pRoaPrWu2jOdDCiAoUsjEdP5ZwaealWL3hjUqFvx9g,4022
|
|
45
|
+
datamint/utils/torchmetrics.py,sha256=lwU0nOtsSWfebyp7dvjlAggaqXtj5ohSEUXOg3L0hJE,2837
|
|
46
|
+
datamint/utils/visualization.py,sha256=yaUVAOHar59VrGUjpAWv5eVvQSfztFG0eP9p5Vt3l-M,4470
|
|
47
|
+
datamint-2.0.1.dist-info/METADATA,sha256=cv5nPgETktlGFYe_NrQ4p15zPj0glLobP0nzAZxwTNU,4182
|
|
48
|
+
datamint-2.0.1.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
|
|
49
|
+
datamint-2.0.1.dist-info/entry_points.txt,sha256=mn5H6jPjO-rY0W0CAZ6Z_KKWhMLvyVaSpoqk77jlTI4,145
|
|
50
|
+
datamint-2.0.1.dist-info/RECORD,,
|
datamint-1.9.3.dist-info/RECORD
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
datamint/__init__.py,sha256=7rKCCsaa4RBRTIfuHB708rai1xwDHLtkFNFJGKYG5D4,757
|
|
2
|
-
datamint/apihandler/annotation_api_handler.py,sha256=W3vV4z3BqX1OQe1r7zr8dI-IVu4zUDxED4QttdiWV-E,57098
|
|
3
|
-
datamint/apihandler/api_handler.py,sha256=cdVSddrFCKlF_BJ81LO1aJ0OP49rssjpNEFzJ6Q7YyY,384
|
|
4
|
-
datamint/apihandler/base_api_handler.py,sha256=An9chkUcq_v2_Tkr9TbwI_lnsXCyNYgugxK9nRu4oG8,12126
|
|
5
|
-
datamint/apihandler/dto/annotation_dto.py,sha256=qId1RK1VO7dXrvGJ7dqJ31jBQB7Z8yy5x0tLSiMxTB4,7105
|
|
6
|
-
datamint/apihandler/exp_api_handler.py,sha256=hFUgUgBc5rL7odK7gTW3MnrvMY1pVfJUpUdzRNobMQE,6226
|
|
7
|
-
datamint/apihandler/root_api_handler.py,sha256=jBof_XPTeq4o41CW-l-I5GHQKVa76kaX75RovS_qAM4,63384
|
|
8
|
-
datamint/client_cmd_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
datamint/client_cmd_tools/datamint_config.py,sha256=5S9sgS64F141ZcvvjCHEEgfNKwhGt4g2oJQaJqeiugA,7228
|
|
10
|
-
datamint/client_cmd_tools/datamint_upload.py,sha256=CKd3gnKUVSRn0eC3BfC0S0P_vB9fQNmiJ2NTCJgg8c4,36804
|
|
11
|
-
datamint/configs.py,sha256=Bdp6NydYwyCJ2dk19_gf_o3M2ZyQOmMHpLi8wEWNHUk,1426
|
|
12
|
-
datamint/dataset/__init__.py,sha256=4PlUKSvVhdfQvvuq8jQXrkdqnot-iTTizM3aM1vgSwg,47
|
|
13
|
-
datamint/dataset/annotation.py,sha256=qN1IMjdfLD2ceQ6va3l76jOXA8Vb_c-eBk1oWQu6hW0,7994
|
|
14
|
-
datamint/dataset/base_dataset.py,sha256=S0pboog2yB2LCBGOocBIlOU8to7Wgov3gXTOJ9gbvz0,49697
|
|
15
|
-
datamint/dataset/dataset.py,sha256=8e0MFgINgbw6_UJh7pNQIREp2XxstIVCupyduW05Nfw,27321
|
|
16
|
-
datamint/examples/__init__.py,sha256=zcYnd5nLVme9GCTPYH-1JpGo8xXK2WEYvhzcy_2alZc,39
|
|
17
|
-
datamint/examples/example_projects.py,sha256=7Nb_EaIdzJTQa9zopqc-WhTBQWQJSoQZ_KjRS4PB4FI,2931
|
|
18
|
-
datamint/exceptions.py,sha256=AdpAC528xrml7LfWt04zQK8pONoDBx8WmXSvzRGi52o,106
|
|
19
|
-
datamint/experiment/__init__.py,sha256=5qQOMzoG17DEd1YnTF-vS0qiM-DGdbNh42EUo91CRhQ,34
|
|
20
|
-
datamint/experiment/_patcher.py,sha256=ZgbezoevAYhJsbiJTvWPALGTcUiMT371xddcTllt3H4,23296
|
|
21
|
-
datamint/experiment/experiment.py,sha256=aHK9dRFdQTi569xgUg1KqlCZLHZpDmSH3g3ndPIZvXw,44546
|
|
22
|
-
datamint/logging.yaml,sha256=tOMxtc2UmwlIMTK6ljtnBwTco1PNrPeq3mx2iMuSbiw,482
|
|
23
|
-
datamint/utils/logging_utils.py,sha256=9pRoaPrWu2jOdDCiAoUsjEdP5ZwaealWL3hjUqFvx9g,4022
|
|
24
|
-
datamint/utils/torchmetrics.py,sha256=lwU0nOtsSWfebyp7dvjlAggaqXtj5ohSEUXOg3L0hJE,2837
|
|
25
|
-
datamint/utils/visualization.py,sha256=yaUVAOHar59VrGUjpAWv5eVvQSfztFG0eP9p5Vt3l-M,4470
|
|
26
|
-
datamint-1.9.3.dist-info/METADATA,sha256=gAyuwZSWmgg7tzzD8RcfNM_TV5N9ec-phDRB1W3gO1Y,4100
|
|
27
|
-
datamint-1.9.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
28
|
-
datamint-1.9.3.dist-info/entry_points.txt,sha256=mn5H6jPjO-rY0W0CAZ6Z_KKWhMLvyVaSpoqk77jlTI4,145
|
|
29
|
-
datamint-1.9.3.dist-info/RECORD,,
|
|
File without changes
|