diff --git a/afids_utils/afids.py b/afids_utils/afids.py index 968e90d0..cb967ef0 100644 --- a/afids_utils/afids.py +++ b/afids_utils/afids.py @@ -11,9 +11,27 @@ from afids_utils.exceptions import InvalidFiducialError, InvalidFileError -@attrs.define +@attrs.define(kw_only=True) class AfidPosition: - """Base class for a single AFID position""" + """Base class for a single AFID position + + Parameters + ---------- + label + Unique label for AFID + + x + Spatial position along x-axis (in mm) + + y + Spatial position along y-axis (in mm) + + z + Spatial position along z-axis (in mm) + + desc + Description for AFID (e.g. AC, PC) + """ label: int = attrs.field() x: float = attrs.field() @@ -22,9 +40,21 @@ class AfidPosition: desc: str = attrs.field(default="") -@attrs.define +@attrs.define(kw_only=True) class AfidSet: - """Base class for a set of AFIDs""" + """Base class for a set of AFIDs + + Parameters + ---------- + slicer_version + Version of Slicer associated with AfidSet + + coord_system + Coordinate system AFIDs are placed in (e.g. RAS) + + afids + List of AFID labels and their coordinates + """ slicer_version: str = attrs.field() coord_system: str = attrs.field() diff --git a/afids_utils/exceptions.py b/afids_utils/exceptions.py index aa90c5a6..b8722656 100644 --- a/afids_utils/exceptions.py +++ b/afids_utils/exceptions.py @@ -1,4 +1,4 @@ -"""Custom exceptions""" +"""Custom exceptions to raise for various errors""" class InvalidFileError(Exception): @@ -11,5 +11,5 @@ def __init__(self, message): class InvalidFiducialError(Exception): """Exception for invalid fiducial selection""" - def __init__(self, message) -> None: + def __init__(self, message): super().__init__(message) diff --git a/docs/api/afids.md b/docs/api/afids.md index e47b3cb9..6f0dfc90 100644 --- a/docs/api/afids.md +++ b/docs/api/afids.md @@ -1,9 +1,14 @@ ## afids_utils.afids ```{eval-rst} - .. autoclass: afids_utils.afids.AfidPosition + .. autoclass:: afids_utils.afids.AfidPosition :members: + :exclude-members: label, desc, x, y, z +``` + +```{eval-rst} .. autoclass:: afids_utils.afids.AfidSet :members: -``` \ No newline at end of file + :exclude-members: slicer_version, coord_system, afids +``` diff --git a/docs/exceptions/exceptions.md b/docs/exceptions/exceptions.md index 33b1fc91..dbadd2d2 100644 --- a/docs/exceptions/exceptions.md +++ b/docs/exceptions/exceptions.md @@ -1,9 +1,6 @@ ## afids_utils.exceptions ```{eval-rst} - .. autoclass: afids_utils.exceptions.InvalidFileError + .. automodule:: afids_utils.exceptions :members: - - .. autoclass:: afids_utils.exceptions.InvalidFiducialError - :members: -``` \ No newline at end of file +```