57#define FREE_33(x) if ((char *)(x) != NULL) free((char *)(x))
59#define MALLOC_33(x,t) (t *)malloc((x)*sizeof(t))
66using namespace FIFFLIB;
67using namespace MNELIB;
97 while (tmp_node->type != FIFFB_MEAS) {
98 if (tmp_node->parent == NULL)
100 tmp_node = tmp_node->parent;
116 while (tmp_node->type != FIFFB_MEAS) {
117 if (tmp_node->parent == NULL)
119 tmp_node = tmp_node->parent;
121 for (
k = 0;
k < tmp_node->nchild();
k++)
122 if (tmp_node->children[
k]->type == FIFFB_MEAS_INFO)
123 return (tmp_node->children[
k]);
135 QList<FiffDirNode::SPtr> temp;
136 temp = node->dir_tree_find(FIFFB_RAW_DATA);
137 if (temp.size() == 0) {
138 temp = node->dir_tree_find(FIFFB_CONTINUOUS_DATA);
153 QList<FiffDirNode::SPtr> temp;
169 QList<FiffChInfo>& chp,
181 QList<FiffChInfo> ch;
186 QList<FiffDirNode::SPtr> hpi;
188 fiff_int_t kind, pos;
198 if (!(meas = find_meas(node))) {
200 printf (
"Meas. block not found!");
205 if (!(node = find_meas_info(node))) {
207 printf (
"Meas. info not found!");
214 if (!meas->id.isEmpty()) {
217 (*id)->version = meas->id.version;
218 (*id)->machid[0] = meas->id.machid[0];
219 (*id)->machid[1] = meas->id.machid[1];
220 (*id)->time = meas->id.time;
227 for (
k = 0;
k < node->nent();
k++) {
228 kind = node->dir[
k]->kind;
229 pos = node->dir[
k]->pos;
236 if (!stream->read_tag(t_pTag,pos))
238 *
nchan = *t_pTag->toInt();
240 for (j = 0; j < *
nchan; j++) {
244 to_find = to_find + *
nchan - 1;
251 if (!stream->read_tag(t_pTag,pos))
253 *
sfreq = *t_pTag->toFloat();
261 if (!stream->read_tag(t_pTag,pos))
271 if (!stream->read_tag(t_pTag,pos))
281 if (!stream->read_tag(t_pTag,pos))
284 this_ch = t_pTag->toChInfo();
286 qCritical (
"FIFF_CH_INFO : scan # out of range!");
290 ch[this_ch.
scanNo-1] = this_ch;
297 if (!stream->read_tag(t_pTag,pos))
310 if (!stream->read_tag(t_pTag,pos))
314 t = FiffCoordTransOld::read_helper( t_pTag );
318 if (t->
from == FIFFV_COORD_DEVICE && t->
to == FIFFV_COORD_HEAD) {
332 hpi = node->dir_tree_find(FIFFB_HPI_RESULT);
336 if (hpi.size() > 0 && *
trans == NULL)
337 for (
k = 0;
k < hpi[0]->nent();
k++)
342 if (!stream->read_tag(t_pTag,hpi[0]->dir[
k]->pos))
344 t = FiffCoordTransOld::read_helper( t_pTag );
348 if (t->
from == FIFFV_COORD_DEVICE && t->
to == FIFFV_COORD_HEAD) {
365 printf (
"Not all essential tags were found!");
380int MneRawInfo::mne_load_raw_info(
const QString& name,
int allow_maxshield,
MneRawInfo **infop)
391 QList<FiffChInfo> chs;
394 QList<FiffDirEntry::SPtr>
rawDir;
412 raw = find_raw(stream->dirtree());
413 if (raw->isEmpty()) {
414 if (allow_maxshield) {
415 raw = find_maxshield(stream->dirtree());
416 if (raw->isEmpty()) {
417 printf(
"No raw data in this file.");
423 printf(
"No raw data in this file.");
430 if (get_meas_info (stream,
482 for (
k = 0;
k < raw->nent();
k++) {
487 if (raw->dir[
k]->type == FIFFT_DAU_PACK16 || raw->dir[
k]->type == FIFFT_SHORT)
489 else if (raw->dir[
k]->type == FIFFT_FLOAT)
491 else if (raw->dir[
k]->type == FIFFT_INT)
494 printf(
"We are not prepared to handle raw data type: %d",raw->dir[
k]->type);
501 printf(
"No raw data buffers available.");
505 info->
ndir = raw->nent();
510 if (res != FIFF_OK) {
FiffTag class declaration, which provides fiff tag I/O and processing methods.
#define FIFFB_SMSH_RAW_DATA
MneRawInfo class declaration.
Coordinate transformation descriptor.
ToDo Old implementation use new fiff_id.h instead.
QSharedPointer< FiffDirNode > SPtr
QSharedPointer< FiffStream > SPtr
QSharedPointer< FiffTag > SPtr
Information about raw data in fiff file.
QList< FIFFLIB::FiffChInfo > chInfo
FIFFLIB::FiffCoordTransOld * trans
QList< FIFFLIB::FiffDirEntry::SPtr > rawDir
FIFFLIB::fiffTimeRec start_time