Skip to content

Class: ColorMappedNeuroSurface ​

Defined in: classes.ts:843

Extends ​

Constructors ​

Constructor ​

ts
new ColorMappedNeuroSurface(
   geometry, 
   indices, 
   data, 
   colorMap, 
   config?
): ColorMappedNeuroSurface;

Defined in: classes.ts:854

Parameters ​

geometry ​

SurfaceGeometry

indices ​

number[] | Uint32Array<ArrayBufferLike> | null

data ​

Float32Array<ArrayBufferLike> | number[]

colorMap ​

string | ColorMap | number[][]

config? ​

SurfaceConfig = {}

Returns ​

ColorMappedNeuroSurface

Overrides ​

NeuroSurface.constructor

Properties ​

geometry ​

ts
geometry: SurfaceGeometry;

Defined in: classes.ts:458

Inherited from ​

NeuroSurface.geometry


indices ​

ts
indices: Uint32Array;

Defined in: classes.ts:459

Inherited from ​

NeuroSurface.indices


data ​

ts
data: Float32Array;

Defined in: classes.ts:460

Inherited from ​

NeuroSurface.data


vertexCurv ​

ts
vertexCurv: Float32Array<ArrayBufferLike> | null;

Defined in: classes.ts:461

Inherited from ​

NeuroSurface.vertexCurv


mesh ​

ts
mesh: 
  | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, 
  | Material<MaterialEventMap>
  | Material<MaterialEventMap>[], Object3DEventMap>
  | null;

Defined in: classes.ts:462

Inherited from ​

NeuroSurface.mesh


threshold ​

ts
threshold: [number, number];

Defined in: classes.ts:463

Inherited from ​

NeuroSurface.threshold


irange ​

ts
irange: [number, number];

Defined in: classes.ts:464

Inherited from ​

NeuroSurface.irange


hemisphere ​

ts
hemisphere: string;

Defined in: classes.ts:465

Inherited from ​

NeuroSurface.hemisphere


config ​

ts
config: ResolvedSurfaceConfig;

Defined in: classes.ts:466

Inherited from ​

NeuroSurface.config


viewer? ​

ts
optional viewer?: any;

Defined in: classes.ts:467

Inherited from ​

NeuroSurface.viewer


colorMap ​

ts
colorMap: ColorMap | null;

Defined in: classes.ts:844


colorMapName ​

ts
colorMapName: string;

Defined in: classes.ts:849

Methods ​

on() ​

ts
on<K>(event, listener): UnsubscribeFn;

Defined in: EventEmitter.ts:18

Type Parameters ​

K ​

K extends keyof SurfaceEventMap

Parameters ​

event ​

K

listener ​

TypedEventListener<SurfaceEventMap[K]>

Returns ​

UnsubscribeFn

Inherited from ​

NeuroSurface.on


once() ​

ts
once<K>(event, listener): UnsubscribeFn;

Defined in: EventEmitter.ts:30

Type Parameters ​

K ​

K extends keyof SurfaceEventMap

Parameters ​

event ​

K

listener ​

TypedEventListener<SurfaceEventMap[K]>

Returns ​

UnsubscribeFn

Inherited from ​

NeuroSurface.once


emit() ​

ts
emit<K>(event, ...args): void;

Defined in: EventEmitter.ts:41

Type Parameters ​

K ​

K extends keyof SurfaceEventMap

Parameters ​

event ​

K

args ​

...EventPayloadArgs<SurfaceEventMap[K]>

Returns ​

void

Inherited from ​

NeuroSurface.emit


removeListener() ​

ts
removeListener<K>(event, listenerToRemove): void;

Defined in: EventEmitter.ts:60

Type Parameters ​

K ​

K extends keyof SurfaceEventMap

Parameters ​

event ​

K

listenerToRemove ​

TypedEventListener<SurfaceEventMap[K]>

Returns ​

void

Inherited from ​

NeuroSurface.removeListener


removeAllListeners() ​

ts
removeAllListeners(event?): void;

Defined in: EventEmitter.ts:75

Parameters ​

event? ​

keyof SurfaceEventMap

Returns ​

void

Inherited from ​

NeuroSurface.removeAllListeners


off() ​

ts
off<K>(event, listener): void;

Defined in: EventEmitter.ts:84

Type Parameters ​

K ​

K extends keyof SurfaceEventMap

Parameters ​

event ​

K

listener ​

TypedEventListener<SurfaceEventMap[K]>

Returns ​

void

Inherited from ​

NeuroSurface.off


update() ​

ts
update(property, value): void;

Defined in: classes.ts:517

Parameters ​

property ​

string

value ​

any

Returns ​

void

Inherited from ​

NeuroSurface.update


getPickMetadata() ​

ts
getPickMetadata(_vertexIndex): Record<string, unknown> | null;

Defined in: classes.ts:647

Parameters ​

_vertexIndex ​

number

Returns ​

Record<string, unknown> | null

Inherited from ​

NeuroSurface.getPickMetadata


setVisible() ​

ts
setVisible(visible): void;

Defined in: classes.ts:654

Parameters ​

visible ​

boolean

Returns ​

void

Inherited from ​

NeuroSurface.setVisible


setOpacity() ​

ts
setOpacity(opacity): void;

Defined in: classes.ts:662

Parameters ​

opacity ​

number

Returns ​

void

Inherited from ​

NeuroSurface.setOpacity


setSmoothShading() ​

ts
setSmoothShading(smooth, smoothingAngle?): void;

Defined in: classes.ts:682

Control surface shading style (visual only, doesn't modify geometry)

Parameters ​

smooth ​

boolean

If true, uses smooth shading (interpolated normals). If false, uses flat shading (face normals)

smoothingAngle? ​

number

Optional angle threshold in degrees (0-180). Edges above this angle remain sharp

Returns ​

void

Example ​

javascript
// Enable smooth shading for organic surfaces
surface.setSmoothShading(true);

// Smooth shading with 30° threshold (sharp edges preserved)
surface.setSmoothShading(true, 30);

// Flat shading for faceted/crystalline look
surface.setSmoothShading(false);

Inherited from ​

NeuroSurface.setSmoothShading


applyLaplacianSmoothing() ​

ts
applyLaplacianSmoothing(
   iterations?, 
   lambda?, 
   method?, 
   preserveBoundaries?
): void;

Defined in: classes.ts:718

Apply Laplacian smoothing to the surface vertices (modifies geometry)

Parameters ​

iterations? ​

number = 1

Number of smoothing iterations (1-10). More iterations = smoother surface

lambda? ​

number = 0.5

Smoothing strength (0-1). 0 = no effect, 1 = maximum smoothing per iteration

method? ​

"laplacian" | "taubin"

Smoothing algorithm:

  • 'laplacian': Standard smoothing, may shrink surface
  • 'taubin': Alternates shrink/expand to preserve volume
preserveBoundaries? ​

boolean = true

If true, boundary edges remain fixed

Returns ​

void

Example ​

javascript
// Gentle smoothing to reduce noise
surface.applyLaplacianSmoothing(2, 0.3, 'laplacian', true);

// Aggressive smoothing while preserving volume
surface.applyLaplacianSmoothing(5, 0.5, 'taubin', true);

// Smooth including boundaries (may distort edges)
surface.applyLaplacianSmoothing(3, 0.4, 'laplacian', false);

Inherited from ​

NeuroSurface.applyLaplacianSmoothing


createSmoothedCopy() ​

ts
createSmoothedCopy(
   iterations?, 
   lambda?, 
   method?
): SurfaceGeometry;

Defined in: classes.ts:768

Create a smoothed copy of this surface

Parameters ​

iterations? ​

number = 1

Number of smoothing iterations

lambda? ​

number = 0.5

Smoothing factor 0-1

method? ​

"laplacian" | "taubin"

'laplacian' or 'taubin'

Returns ​

SurfaceGeometry

A new smoothed surface geometry

Inherited from ​

NeuroSurface.createSmoothedCopy


updateMesh() ​

ts
updateMesh(): Mesh;

Defined in: classes.ts:793

Returns ​

Mesh

Inherited from ​

NeuroSurface.updateMesh


setColorMap() ​

ts
setColorMap(colorMap): void;

Defined in: classes.ts:875

Parameters ​

colorMap ​

string | ColorMap | number[][]

Returns ​

void


getColorMapName() ​

ts
getColorMapName(): string;

Defined in: classes.ts:934

Returns ​

string


createMesh() ​

ts
createMesh(): Mesh;

Defined in: classes.ts:938

Returns ​

Mesh

Overrides ​

NeuroSurface.createMesh


updateColors() ​

ts
updateColors(): void;

Defined in: classes.ts:1006

Returns ​

void

Overrides ​

NeuroSurface.updateColors


updateConfig() ​

ts
updateConfig(newConfig): void;

Defined in: classes.ts:1102

Update surface material properties dynamically

Parameters ​

newConfig ​

Partial<SurfaceConfig>

Partial configuration object with properties to update

Returns ​

void

Example ​

javascript
// Make surface shiny and semi-transparent
surface.updateConfig({
  shininess: 150,
  specularColor: 0xffffff,
  alpha: 0.7
});

// Switch to flat shading for faceted look
surface.updateConfig({ flatShading: true });

Overrides ​

NeuroSurface.updateConfig


setData() ​

ts
setData(newData): void;

Defined in: classes.ts:1120

Parameters ​

newData ​

Float32Array<ArrayBufferLike> | number[]

Returns ​

void


removeColorMapListeners() ​

ts
removeColorMapListeners(): void;

Defined in: classes.ts:1131

Returns ​

void


dispose() ​

ts
dispose(): void;

Defined in: classes.ts:1147

Returns ​

void

Overrides ​

NeuroSurface.dispose

Released under the MIT License.