Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ dependencies = [
"torch-grid-utils>=0.0.8",
"torch-affine-utils",
"torch-subpixel-crop",
"teamtomo-basemodel",
"pydantic",
]

# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
Expand Down
42 changes: 42 additions & 0 deletions src/torch_tomogram/datamodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from typing import Annotated, Optional
from datetime import datetime
from teamtomo_basemodel import BaseModelTeamTomo, ExcludedTensor
from pydantic import Field, AliasPath


class RigidBodyAlignment(BaseModelTeamTomo):
"""Rigid body alignment parameters

The alignment describes a forward projection model from the sample to
the record exposure in the detector.
"""
# rotation parameters
z_rotation_degrees: float = Field(alias='tilt_axis_angle', default=0.0)
y_rotation_degrees: float = Field(alias='tilt_angle', default=0.0)
x_rotation_degrees: float = Field(alias='x_tilt', default=0.0)

# global image shifts
y_shift_angstrom: float = Field(default=0.0)
x_shift_angstrom: float = Field(default=0.0)


class Optics(BaseModelTeamTomo):
defocus_u: float
defocus_v: float
# etc...


class Exposure(BaseModelTeamTomo):
collection_time: Optional[datetime] = None
accumulated_dose: float = Field(default=0.0, gt=0.0) # in e- per A^2

alignment: RigidBodyAlignment
optics: Optics


class ExposureSeries(BaseModelTeamTomo):
pixel_spacing_angstrom: float = Field(gt=0.0)
image_stack: ExcludedTensor
exposure_list: list[Exposure] =(
Field(description="A list of metadata around tilt images")
)
Loading