bluecellulab.cell.point_process

Functions

mechanism_name_from_model_template(...)

Translate SONATA model_template into a NEURON mechanism name.

Classes

BasePointProcessCell(cell_id)

Base class for NEURON artificial point processes (IntFire1/2/...).

HocPointProcessCell(cell_id, mechanism_name)

Point process that wraps an arbitrary HOC/mod artificial mechanism.

class bluecellulab.cell.point_process.BasePointProcessCell(cell_id)[source]

Base class for NEURON artificial point processes (IntFire1/2/…).

Parameters:

cell_id (Optional[CellId])

connect_to_circuit(proxy)[source]

Connect this cell to a circuit via sonata proxy.

Return type:

None

create_netcon_spikedetector(sec, location=None, threshold=0.0)[source]

Add and return a spikedetector.

This function creates a NetCon object that detects spikes at a specific location in the current cell and connects to the provided target point process. The location can be specified as a predefined site (‘soma’ or ‘AIS’) or as a custom location in the format section[index](position). Custom locations allow fine-grained control of the spike detection site within the cell’s sections.

Parameters:
  • target – A NEURON point process object (e.g., synapse) that the NetCon connects to.

  • location

    The spike detection location. Acceptable formats include:

    • ”soma”: Detect spikes in the soma section at the distal end.

    • ”AIS”: Detect spikes in the axon initial segment at the midpoint.

    • ”section[index](position)”: Custom location specifying:

      • section: The name of the section (e.g., ‘soma’, ‘axon’).

      • [index] (optional): Segment index within a section array (e.g., ‘soma[0]’).

      • (position) (optional): Normalized position along the section length (0 to 1). Defaults to 0.5 if not provided.

  • threshold (float) – The voltage threshold for spike detection (default: -30.0 mV).

Return type:

NetCon

Returns:

A NEURON NetCon object configured for spike detection at the specified location.

Raises:

ValueError – If: - The location is not ‘soma’, ‘AIS’, or a valid custom format. - The specified section or segment index does not exist. - The position is out of bounds (e.g., negative or greater than 1.0).

delete()[source]

Delete the cell.

Return type:

None

get_recorded_spikes(location='pointcell', threshold=-20)[source]

Get recorded spikes in the current cell.

Parameters:
  • location – the spike detection location

  • threshold – spike detection threshold

Returns: recorded spikes

init_callbacks()[source]

Initialize the callback function (if necessary).

start_recording_spikes(sec, location=None, threshold=0.0)[source]

Start recording spikes in the current cell.

Parameters:
  • target – target point process

  • location – the spike detection location

  • threshold (float) – spike detection threshold

Return type:

None

class bluecellulab.cell.point_process.HocPointProcessCell(cell_id, mechanism_name, spike_threshold=0.0)[source]

Point process that wraps an arbitrary HOC/mod artificial mechanism.

Parameters:
  • cell_id (Optional[CellId])

  • mechanism_name (str)

  • spike_threshold (float)

add_replay_synapse(syn_id, syn_description, syn_connection_parameters, condition_parameters, popids, extracellular_calcium)[source]

For Point Neurons, the replay simply queues events directly to the point obj.

add_synapse_replay(stimulus, spike_threshold, spike_location)[source]

SONATA-style spike replay for point processes.

This is a simplified analogue of Cell.add_synapse_replay, but instead of mapping spikes to individual synapses, we directly connect each presynaptic node_id’s spike train to this artificial cell via VecStim → NetCon.

Parameters:
  • spike_threshold (float)

  • spike_location (str)

Return type:

None

bluecellulab.cell.point_process.mechanism_name_from_model_template(template_path, model_template)[source]

Translate SONATA model_template into a NEURON mechanism name.

Examples

‘hoc:AllenPointCell’ -> ‘AllenPointCell’ ‘nrn:IntFire1’ -> ‘IntFire1’ ‘AllenPointCell’ -> ‘AllenPointCell’

Parameters:
  • template_path (str)

  • model_template (str)

Return type:

str