|
| 1 | +from decimal import Decimal |
| 2 | + |
| 3 | +from sqlalchemy import ForeignKey |
| 4 | +from sqlalchemy.orm import Mapped, mapped_column, relationship |
| 5 | + |
| 6 | +import lib.db.models.meg_ctf_head_shape_file as db_meg_ctf_head_shape_file |
| 7 | +from lib.db.base import Base |
| 8 | + |
| 9 | + |
| 10 | +# TODO: It might be possible that headshape files contain points in other units than centimeters, |
| 11 | +# in which case the database should be extended to handle it. |
| 12 | +class DbMegCtfHeadShapePoint(Base): |
| 13 | + """ |
| 14 | + A 3D point present in a MEG CTF `headshape.pos` file. |
| 15 | + """ |
| 16 | + |
| 17 | + __tablename__ = 'meg_ctf_head_shape_point' |
| 18 | + |
| 19 | + id: Mapped[int] = mapped_column('ID', primary_key=True) |
| 20 | + """ |
| 21 | + ID of the head shape point. |
| 22 | + """ |
| 23 | + |
| 24 | + file_id: Mapped[int] = mapped_column('FileID', ForeignKey('meg_ctf_head_shape_file.ID')) |
| 25 | + """ |
| 26 | + ID of the head shape file to which this point belongs. |
| 27 | + """ |
| 28 | + |
| 29 | + name: Mapped[str] = mapped_column('Name') |
| 30 | + """ |
| 31 | + Name of the point, which may either be an integer or an anatomical landmark label. |
| 32 | + """ |
| 33 | + |
| 34 | + x: Mapped[Decimal] = mapped_column('X') |
| 35 | + """ |
| 36 | + X coordinate of the point in the head shape file, in centimeters. |
| 37 | + """ |
| 38 | + |
| 39 | + y: Mapped[Decimal] = mapped_column('Y') |
| 40 | + """ |
| 41 | + Y coordinate of the point in the head shape file, in centimeters. |
| 42 | + """ |
| 43 | + |
| 44 | + z: Mapped[Decimal] = mapped_column('Z') |
| 45 | + """ |
| 46 | + Z coordinate of the point in the head shape file, in centimeters. |
| 47 | + """ |
| 48 | + |
| 49 | + file: Mapped['db_meg_ctf_head_shape_file.DbMegCtfHeadShapeFile'] = relationship('DbMegCtfHeadShapeFile', back_populates='points') |
| 50 | + """ |
| 51 | + The head shape file to which this point belongs. |
| 52 | + """ |
0 commit comments