Skip to main content

MnaFileRef

Namespace: MNALIB  ·  Library: MNA Library

#include <mna/mna_file_ref.h>

struct MNALIB::MnaFileRef

A reference to a file within an MNA 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 all fields and preserved extras; embedded data is Base64-encoded.

toCbor()​

Serialize to QCborMap.

Returns:

  • QCborMap — CBOR map with all fields and preserved extras; embedded data is stored as a byte string.

Static Methods​

fromJson(json)​

Deserialize from QJsonObject.

Parameters:

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

Returns:

  • MnaFileRef — The file reference; 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:

  • MnaFileRef — The file reference; 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 193
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);

Authors of this file​