datamint.api.dto

class datamint.api.dto.AnnotationType(*values)

Bases: StrEnum

ANGLE = 'angle'
AREA = 'area'
CATEGORY = 'category'
CIRCLE = 'circle'
DISTANCE = 'distance'
LABEL = 'label'
LINE = 'line'
POINT = 'point'
REGION = 'region'
SEGMENTATION = 'segmentation'
SQUARE = 'square'
class datamint.api.dto.BoxGeometry(point1, point2)

Bases: Geometry

Parameters:
  • point1 (tuple[float, float, float])

  • point2 (tuple[float, float, float])

static from_dicom(ds, point1, point2, slice_index=None)

Create a box geometry from DICOM pixel coordinates.

Parameters:
  • ds (Dataset) – DICOM dataset containing spatial metadata

  • point1 (tuple[int, int]) – First corner in pixel coordinates (x, y)

  • point2 (tuple[int, int]) – Opposite corner in pixel coordinates (x, y)

  • slice_index (int | None) – The slice/frame index for 3D positioning

Return type:

BoxGeometry

Returns:

BoxGeometry with patient coordinate points

to_dict()
Return type:

dict

class datamint.api.dto.CreateAnnotationDto(type, identifier, scope, annotation_worklist_id=None, value=None, imported_from=None, import_author=None, frame_index=None, is_model=None, model_id=None, geometry=None, units=None)

Bases: object

Parameters:
  • type (AnnotationType | str)

  • identifier (str)

  • scope (str)

  • annotation_worklist_id (str | None)

  • imported_from (str | None)

  • import_author (str | None)

  • frame_index (int | None)

  • is_model (bool)

  • model_id (str | None)

  • geometry (Geometry | None)

  • units (str)

to_dict()
Return type:

dict[str, Any]

class datamint.api.dto.Geometry(type)

Bases: object

Parameters:

type (AnnotationType | str)

to_dict()
Return type:

dict

class datamint.api.dto.LineGeometry(point1, point2)

Bases: Geometry

Parameters:
  • point1 (tuple[float, float, float])

  • point2 (tuple[float, float, float])

static from_dicom(ds, point1, point2, slice_index=None)
Parameters:
  • ds (Dataset)

  • point1 (tuple[int, int])

  • point2 (tuple[int, int])

  • slice_index (int | None)

Return type:

LineGeometry

to_dict()
Return type:

dict