openlifu.db.subject.Subject

class openlifu.db.subject.Subject(id: Annotated[str | None, OpenLIFUFieldData('Subject ID', 'ID of the subject')] = None, name: Annotated[str | None, OpenLIFUFieldData('Subject name', 'Name of the subject')] = None, attrs: Annotated[dict, OpenLIFUFieldData('Attributes', 'Dictionary of attributes')] = <factory>)[source]

Bases: DictMixin

Class representing a subject

attrs: Annotated[dict, OpenLIFUFieldData('Attributes', 'Dictionary of attributes')]

Dictionary of attributes

static from_file(filename)[source]

Create a subject from a file

Parameters:

filename – Name of the file to read

Returns:

Subject object

id: Annotated[str | None, OpenLIFUFieldData('Subject ID', 'ID of the subject')] = None

ID of the subject

name: Annotated[str | None, OpenLIFUFieldData('Subject name', 'Name of the subject')] = None

Name of the subject

to_file(filename)[source]

Write the subject to a file

Parameters:

filename – Name of the file to write