Skip to content

Commit

Permalink
update docstrings for the afids class
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitj committed Aug 28, 2023
1 parent fc2c7e6 commit d774042
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
18 changes: 16 additions & 2 deletions afids_utils/afids.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,38 @@
from afids_utils.exceptions import InvalidFiducialError, InvalidFileError


@attrs.define
@attrs.define(kw_only=True)
class AfidPosition:
"""Base class for a single AFID position"""

label: int = attrs.field()
"""Unique label for AFID"""

x: float = attrs.field()
"""Spatial position along x-axis (in mm)"""

y: float = attrs.field()
"""Spatial position along y-axis (in mm)"""

z: float = attrs.field()
"""Spatial position along z-axis (in mm)"""

desc: str = attrs.field()
"""Description for AFID (e.g. AC, PC)"""


@attrs.define
@attrs.define(kw_only=True)
class AfidSet:
"""Base class for a set of AFIDs"""

slicer_version: str = attrs.field()
"""Version of Slicer associated with AfidSet"""

coord_system: str = attrs.field()
"""Coordinate system AFIDs are placed in (e.g. RAS)"""

afids: list[AfidPosition] = attrs.field()
"""List of AFID labels and their coordinates"""

@classmethod
def load(cls, afids_fpath: PathLike[str] | str) -> AfidSet:
Expand Down
7 changes: 5 additions & 2 deletions docs/api/afids.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
## afids_utils.afids

```{eval-rst}
.. autoclass: afids_utils.afids.AfidPosition
.. autoclass:: afids_utils.afids.AfidPosition
:members:
```

```{eval-rst}
.. autoclass:: afids_utils.afids.AfidSet
:members:
```
```

0 comments on commit d774042

Please sign in to comment.