Skip to content

brainhops.datamodel.orientation

Orientations of an axis or a space, such as left-to-right.

Attributes

R module-attribute

Singleton left-to-right orientation.

leftToRight module-attribute

leftToRight = LeftToRight()

Singleton left-to-right orientation.

L module-attribute

Singleton right-to-left orientation.

rightToLeft module-attribute

rightToLeft = RightToLeft()

Singleton right-to-left orientation.

A module-attribute

Singleton posterior-to-anterior orientation.

posteriorToAnterior module-attribute

posteriorToAnterior = PosteriorToAnterior()

Singleton posterior-to-anterior orientation.

P module-attribute

Singleton anterior-to-posterior orientation.

anteriorToPosterior module-attribute

anteriorToPosterior = AnteriorToPosterior()

Singleton anterior-to-posterior orientation.

I module-attribute

Singleton superior-to-inferior orientation.

superiorToInferior module-attribute

superiorToInferior = SuperiorToInferior()

Singleton superior-to-inferior orientation.

S module-attribute

Singleton inferior-to-superior orientation.

inferiorToSuperior module-attribute

inferiorToSuperior = InferiorToSuperior()

Singleton inferior-to-superior orientation.

Classes

Orientation magic

Orientation(
    value: str | bytes | None = None,
    type: OrientationType | str | bytes | None = None,
)

Bases: DataModelBase

Describes the orientation of an axis or a space.

An orientation has a type, drawn from OrientationType, that names the frame of reference it belongs to. Its value identifies the specific orientation within that frame, for example "left-to-right" for an anatomical orientation.

Fields

Field Type Default Notes
value str \| None None converted
type brainhops.datamodel.enums.OrientationType \| None None converted

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

AnatomicalOrientation magic

