v2.0.0
Loading...
Searching...
No Matches
DISP3DLIB::ElectrodeObject Class Reference

Renderable sEEG / ECoG electrodes: contact spheres plus lead bodies. More...

#include <electrodeobject.h>

Public Member Functions

 ElectrodeObject ()
 ~ElectrodeObject ()
void setImplantation (const IEEGLIB::IeegImplantation &implantation)
const IEEGLIB::IeegImplantation & implantation () const
int totalContactCount () const
void setContactValues (const QMap< QString, float > &values, const QString &colormap=QStringLiteral("Hot"))
void clearContactValues ()
QVector< uint32_t > surfaceColors (const Eigen::MatrixX3f &vertices, double distance=0.01) const
void selectContact (const QString &name)
void clearSelection ()
QString selectedContact () const
void setHoveredContact (int index)
int hoveredContact () const
int intersect (const QVector3D &rayOrigin, const QVector3D &rayDir, float &dist) const
const IEEGLIB::IeegContact * contactAt (int index) const
QString contactLabel (int index) const
InstancedStreams contactStreams () const
InstancedStreams bodyStreams () const
const RenderKey & contactRenderKey () const
const RenderKey & bodyRenderKey () const
bool isVisible () const
void setVisible (bool visible)
QVector3D boundingBoxMin () const
QVector3D boundingBoxMax () const

Static Public Member Functions

static QColor leadColor (int index)

Static Public Attributes

static constexpr float kDepthContactRadius = 0.0011f
static constexpr float kSubduralContactRadius = 0.0019f
static constexpr float kShaftRadius = 0.00045f
static constexpr float kShaftOvershoot = 0.004f
static constexpr float kTieRadius = 0.00035f
static constexpr float kMaxTieLength = 0.015f

Detailed Description

Renderable sEEG / ECoG electrodes: contact spheres plus lead bodies.

Definition at line 59 of file electrodeobject.h.

Constructor & Destructor Documentation

◆ ElectrodeObject()

ElectrodeObject::ElectrodeObject ( )

Definition at line 130 of file electrodeobject.cpp.

◆ ~ElectrodeObject()

ElectrodeObject::~ElectrodeObject ( )
default

Member Function Documentation

◆ bodyRenderKey()

const RenderKey & DISP3DLIB::ElectrodeObject::bodyRenderKey ( ) const
inline
Returns
Identity of the body mesh in the renderer's GPU cache.

Definition at line 202 of file electrodeobject.h.

◆ bodyStreams()

InstancedStreams ElectrodeObject::bodyStreams ( ) const
Returns
Instanced streams of the lead bodies (unit cylinders: shafts and ties).

Definition at line 455 of file electrodeobject.cpp.

◆ boundingBoxMax()

QVector3D ElectrodeObject::boundingBoxMax ( ) const
Returns
Axis-aligned bounding box maximum corner (with contact-radius padding).

Definition at line 473 of file electrodeobject.cpp.

◆ boundingBoxMin()

QVector3D ElectrodeObject::boundingBoxMin ( ) const
Returns
Axis-aligned bounding box minimum corner (with contact-radius padding).

Definition at line 466 of file electrodeobject.cpp.

◆ clearContactValues()

void ElectrodeObject::clearContactValues ( )

Restore the lead colours of all contacts.

Definition at line 203 of file electrodeobject.cpp.

◆ clearSelection()

void ElectrodeObject::clearSelection ( )

Clear the contact selection.

Definition at line 267 of file electrodeobject.cpp.

◆ contactAt()

const IEEGLIB::IeegContact * ElectrodeObject::contactAt ( int index) const
Parameters
[in]indexContact index.
Returns
The contact, or nullptr when out of range.

Definition at line 422 of file electrodeobject.cpp.

◆ contactLabel()

QString ElectrodeObject::contactLabel ( int index) const
Parameters
[in]indexContact index.
Returns
Hover text, e.g. "LA3 (depth lead LA)", or an empty string when out of range.

Definition at line 429 of file electrodeobject.cpp.

◆ contactRenderKey()

const RenderKey & DISP3DLIB::ElectrodeObject::contactRenderKey ( ) const
inline
Returns
Identity of the contact mesh in the renderer's GPU cache.

Definition at line 196 of file electrodeobject.h.

◆ contactStreams()

InstancedStreams ElectrodeObject::contactStreams ( ) const
Returns
Instanced streams of the contact spheres (one instance per contact).

Definition at line 444 of file electrodeobject.cpp.

◆ hoveredContact()

int DISP3DLIB::ElectrodeObject::hoveredContact ( ) const
inline
Returns
Hovered contact index, or -1.

Definition at line 156 of file electrodeobject.h.

◆ implantation()

