oursin.particles

Particles

Functions

clear

Clear all particles

create

Create particles

set_colors

Set neuron colors

set_material

Change the material used to render neurons

set_positions

Set the position of particles in ap/ml/dv coordinates relative to the origin

set_sizes

Set particles sizes

Classes

Particle

Particles should not be directly instantiated, use urchin.particles.create(n) and urchin.clear_particles()

class Particle[source]

Bases: object

Particles should not be directly instantiated, use urchin.particles.create(n) and urchin.clear_particles()

set_position(position)[source]

Set the position of a particle in ap/ml/dv coordinates relative to the origin (0,0,0)

Parameters

positionlist of three floats

(ap, ml, dv) coordinates in um

Examples

>>>p1.set_position([5200,5700,330]) # set a particle to Bregma, in CCF space

set_size(size)[source]

Set the size of a particle

Parameters

size : float

Examples

>>>p1.set_size(0.02) # 20 um

set_color(color)[source]

Set the color of a particle

Parameters

color : string hex color

Examples

>>>p1.set_color(‘#FFFFFF’)

create(num_particles)[source]

Create particles

Note: particles must be created before setting other values

Parameters

num_particles : int

Examples

>>> neurons = urchin.particles.create(3)
clear()[source]

Clear all particles

Note that there is no delete method for individual particles, they must all be cleared at once.

set_positions(particles_list, positions_list)[source]

Set the position of particles in ap/ml/dv coordinates relative to the origin

Parameters

particles_list : list of Particle positions_list : list of list of three floats

list of positions of neurons (ap, ml, dv) in um

Examples

>>> urchin.particles.set_positions([p1,p2,p3], [[1000,1000,1000],...,...])
set_sizes(particles_list, sizes_list)[source]

Set particles sizes

Parameters

particles_list : list of Particle sizes_list : list of float

Examples

>>> urchin.particles.set_sizes([p1,n2,n3], [0.01,0.02,0.03])
set_colors(particles_list, colors_list)[source]

Set neuron colors

Parameters

particles_list : list of Particle colors_list : list of string hex colors

list of colors of neurons

Examples

>>> urchin.particles.set_colors([p1,n2,n3], ['#FFFFFF','#000000','#FF0000'])
set_material(material_name)[source]

Change the material used to render neurons

Options are - ‘gaussian’ (default) - ‘circle’ - ‘circle-lit’ - ‘square’ - ‘square-lit’ - ‘diamond’ - ‘diamond-lit’

Parameters

material_name: string

Examples

>>> urchin.neurons.set_material('circle')