Class: FiberSource

FiberSource(controlPoints, nameopt, tangentsopt, radiusopt, coloropt)

A fiber bundle in Phantomas is defined as a cylindrical tube wrapped around its centerline. The centerline itself is a continuous curve in 3D, and can be simply created from a few control points. All the fibers created are supposed to connect two cortical areas.
FiberSource is the basic Class for the representation of a Fiber. Objects containing the geometries to be added to the scene are to be referred to FiberSource for gathering any necessary information.

Constructor

new FiberSource(controlPoints, nameopt, tangentsopt, radiusopt, coloropt)

Parameters:
Name Type Attributes Default Description
controlPoints array Array-of-arrays (N, 3) containing the 3-D coordinates of the fiber Control Points.
name string <optional>
Name of the fiber, if any.
tangents string <optional>
'symmetric' Way the tangents are to be computed. Available options: 'incoming', 'outgoing', 'symmetric'
radius number <optional>
1 Fiber radius; same dimensions as controlPoints.
color number <optional>
Color in which the fiber should be displayed. If not specified, to be picked randomly from colors.
Properties:
Name Type Description
observers array Objects to be notified when some change is applied
Source:

Methods

(static) addObserver(object)

Add object to this.observers property
Parameters:
Name Type Description
object object Object to be added to this.observers array.
Source:

(static) interpolate(ts) → {array}

Parameters:
Name Type Description
ts Array.<Number> | Number List of "timesteps" (or a single) between 0 and 1. From a ``FiberSource``, which is a continuous representation, to a ``Fiber``, a discretization of the fiber trajectory.
Source:
Returns:
The trajectory of the fiber, discretized over the provided timesteps in an array-of-arrays form (N, 3)
Type
array

(static) notify()

Runs .refresh() method to all objects present in this.observers property. Renders.
Source:

(static) polyCalc()

When called, coefficients are calculated. This takes the FiberSource instance from control points, and a specified mode to compute the tangents.
The output is the coefficients as

(x,y,z)(t)= a + b[(t-ti)/(ti1-ti)] + c[(t-ti)/(ti1-ti)]^2 + d[(t-ti)/(ti1-ti)]^3

for each x, y and z and for each pair of points, as this.xpoly, this.ypoly and this.zpoly. Timestamps normalized in <[0,1] are also calculated in this.ts.
Source:

(static) setControlPoint(n, axis, value)

Sets a value to a given Control Point in a given Axis. Refreshes coefficients and notifies observers.
Parameters:
Name Type Description
n number Index in this.controlPoints of Control Point to be set.
axis string Axis in which to apply the change 'x', 'y' or 'z'.
value number Value to set.
Source: