本文整理汇总了C++中Signal::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ Signal::GetData方法的具体用法?C++ Signal::GetData怎么用?C++ Signal::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal::GetData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildSignal
void SegmentDescription::BuildSignal(Signal & signal) const
{
signal.Reset();
for (size_t i = 0; i < cores.size(); ++i)
{
cores[i].AddToArray(signal.GetData(), signal.GetDesc().N);
}
}
示例2: AddToSignal
void Polynom::AddToSignal(Signal & signal) const
{
const SignalDescription & d = signal.GetDesc();
double * data = signal.GetData();
for (int i = 0; i < d.N; ++i)
{
data[i] += (*this)(d.startTime + i * d.dt);
}
}
示例3: onLoad
void MainWindow::onLoad()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Physionet ECG File"),
"", tr("Physionet ECG File (*.dat)"));
if(fileName.isEmpty())
return;
Signal signal;
if(signal.ReadFile(fileName.toStdWString().c_str()))
{
int dataSize = signal.GetLength();
double* data = signal.GetData();
double sr = signal.GetSR();
float msec = float((double)dataSize / sr);
QVector<double> x(dataSize), y(dataSize);
for (int i=0; i<dataSize; ++i)
{
x[i] = i * msec / dataSize;
y[i] = data[i];
}
EcgAnnotation ann;
int** qrsAnn = ann.GetQRS(data, dataSize, sr, L"filters");
if (qrsAnn)
{
int** ANN = ann.GetPTU(data, dataSize, sr, L"filters",
qrsAnn, ann.GetQrsNumber());
if (ANN)
{
fillArrhytmiaPlot(ANN, ui->plot, ann, x, y, signal.GetSR());
fillMyocardialPlot(ANN, ui->mPlot, ann, x, y, signal.GetSR());
fillPericarditisPlot(ANN, ui->pPlot, ann, x, y, signal.GetSR());
}
else
{
QMessageBox::warning(this, "Warning", "Unknown error");
}
} else
{
QMessageBox::warning(this, "Warning", "Could not get QRS complexes");
}
ui->plot->replot();
} else
{
QMessageBox::warning(this, "Warning", "Failed to load file " + fileName);
}
}
示例4: getRDistances
bool MainWindow::getRDistances(Signal& signal, std::vector<float>& distances)
{
int dataSize = signal.GetLength();
double* data = signal.GetData();
double sr = signal.GetSR();
float msec = float((double)dataSize / sr);
EcgAnnotation ann;
int** qrsAnn = ann.GetQRS(data, dataSize, sr, L"filters");
distances.clear();
float lastRTime = -1;
if (qrsAnn)
{
int** ANN = ann.GetPTU(data, dataSize, sr, L"filters",
qrsAnn, ann.GetQrsNumber());
if (ANN)
{
int annNum = ann.GetEcgAnnotationSize();
for (int i = 0; i < annNum; i++)
{
int smpl = ANN[i][0];
int type = ANN[i][1];
msec = float(((double)smpl / sr));
if(anncodes[type][0] == L'R')
{
if(lastRTime >= 0)
{
distances.push_back(msec - lastRTime);
}
lastRTime = msec;
}
}
}
else
{
QMessageBox::warning(this, "Warning", "Unknown error");
return false;
}
} else
{
QMessageBox::warning(this, "Warning", "Could not get QRS complexes");
return false;
}
return true;
}