本文整理汇总了C++中MNESourceEstimate::update_times方法的典型用法代码示例。如果您正苦于以下问题:C++ MNESourceEstimate::update_times方法的具体用法?C++ MNESourceEstimate::update_times怎么用?C++ MNESourceEstimate::update_times使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MNESourceEstimate
的用法示例。
在下文中一共展示了MNESourceEstimate::update_times方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
bool MNESourceEstimate::read(QIODevice &p_IODevice, MNESourceEstimate& p_stc)
{
QSharedPointer<QDataStream> t_pStream(new QDataStream(&p_IODevice));
t_pStream->setFloatingPointPrecision(QDataStream::SinglePrecision);
t_pStream->setByteOrder(QDataStream::BigEndian);
t_pStream->setVersion(QDataStream::Qt_5_0);
if(!t_pStream->device()->open(QIODevice::ReadOnly))
return false;
QFile* t_pFile = qobject_cast<QFile*>(&p_IODevice);
if(t_pFile)
printf("Reading source estimate from %s...", t_pFile->fileName().toUtf8().constData());
else
printf("Reading source estimate...");
// read start time in ms
*t_pStream >> p_stc.tmin;
p_stc.tmin /= 1000;
// read sampling rate in ms
*t_pStream >> p_stc.tstep;
p_stc.tstep /= 1000;
// read number of vertices
quint32 t_nVertices;
*t_pStream >> t_nVertices;
p_stc.vertices = VectorXi(t_nVertices);
// read the vertex indices
for(quint32 i = 0; i < t_nVertices; ++i)
*t_pStream >> p_stc.vertices[i];
// read the number of timepts
quint32 t_nTimePts;
*t_pStream >> t_nTimePts;
//
// read the data
//
p_stc.data = MatrixXd(t_nVertices, t_nTimePts);
for(qint32 i = 0; i < p_stc.data.array().size(); ++i)
{
float value;
*t_pStream >> value;
p_stc.data.array()(i) = value;
}
//Update time vector
p_stc.update_times();
// close the file
t_pStream->device()->close();
printf("[done]\n");
return true;
}