42 #include "../../../../helpers/interpolation/interpolation.h"
43 #include "../../items/common/abstractmeshtreeitem.h"
51 #include <QElapsedTimer>
52 #include <QtConcurrent>
64 using namespace DISP3DLIB;
65 using namespace Eigen;
66 using namespace DISPLIB;
67 using namespace FIFFLIB;
75 , m_iAverageSamples(1)
77 , m_bStreamSmoothedData(true)
92 if(data.rows() == 0) {
93 qDebug() <<
"RtSourceDataWorker::addData - Passed data is empty!";
98 for(
int i = 0; i<data.cols(); i++) {
102 qDebug() <<
"RtSourceDataWorker::addData - worker is full ("<<
m_lDataQ.size()<<
")";
113 const MatrixX4f &matColorRight)
244 result.waitForFinished();
269 qDebug() <<
"RtSourceDataWorker::generateColorsFromSensorValues - Number of new vertex colors (" << visualizationInfoHemi.vecSensorValues.rows() <<
") do not match with previously set number of sensors (" << visualizationInfoHemi.
pMatInterpolationMatrix->cols() <<
"). Returning...";
277 visualizationInfoHemi.matFinalVertColor = visualizationInfoHemi.matOriginalVertColor;
281 visualizationInfoHemi.matFinalVertColor,
282 visualizationInfoHemi.dThresholdX,
283 visualizationInfoHemi.dThresholdZ,
284 visualizationInfoHemi.functionHandlerColorMap,
285 visualizationInfoHemi.sColormapType);
291 MatrixX4f& matFinalVertColor,
294 QRgb (*functionHandlerColorMap)(
double v,
const QString& sColorMap),
295 const QString& sColorMap)
298 if(vecData.rows() != matFinalVertColor.rows()) {
299 qDebug() <<
"RtSourceDataWorker::normalizeAndTransformToColor - Sizes of input data (" << vecData.rows() <<
") do not match output data ("<< matFinalVertColor.rows() <<
"). Returning ...";
305 const double dTresholdDiff = dThresholdZ - dThresholdX;
307 for(
int r = 0; r < vecData.rows(); ++r) {
309 fSample = std::fabs(vecData(r));
311 if(fSample >= dThresholdX) {
313 if(fSample >= dThresholdZ) {
316 if(fSample != 0.0f && dTresholdDiff != 0.0 ) {
317 fSample = (fSample - dThresholdX) / (dTresholdDiff);
323 qRgb = functionHandlerColorMap(fSample, sColorMap);
333 matFinalVertColor(r,0) = color.redF();
334 matFinalVertColor(r,1) = color.greenF();
335 matFinalVertColor(r,2) = color.blueF();
336 matFinalVertColor(r,3) = color.alphaF();
343 matFinalVertColor(r,3) = 0.0f;