94 if(!this->
isMatrix() || this->data() ==
nullptr)
103 qint32* t_pInt32 = (qint32*)this->data();
105 p_ndim = t_pInt32[(this->size()-4)/4];
108 for(
int i = p_ndim+1; i > 1; --i)
109 p_Dims.append(t_pInt32[(this->size()-(i*4))/4]);
111 for(
int i = p_ndim+2; i > 1; --i)
112 p_Dims.append(t_pInt32[(this->size()-(i*4))/4]);
115 qWarning(
"Cannot handle other than dense or sparse matrices yet.");
140 QString t_qStringInfo;
147 t_qStringInfo =
"Matrix of type FIFFT_INT";
150 t_qStringInfo =
"Matrix of type FIFFT_JULIAN";
153 t_qStringInfo =
"Matrix of type FIFFT_FLOAT";
156 t_qStringInfo =
"Matrix of type FIFFT_DOUBLE";
159 t_qStringInfo =
"Matrix of type FIFFT_COMPLEX_FLOAT";
162 t_qStringInfo =
"Matrix of type FIFFT_COMPLEX_DOUBLE";
165 t_qStringInfo =
"Matrix of unknown type";
176 t_qStringInfo =
"Simple type FIFFT_BYTE";
179 t_qStringInfo =
"Simple type FIFFT_SHORT";
182 t_qStringInfo =
"Simple type FIFFT_INT";
185 t_qStringInfo =
"Simple type FIFFT_USHORT";
188 t_qStringInfo =
"Simple type FIFFT_UINT";
191 t_qStringInfo =
"Simple type FIFFT_FLOAT";
194 t_qStringInfo =
"Simple type FIFFT_DOUBLE";
197 t_qStringInfo =
"Simple type FIFFT_STRING";
200 t_qStringInfo =
"Simple type FIFFT_DAU_PACK16";
203 t_qStringInfo =
"Simple type FIFFT_COMPLEX_FLOAT";
206 t_qStringInfo =
"Simple type FIFFT_COMPLEX_DOUBLE";
212 t_qStringInfo =
"Structure FIFFT_ID_STRUCT";
215 t_qStringInfo =
"Structure FIFFT_DIG_POINT_STRUCT";
218 t_qStringInfo =
"Structure FIFFT_COORD_TRANS_STRUCT";
221 t_qStringInfo =
"Structure FIFFT_CH_INFO_STRUCT";
224 t_qStringInfo =
"Structure FIFFT_OLD_PACK";
227 t_qStringInfo =
"Structure FIFFT_DIR_ENTRY_STRUCT";
230 t_qStringInfo =
"Structure unknown";
233 return t_qStringInfo;
277 for (k = 0; k < 3; k++) {
295 int *dimp,*data,
kind,np,nz;
298 unsigned int tsize = tag->size();
302 if (tag->data() ==
nullptr)
314 for (k = 0, np = 1; k < ndim; k++) {
324 dimp = dimp - ndim - 1;
325 for (k = 0; k < ndim+1; k++)
329 np = nz + dimp[2] + 1;
331 np = nz + dimp[1] + 1;
337 for (data = (
int *)(tag->data())+nz, k = 0; k < np; k++)
346 for (data = (
int *)(tag->data()), k = 0; k < np; k++)
350 for (fdata = (
float *)(tag->data()), k = 0; k < np; k++)
354 for (ddata = (
double *)(tag->data()), k = 0; k < np; k++)
369 int *dimp,*data,
kind,np;
372 unsigned int tsize = tag->size();
376 if (tag->data() ==
nullptr)
389 for (k = 0, np = 1; k < ndim; k++) {
399 dimp = dimp - ndim - 1;
401 np = dimp[0] + dimp[2] + 1;
403 np = dimp[0] + dimp[1] + 1;
406 for (k = 0; k < ndim+1; k++)
414 for (data = (
int *)(tag->data()), k = 0; k < np; k++)
418 for (fdata = (
float *)(tag->data()), k = 0; k < np; k++)
422 for (ddata = (
double *)(tag->data()), k = 0; k < np; k++)
426 for (fdata = (
float *)(tag->data()), k = 0; k < 2*np; k++)
430 for (ddata = (
double *)(tag->data()), k = 0; k < 2*np; k++)
456 if (tag->data() ==
nullptr || tag->size() == 0)
464 if (from_endian == to_endian)
481 for (ithis = (
fiff_int_t *)tag->data(), k = 0; k < np; k++, ithis++)
488 for (lthis = (
fiff_long_t *)tag->data(), k = 0; k < np; k++, lthis++)
496 for (sthis = (
fiff_short_t *)tag->data(), k = 0; k < np; k++, sthis++)
503 for (fthis = (
fiff_float_t *)tag->data(), k = 0; k < np; k++, fthis++)
510 for (dthis = (
fiff_double_t *)tag->data(), k = 0; k < np; k++, dthis++)
515 fthis = (
float *)tag->data();
521 sthis = (
short *)(fthis+2);
522 np = (tag->size() - 2*
sizeof(
float))/
sizeof(short);
523 for (k = 0; k < np; k++,sthis++)
536 for (k = 0; k < np; k++) {
556 for (k = 0; k < np; k++) {
581 for (k = 0; k < np; k++) {
584 fthis = (
float*) offset;
592 for (r = 0; r < 12; ++r)
606 for (k = 0; k < np; ++k)
610 fthis = (
float*) offset;
613 for (r = 0; r < 12; r++)
630 for (k = 0; k < np; k++) {
633 fthis = (
float*) offset;
638 for (r = 0; r < 3; ++r)
660 for( k = 0; k < np; ++k)
664 fthis = (
float*)offset;
669 for (r = 0; r < 24; ++r)
676 for (drthis = (
fiffDataRef)tag->data(), k = 0; k < np; k++, drthis++) {
FiffTag class declaration, which provides fiff tag I/O and processing methods.
#define FIFFT_COMPLEX_DOUBLE
#define FIFFT_CH_INFO_STRUCT
#define FIFFT_CH_POS_STRUCT
#define FIFFT_COMPLEX_FLOAT
#define FIFFV_NATIVE_ENDIAN
#define FIFFT_DIR_ENTRY_STRUCT
#define FIFFT_COORD_TRANS_STRUCT
#define FIFFT_DIG_POINT_STRUCT
#define FIFFT_DATA_REF_STRUCT
IOUtils class declaration.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
FiffDataRef * fiffDataRef
Backward-compatible pointer typedef for the old fiffDataRef pointer.
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
static qint32 storageSize()
Measurement channel position and coil type.
static qint32 storageSize()
static qint32 storageSize()
static qint32 storageSize()
static qint32 storageSize()
static qint32 storageSize()
static qint32 storageSize()
static fiff_int_t fiff_type_matrix_coding(fiff_int_t type)
static void convert_matrix_to_file_data(FiffTag::SPtr tag)
fiff_int_t getMatrixCoding() const
static fiff_int_t fiff_type_fundamental(fiff_int_t type)
QSharedPointer< FiffTag > SPtr
fiff_int_t getType() const
static fiff_int_t fiff_type_base(fiff_int_t type)
static void convert_matrix_from_file_data(FiffTag::SPtr tag)
static void convert_ch_pos(FiffChPos *pos)
bool getMatrixDimensions(qint32 &p_ndim, QVector< qint32 > &p_Dims) const
static void convert_tag_data(FiffTag::SPtr tag, int from_endian, int to_endian)
static void swap_doublep(double *source)
static qint32 swap_int(qint32 source)
static void swap_floatp(float *source)
static void swap_longp(qint64 *source)
static void swap_intp(qint32 *source)
static qint64 swap_long(qint64 source)
static qint16 swap_short(qint16 source)