snnib.blender.spiketrain¶
functions related to spiketrain generation and manipulation
Exceptions
Classes
- Functions
make_spike_texture() – generates a texture to encode spiketrains
Other Objects
Functions
|
generates an image representing the spiketrain encoded in spike_steps |
- snnib.blender.spiketrain.make_spike_texture(spike_steps: List[int], steps: int, img_name: str, override: bool = False) bpy.types.Image[source]¶
generates an image representing the spiketrain encoded in spike_steps
- will
create an image with height=1 and width=steps
image pixels are either white (spike) or black (no spike)
- Parameters
- spike_steps
List[int]
indices of the simulation steps where a spike occurred
spiketrain converted to a step-encoding rather than actual spike times
the generated image will have a white pixel at each pixel that is contained in spike_steps
- steps
int
total simulation converted to steps (rather than time)
- equivalent to $t_{sim} / dt$
$t_{sim}$ … total simulation time
$dt$ … simulation time step
- img_name
str
name to give to the generated image
- override
bool, optional
whether to override an existing image rather than creating a new one
- if True
will override an existing image and generate a new one if no image was existing prior to function call
- if False
will generate a new image regardless of prior existence
recommended because different image shapes can lead to issues
the default is False
Raises
- Returns
- ìmg`
bpy.types.Image
the generated image
- Dependencies
bpy
logging
numpy
typing