AnatomicalOrientation(
    value: str | bytes | None = None,
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: Orientation

An orientation in the anatomical frame of reference.

Fields

Field Type Default Notes
value str \| None None converted
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

LeftToRight magic

LeftToRight(
    value: Literal[left - to - right]
    | str
    | bytes = "left-to-right",
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: AnatomicalOrientation

The anatomical orientation in which coordinates increase from the left of the subject toward the right.

Fields

Field Type Default Notes
value Literal['left-to-right'] 'left-to-right' frozen, converted, validated
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

__hash__ generated
__hash__()

Hash the fields that take part in the comparison.

__getstate__ generated
__getstate__()

Save and restore the fields, for pickling and copying.

__setstate__ generated
__setstate__(state)

Save and restore the fields, for pickling and copying.

RightToLeft magic

RightToLeft(
    value: Literal[right - to - left]
    | str
    | bytes = "right-to-left",
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: AnatomicalOrientation

The anatomical orientation in which coordinates increase from the right of the subject toward the left.

Fields

Field Type Default Notes
value Literal['right-to-left'] 'right-to-left' frozen, converted, validated
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

__hash__ generated
__hash__()

Hash the fields that take part in the comparison.

__getstate__ generated
__getstate__()

Save and restore the fields, for pickling and copying.

__setstate__ generated
__setstate__(state)

Save and restore the fields, for pickling and copying.

AnteriorToPosterior magic

AnteriorToPosterior(
    value: Literal[anterior - to - posterior]
    | str
    | bytes = "anterior-to-posterior",
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: AnatomicalOrientation

The anatomical orientation in which coordinates increase from the front of the subject toward the back.

Fields

Field Type Default Notes
value Literal['anterior-to-posterior'] 'anterior-to-posterior' frozen, converted, validated
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

__hash__ generated
__hash__()

Hash the fields that take part in the comparison.

__getstate__ generated
__getstate__()

Save and restore the fields, for pickling and copying.

__setstate__ generated
__setstate__(state)

Save and restore the fields, for pickling and copying.

PosteriorToAnterior magic

PosteriorToAnterior(
    value: Literal[posterior - to - anterior]
    | str
    | bytes = "posterior-to-anterior",
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: AnatomicalOrientation

The anatomical orientation in which coordinates increase from the back of the subject toward the front.

Fields

Field Type Default Notes
value Literal['posterior-to-anterior'] 'posterior-to-anterior' frozen, converted, validated
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

__hash__ generated
__hash__()

Hash the fields that take part in the comparison.

__getstate__ generated
__getstate__()

Save and restore the fields, for pickling and copying.

__setstate__ generated
__setstate__(state)

Save and restore the fields, for pickling and copying.

InferiorToSuperior magic

InferiorToSuperior(
    value: Literal[inferior - to - superior]
    | str
    | bytes = "inferior-to-superior",
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: AnatomicalOrientation

The anatomical orientation in which coordinates increase from the bottom of the subject toward the top.

Fields

Field Type Default Notes
value Literal['inferior-to-superior'] 'inferior-to-superior' frozen, converted, validated
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

__hash__ generated
__hash__()

Hash the fields that take part in the comparison.

__getstate__ generated
__getstate__()

Save and restore the fields, for pickling and copying.

__setstate__ generated
__setstate__(state)

Save and restore the fields, for pickling and copying.

SuperiorToInferior magic

SuperiorToInferior(
    value: Literal[superior - to - inferior]
    | str
    | bytes = "superior-to-inferior",
    type: Literal[anatomical] | str | bytes = "anatomical",
)

Bases: AnatomicalOrientation

The anatomical orientation in which coordinates increase from the top of the subject toward the bottom.

Fields

Field Type Default Notes
value Literal['superior-to-inferior'] 'superior-to-inferior' frozen, converted, validated
type Literal['anatomical'] 'anatomical' converted, validated

Methods:

from_dict classmethod
from_dict(other: Mapping, *args, **kwargs) -> Self

Create an instance of the class from a dictionary-like object.

Only keys in the dictionary that match keyword-like fields of this class, or the keywords its constructor takes without storing them (its InitVars, such as the matrix= of an Affine), will be used. Other keys are ignored, but see from_other, which refuses them.

Additional positional and/or keyword arguments can be provided, and will take precedence over the values in the dictionary.

A key naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: a dictionary that sets it to anything other than None or the value of this class is refused with a ValueError.

from_instance classmethod
from_instance(other: Self, *args, **kwargs) -> Self

Create an instance of the class from an instance of a similar class.

Only attributes of the other instance that match keyword-like fields of this class will be used. An attribute that is None is unset, and leaves the default of this class in place.

Additional positional and/or keyword arguments can be provided, and will take precedence over the attributes in the instance.

Unless the other instance is already an instance of this class, an attribute naming a field that this class fixes (a field that cannot be passed to its constructor) is checked instead of used: an instance that sets it to anything other than None or the value of this class is refused with a ValueError. A generic Axis whose orientation is right-to-left, for example, cannot be read as a LeftToRightAxis.

from_other classmethod
from_other(other: Any, *args, **kwargs) -> Self

Create an instance of the class from any object that can be interpreted as a dictionary, or an instance of a similar class, or an arguments to be passed to the constructor.

A similar class is this class or one of its parents within the data model, or another member of a polymorphic family this class belongs to: calling a polymorphic class such as Axis builds the subclass its arguments select, so a "generic" axis is usually an instance of a sibling (a RightToLeftAxis, a TimeAxis) rather than of a parent. Any other object, including an instance of a parent that is not a data model (such as a plain object), is passed to the constructor.

Unlike from_dict, a dictionary with a key that matches no field of this class is refused with a TypeError naming the keys, so that a misspelt key is not silently dropped.

__repr__ generated
__repr__()

Show the instance as the call that would build it again.

__eq__ generated
__eq__(other)

Compare field by field with another instance of the same class.

__hash__ generated
__hash__()

Hash the fields that take part in the comparison.

__getstate__ generated
__getstate__()

Save and restore the fields, for pickling and copying.

__setstate__ generated
__setstate__(state)

Save and restore the fields, for pickling and copying.