66 , m_pLeftHemisphere(NULL)
67 , m_pRightHemisphere(NULL)
68 , m_ColorSulci(QColor(50.0, 50.0, 50.0, 255.0))
69 , m_ColorGyri(QColor(200.0, 200.0, 200.0, 255.0))
79 , m_SurfaceSet(subject_id, hemi, surf, subjects_dir)
80 , m_pLeftHemisphere(NULL)
81 , m_pRightHemisphere(NULL)
82 , m_ColorSulci(QColor(50.0, 50.0, 50.0, 255.0))
83 , m_ColorGyri(QColor(100.0, 100.0, 100.0, 255.0))
91 BrainSurface::BrainSurface(
const QString &subject_id, qint32 hemi,
const QString &surf,
const QString &atlas,
const QString &subjects_dir, QEntity *parent)
93 , m_SurfaceSet(subject_id, hemi, surf, subjects_dir)
94 , m_AnnotationSet(subject_id, hemi, atlas, subjects_dir)
95 , m_pLeftHemisphere(NULL)
96 , m_pRightHemisphere(NULL)
97 , m_ColorSulci(QColor(50.0, 50.0, 50.0, 255.0))
98 , m_ColorGyri(QColor(200.0, 200.0, 200.0, 255.0))
108 , m_pLeftHemisphere(NULL)
109 , m_pRightHemisphere(NULL)
110 , m_ColorSulci(QColor(50.0, 50.0, 50.0, 255.0))
111 , m_ColorGyri(QColor(200.0, 200.0, 200.0, 255.0))
153 if(m_pLeftHemisphere)
154 m_pLeftHemisphere->updateActivation(m_qmVertexActivationColorLH);
175 if(m_pRightHemisphere)
176 m_pRightHemisphere->updateActivation(m_qmVertexActivationColorRH);
191 int stcDataRoleLH = StcDataModelRoles::GetSmoothedStcValLH;
192 int stcDataRoleRH = StcDataModelRoles::GetSmoothedStcValRH;
195 if(topLeft.column() > 3 || bottomRight.column() < 3) {
196 std::cout<<
"BrainSurface::dataChanged() - stc data did not change"<<std::endl;
201 VectorXd currentActivationLH = m_pStcDataModel->data(0,4,stcDataRoleLH).value<VectorXd>();
203 m_qmVertexActivationColorLH = m_qmDefaultVertexColorLH;
205 std::cout<<
"BrainSurface::dataChanged() - currentActivationLH.rows(): "<<currentActivationLH.rows()<<std::endl;
207 for(qint32 i = 0; i < currentActivationLH.rows(); ++i) {
208 qint32 iVal = currentActivationLH(i) * 20;
210 iVal = iVal > 255 ? 255 : iVal < 0 ? 0 : iVal;
220 if(stcDataRoleLH == StcDataModelRoles::GetRelStcValLH || stcDataRoleLH == StcDataModelRoles::GetStcValLH)
221 vertexIndex = m_pStcDataModel->data(i,1,StcDataModelRoles::GetIndexLH).toInt();
227 m_qmVertexActivationColorLH[vertexIndex] = QColor(qRgb);
231 VectorXd currentActivationRH = m_pStcDataModel->data(0,4,stcDataRoleRH).value<VectorXd>();
233 m_qmVertexActivationColorRH = m_qmDefaultVertexColorRH;
235 for(qint32 i = 0; i < currentActivationRH.rows(); ++i) {
236 qint32 iVal = currentActivationRH(i) * 20;
238 iVal = iVal > 255 ? 255 : iVal < 0 ? 0 : iVal;
246 if(stcDataRoleLH == StcDataModelRoles::GetRelStcValRH || stcDataRoleLH == StcDataModelRoles::GetStcValRH)
247 vertexIndex = m_pStcDataModel->data(i,1,StcDataModelRoles::GetIndexRH).toInt();
250 m_qmVertexActivationColorRH[vertexIndex] = QColor(qRgb);
265 m_pStcDataModel = model;
277 m_qmDefaultVertexColorLH.clear();
280 m_qmDefaultVertexColorLH.insertMulti(i, m_ColorSulci);
282 m_qmDefaultVertexColorLH.insertMulti(i, m_ColorGyri);
284 m_qmDefaultVertexColorRH.clear();
287 m_qmDefaultVertexColorRH.insertMulti(i, m_ColorSulci);
289 m_qmDefaultVertexColorRH.insertMulti(i, m_ColorGyri);
291 m_qmVertexActivationColorLH = m_qmDefaultVertexColorLH;
292 m_qmVertexActivationColorRH = m_qmDefaultVertexColorRH;
308 this->scaleTransform()->setScale(scale);
311 this->rotateTransform()->setAxis(QVector3D(1,0,0));
312 this->rotateTransform()->setAngleDeg(-90);
320 QMap<qint32, Surface>::const_iterator it =
m_SurfaceSet.
data().constBegin();
322 QVector3D min(it.value().rr().col(0).minCoeff(), it.value().rr().col(1).minCoeff(), it.value().rr().col(2).minCoeff());
323 QVector3D max(it.value().rr().col(0).maxCoeff(), it.value().rr().col(1).maxCoeff(), it.value().rr().col(2).maxCoeff());
327 for(qint32 i = 0; i < 3; ++i)
329 min[i] = min[i] > it.value().rr().col(i).minCoeff() ? it.value().rr().col(i).minCoeff() : min[i];
330 max[i] = max[i] < it.value().rr().col(i).maxCoeff() ? it.value().rr().col(i).maxCoeff() : max[i];
336 for(qint32 i = 0; i < 3; ++i)
BrainSurface(QEntity *parent=0)
QVector3D m_vecBoundingBoxCenter
QSharedPointer< StcDataModel > SPtr
Declaration of BrainSurface which holds the basic functionality of a freesurfer brain surface...
QVector3D m_vecBoundingBoxMax
void setModel(StcDataModel::SPtr model)
void insert(const Surface &p_Surface)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >())
static QRgb valueToHotNegative2(double v)
QMap< qint32, Surface > & data()
Holds the data of one hemisphere in form of a mesh.
QVector3D m_vecBoundingBoxMin