const IEEGLIB::IeegImplantation & DISP3DLIB::ElectrodeObject::implantation ( ) const
inline
Returns
The drawn implantation.

Definition at line 91 of file electrodeobject.h.

◆ intersect()

int ElectrodeObject::intersect ( const QVector3D & rayOrigin,
const QVector3D & rayDir,
float & dist ) const

Intersect a ray with the contact spheres.

Parameters
[in]rayOriginRay origin.
[in]rayDirNormalised ray direction.
[out]distDistance to the nearest hit.
Returns
Index of the nearest contact hit, or -1.

Definition at line 396 of file electrodeobject.cpp.

◆ isVisible()

bool DISP3DLIB::ElectrodeObject::isVisible ( ) const
inline

Definition at line 207 of file electrodeobject.h.

◆ leadColor()

QColor ElectrodeObject::leadColor ( int index)
static
Parameters
[in]indexLead index.
Returns
Lead colour: golden-angle hues, so neighbouring leads differ clearly.

Definition at line 291 of file electrodeobject.cpp.

◆ selectContact()

void ElectrodeObject::selectContact ( const QString & name)

Select a contact by name. Clears the previous selection.

Parameters
[in]nameContact name to select.

Definition at line 259 of file electrodeobject.cpp.

◆ selectedContact()

QString ElectrodeObject::selectedContact ( ) const
Returns
Name of the currently selected contact, or empty string if none.

Definition at line 284 of file electrodeobject.cpp.

◆ setContactValues()

void ElectrodeObject::setContactValues ( const QMap< QString, float > & values,
const QString & colormap = QStringLiteral("Hot") )

Colour contacts by value through a colormap spanning [min(0, smallest), largest]. Contacts without a value keep the colour of their lead.

Parameters
[in]valuesMap of contact name -> scalar value.
[in]colormapDISPLIB::ColorMap name.

Definition at line 176 of file electrodeobject.cpp.

◆ setHoveredContact()

void ElectrodeObject::setHoveredContact ( int index)

Highlight one contact while the pointer is over it, without changing the selection.

Parameters
[in]indexContact index (as returned by intersect), or -1 for none.

Definition at line 274 of file electrodeobject.cpp.

◆ setImplantation()

void ElectrodeObject::setImplantation ( const IEEGLIB::IeegImplantation & implantation)

Draw an implantation. Clears the selection, hover and contact colours.

Parameters
[in]implantationContacts and leads, positions in the frame of the surfaces.

Definition at line 148 of file electrodeobject.cpp.

◆ setVisible()

void DISP3DLIB::ElectrodeObject::setVisible ( bool visible)
inline

Definition at line 211 of file electrodeobject.h.

◆ surfaceColors()

QVector< uint32_t > ElectrodeObject::surfaceColors ( const Eigen::MatrixX3f & vertices,
double distance = 0.01 ) const

Paint the contact values onto a surface, as MNE-Python's stc_near_sensors: each vertex takes the distance-weighted mean of the contacts within reach and fades out with the summed weight. ECoG contacts are first moved onto the surface; depth contacts are not.

Parameters
[in]verticesSurface vertex positions in the frame of the implantation, metres.
[in]distanceReach of each contact in metres.
Returns
ABGR colour per vertex, transparent away from the contacts; empty without values.

Definition at line 219 of file electrodeobject.cpp.

◆ totalContactCount()

int ElectrodeObject::totalContactCount ( ) const
Returns
Total number of contacts.

Definition at line 169 of file electrodeobject.cpp.

Member Data Documentation

◆ kDepthContactRadius

float DISP3DLIB::ElectrodeObject::kDepthContactRadius = 0.0011f
staticconstexpr

Definition at line 64 of file electrodeobject.h.

◆ kMaxTieLength

float DISP3DLIB::ElectrodeObject::kMaxTieLength = 0.015f
staticconstexpr

Longer gaps are not tied: not one array.

Definition at line 69 of file electrodeobject.h.

◆ kShaftOvershoot

float DISP3DLIB::ElectrodeObject::kShaftOvershoot = 0.004f
staticconstexpr

Shaft extension past the outer contacts.

Definition at line 67 of file electrodeobject.h.

◆ kShaftRadius

float DISP3DLIB::ElectrodeObject::kShaftRadius = 0.00045f
staticconstexpr

Definition at line 66 of file electrodeobject.h.

◆ kSubduralContactRadius

float DISP3DLIB::ElectrodeObject::kSubduralContactRadius = 0.0019f
staticconstexpr

Definition at line 65 of file electrodeobject.h.

◆ kTieRadius

float DISP3DLIB::ElectrodeObject::kTieRadius = 0.00035f
staticconstexpr

Ties between neighbouring strip / grid contacts.

Definition at line 68 of file electrodeobject.h.


The documentation for this class was generated from the following files: