79 if (tmp_node->parent ==
nullptr)
81 tmp_node = tmp_node->parent;
95 if (tmp_node->parent ==
nullptr)
97 tmp_node = tmp_node->parent;
99 for (k = 0; k < tmp_node->nchild(); k++)
101 return (tmp_node->children[k]);
110 QList<FiffDirNode::SPtr> temp;
112 if (temp.size() == 0) {
128 QList<FiffDirNode::SPtr> temp;
139 std::unique_ptr<FiffId>&
id,
144 QList<FiffChInfo>& chp,
149 QList<FiffChInfo> ch;
154 QList<FiffDirNode::SPtr> hpi;
165 printf (
"Meas. block not found!");
170 printf (
"Meas. info not found!");
176 if (!meas->id.isEmpty()) {
177 id = std::make_unique<FiffId>();
178 id->version = meas->id.version;
179 id->machid[0] = meas->id.machid[0];
180 id->machid[1] = meas->id.machid[1];
181 id->time = meas->id.time;
188 for (k = 0; k < node->nent(); k++) {
189 kind = node->dir[k]->kind;
190 pos = node->dir[k]->pos;
194 if (!stream->read_tag(t_pTag,pos))
196 *
nchan = *t_pTag->toInt();
198 for (j = 0; j < *
nchan; j++) {
202 to_find = to_find + *
nchan - 1;
206 if (!stream->read_tag(t_pTag,pos))
208 *
sfreq = *t_pTag->toFloat();
213 if (!stream->read_tag(t_pTag,pos))
220 if (!stream->read_tag(t_pTag,pos))
227 if (!stream->read_tag(t_pTag,pos))
230 this_ch = t_pTag->toChInfo();
232 qCritical (
"FIFF_CH_INFO : scan # out of range!");
236 ch[this_ch.
scanNo-1] = this_ch;
241 if (!stream->read_tag(t_pTag,pos))
247 if (!stream->read_tag(t_pTag,pos))
266 if (hpi.size() > 0 &&
trans.isEmpty())
267 for (k = 0; k < hpi[0]->nent(); k++)
269 if (!stream->read_tag(t_pTag,hpi[0]->dir[k]->pos))
288 printf (
"Not all essential tags were found!");
301int MNERawInfo::load(
const QString& name,
int allow_maxshield, std::unique_ptr<MNERawInfo>& infop)
307 QList<FiffChInfo> chs;
309 std::unique_ptr<FiffId>
id;
310 QList<FiffDirEntry::SPtr>
rawDir;
311 std::unique_ptr<MNERawInfo> info;
326 if (raw->isEmpty()) {
327 if (allow_maxshield) {
329 if (raw->isEmpty()) {
330 printf(
"No raw data in this file.");
336 printf(
"No raw data in this file.");
361 info = std::make_unique<MNERawInfo>();
362 info->filename = name;
366 info->trans = std::make_unique<FiffCoordTrans>(
trans);
372 info->id = std::make_unique<FiffId>(*
id);
381 info->start_time =
id->time;
383 info->start_time.secs = 0;
384 info->start_time.usecs = 0;
388 for (k = 0; k < raw->nent(); k++) {
397 printf(
"We are not prepared to handle raw data type: %d",raw->dir[k]->type);
403 if (info->buf_size <= 0) {
404 printf(
"No raw data buffers available.");
408 info->ndir = raw->nent();
409 infop = std::move(info);
FiffTag class declaration, which provides fiff tag I/O and processing methods.
#define FIFFV_COORD_DEVICE
#define FIFFB_SMSH_RAW_DATA
#define FIFFB_CONTINUOUS_DATA
MNERawInfo class declaration.
Core MNE data structures (source spaces, source estimates, hemispheres).
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
Coordinate transformation description.
QSharedPointer< FiffDirNode > SPtr
QSharedPointer< FiffStream > SPtr
QSharedPointer< FiffTag > SPtr
Time stamp record storing seconds and microseconds since epoch.
FIFFLIB::FiffTime start_time
QList< FIFFLIB::FiffDirEntry::SPtr > rawDir
static int get_meas_info(FIFFLIB::FiffStream::SPtr &stream, FIFFLIB::FiffDirNode::SPtr &node, std::unique_ptr< FIFFLIB::FiffId > &id, int *nchan, float *sfreq, float *highpass, float *lowpass, QList< FIFFLIB::FiffChInfo > &chp, FIFFLIB::FiffCoordTrans &trans, FIFFLIB::FiffTime **start_time)
MNERawInfo()
Constructs a default MNERawInfo.
static FIFFLIB::FiffDirNode::SPtr find_maxshield(const FIFFLIB::FiffDirNode::SPtr &node)
static FIFFLIB::FiffDirNode::SPtr find_meas_info(const FIFFLIB::FiffDirNode::SPtr &node)
static int load(const QString &name, int allow_maxshield, std::unique_ptr< MNERawInfo > &infop)
static FIFFLIB::FiffDirNode::SPtr find_raw(const FIFFLIB::FiffDirNode::SPtr &node)
static FIFFLIB::FiffDirNode::SPtr find_meas(const FIFFLIB::FiffDirNode::SPtr &node)
std::unique_ptr< FIFFLIB::FiffId > id
~MNERawInfo()
Destroys the MNERawInfo and releases owned resources.
std::unique_ptr< FIFFLIB::FiffCoordTrans > trans
static FiffCoordTrans readFromTag(const QSharedPointer< FiffTag > &tag)