41 #include "../../../../helpers/interpolation/interpolation.h"
42 #include "../../items/common/abstractmeshtreeitem.h"
50 #include <QElapsedTimer>
62 using namespace DISP3DLIB;
63 using namespace Eigen;
64 using namespace DISPLIB;
65 using namespace FIFFLIB;
73 , m_iAverageSamples(1)
75 , m_bStreamSmoothedData(true)
77 , m_pMatInterpolationMatrix(QSharedPointer<SparseMatrix<float> >(new SparseMatrix<float>()))
85 if(data.rows() == 0) {
86 qDebug() <<
"RtSensorDataWorker::addData - Passed data is epmpty!";
91 for(
int i = 0; i<data.cols(); i++) {
95 qDebug() <<
"RtSensorDataWorker::addData - worker is full ("<<
m_lDataQ.size()<<
")";
236 qDebug() <<
"RtSensorDataWorker::generateColorsFromSensorValues - Number of new vertex colors (" << vecSensorValues.rows() <<
") do not match with previously set number of sensors (" <<
m_pMatInterpolationMatrix->cols() <<
"). Returning...";
261 MatrixX4f& matFinalVertColor,
264 QRgb (*functionHandlerColorMap)(
double v,
const QString& sColorMap),
265 const QString& sColorMap)
268 if(vecData.rows() != matFinalVertColor.rows()) {
269 qDebug() <<
"RtSensorDataWorker::normalizeAndTransformToColor - Sizes of input data (" << vecData.rows() <<
") do not match output data ("<< matFinalVertColor.rows() <<
"). Returning ...";
275 const double dTresholdDiff = dThreholdZ - dThresholdX;
277 for(
int r = 0; r < vecData.rows(); ++r) {
279 fSample = std::fabs(vecData(r));
281 if(fSample >= dThresholdX) {
282 matFinalVertColor(r,3) = 1.0f;
285 if(fSample >= dThreholdZ) {
293 if(fSample != 0.0f && dTresholdDiff != 0.0 ) {
295 fSample = 0.5 - (fSample - dThresholdX) / (dTresholdDiff * 2);
297 fSample = 0.5 + (fSample - dThresholdX) / (dTresholdDiff * 2);
304 qRgb = functionHandlerColorMap(fSample, sColorMap);
306 matFinalVertColor(r,0) = (float)qRed(qRgb)/255.0f;
307 matFinalVertColor(r,1) = (float)qGreen(qRgb)/255.0f;
308 matFinalVertColor(r,2) = (float)qBlue(qRgb)/255.0f;