oursin.particles

Particles

Functions

clear

Clear all particle systems

Classes

ParticleSystem

Particle system

class ParticleSystem(n, material='circle', positions=None, sizes=None, colors=None)[source]

Bases: object

Particle system

Minimize the number of particle systems you create

You cannot edit the number of particles in a system after creation

Create separate particle systems when you need to use different materials

delete()[source]

Delete this particle system and all its particles

set_material(material)[source]

Set the material of a particle system

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

Parameters

materialstring

new material for all particles

Examples

>>>psystem1.set_material(‘circle’)

set_positions(positions)[source]

Set the positions of particles relative to the reference coordinate

Parameters

positionlist of three floats

(ap, ml, dv) coordinates in um

Examples

>>>psystem1.set_positions([5200,5700,330]) # move all particles to Bregma in CCF

set_sizes(sizes)[source]

Set the sizes of particles in um

Parameters

size : float

Examples

>>>psystem1.set_sizes([20])

set_colors(colors)[source]

Set the colors of particles

Parameters

colorslist

hex or [r,g,b] colors

Examples

>>>psystem1.set_color([‘#FFFFFF’])

clear()[source]

Clear all particle systems