Skip to main content

MnaSubject

Namespace: MNALIB  ·  Library: MNA Library

#include <mna/mna_subject.h>

struct MNALIB::MnaSubject

Represents a subject (participant) in the project.

src/examples/ex_mna/main.cpp
MnaFileRef raw;
raw.role = MnaFileRole::Raw;
raw.path = "sub-01/ses-01/meg/sample_audvis_raw.fif"; // relative POSIX path
raw.format = "fiff";
MnaRecording recording;
recording.id = "run-01";
recording.files.append(raw);
MnaSession session;
session.id = "ses-01";
session.recordings.append(recording);
MnaSubject subject;
subject.id = "sub-01";
subject.freeSurferDir = "subjects/sample";
subject.sessions.append(session);
MnaScript report; // a script node: inline code run by an interpreter
report.language = "python";
report.code = "print({{in}})";

Public Methods​

toJson()​

Serialize to QJsonObject.

Returns:

  • QJsonObject — JSON object with the subject id, FreeSurfer directory, sessions and preserved extras.

toCbor()​

Serialize to QCborMap.

Returns:

  • QCborMap — CBOR map with the subject id, FreeSurfer directory, sessions and preserved extras.

Static Methods​

fromJson(json)​

Deserialize from QJsonObject.

Parameters:

  • json : const QJsonObject & JSON object as produced by toJson().

Returns:

  • MnaSubject — The subject; missing keys take default values and unknown keys go to extras.

fromCbor(cbor)​

Deserialize from QCborMap.

Parameters:

  • cbor : const QCborMap & CBOR map as produced by toCbor().

Returns:

  • MnaSubject — The subject; missing keys take default values and unknown keys go to extras.

Example​

Used in examples​

ex_mna​

MNA library: register operations, build and run a graph, bind parameters and save a project.

src/examples/ex_mna/main.cpp, line 200
MnaSession session;
session.id = "ses-01";
session.recordings.append(recording);
MnaSubject subject;
subject.id = "sub-01";
subject.freeSurferDir = "subjects/sample";
subject.sessions.append(session);
MnaScript report; // a script node: inline code run by an interpreter
report.language = "python";
report.code = "print({{in}})";

Authors of this file​