56 #include <Eigen/SparseCore>
63 #include <QDataStream>
66 #include <QSharedPointer>
68 #include <QStringList>
89 class FiffNamedMatrix;
94 class FiffDigitizerData;
107 typedef QSharedPointer<FiffStream>
SPtr;
125 explicit FiffStream(QByteArray * a, QIODevice::OpenMode mode);
133 QString streamName();
150 QList<FiffDirEntry::SPtr>& dir();
159 const QList<FiffDirEntry::SPtr>& dir()
const;
189 fiff_long_t end_block(fiff_int_t kind, fiff_int_t next = FIFFV_NEXT_SEQ);
205 void finish_writing_raw();
218 bool get_evoked_entries(
const QList<FiffDirNode::SPtr> &evoked_node, QStringList &comments, QList<fiff_int_t> &aspect_kinds, QString &t);
237 bool open(QIODevice::OpenModeFlag mode = QIODevice::ReadOnly);
305 QList<FiffCtfComp> read_ctf_comp(
const FiffDirNode::SPtr& p_Node,
const QList<FiffChInfo>& p_Chs);
390 bool read_tag_data(QSharedPointer<FiffTag>& p_pTag, fiff_long_t pos = -1);
403 fiff_long_t read_tag_info(QSharedPointer<FiffTag>& p_pTag,
bool p_bDoSkip =
true);
414 bool read_rt_tag(QSharedPointer<FiffTag>& p_pTag);
427 bool read_tag(QSharedPointer<FiffTag>& p_pTag,
428 fiff_long_t pos = -1);
444 static bool setup_read_raw(QIODevice &p_IODevice,
446 bool allow_maxshield =
true,
447 bool is_littleEndian =
false);
461 static QStringList split_name_list(QString p_sNameList);
472 fiff_long_t start_block(fiff_int_t kind);
514 Eigen::RowVectorXd& cals,
515 Eigen::MatrixXi sel = defaultMatrixXi,
516 bool bResetRange =
true);
529 fiff_long_t write_tag(
const QSharedPointer<FiffTag>& p_pTag, fiff_long_t pos = -1);
542 fiff_long_t write_ch_info(
const FiffChInfo& ch);
552 fiff_long_t write_ch_pos(
const FiffChPos& chpos);
575 fiff_long_t write_cov(
const FiffCov &p_FiffCov);
589 fiff_long_t write_ctf_comp(
const QList<FiffCtfComp>& comps);
616 fiff_long_t write_dir_pointer(fiff_int_t dirpos, fiff_long_t pos = -1, fiff_int_t next = FIFFV_NEXT_SEQ);
628 fiff_long_t write_dir_entries(
const QList<FiffDirEntry::SPtr>& dir, fiff_long_t pos = -1);
641 fiff_long_t write_double(fiff_int_t kind,
const double* data, fiff_int_t nel = 1);
664 fiff_long_t write_info_base(
const FiffInfoBase & p_FiffInfoBase);
678 fiff_long_t write_int(fiff_int_t kind,
const fiff_int_t* data, fiff_int_t nel = 1, fiff_int_t next = FIFFV_NEXT_SEQ);
693 fiff_long_t write_int_matrix(fiff_int_t kind,
const Eigen::MatrixXi& mat);
706 fiff_long_t write_float(fiff_int_t kind,
const float* data, fiff_int_t nel = 1);
718 fiff_long_t write_float_matrix(fiff_int_t kind,
const Eigen::MatrixXf& mat);
733 fiff_long_t write_float_sparse_ccs(fiff_int_t kind,
const Eigen::SparseMatrix<float>& mat);
748 fiff_long_t write_float_sparse_rcs(fiff_int_t kind,
const Eigen::SparseMatrix<float>& mat);
763 fiff_long_t write_name_list(fiff_int_t kind,
const QStringList& data);
778 fiff_long_t write_named_matrix(fiff_int_t kind,
const FiffNamedMatrix& mat);
792 fiff_long_t write_proj(
const QList<FiffProj>& projs);
807 bool write_raw_buffer(
const Eigen::MatrixXd& buf,
const Eigen::RowVectorXd& cals);
822 bool write_raw_buffer(
const Eigen::MatrixXd& buf,
const Eigen::SparseMatrix<double>& mult);
835 bool write_raw_buffer(
const Eigen::MatrixXd& buf);
847 fiff_long_t write_string(fiff_int_t kind,
const QString& data);
856 void write_rt_command(fiff_int_t command,
const QString& data);
868 bool check_beginning(QSharedPointer<FiffTag>& p_pTag);
879 QList<FiffDirEntry::SPtr> make_dir(
bool *ok=Q_NULLPTR);
886 QList<FiffDirEntry::SPtr> m_dir;
909 #endif // FIFF_STREAM_H