neurots.generate.algorithms.common

Functionality used by multiple algorithms.

Functions

checks_bif_term(ref, bif, term, target_length)

Check bif/term.

section_data(direction, first_point, ...)

Generate section data dictionary from arguments.

Classes

TMDStop(bif_id, bif, term_id, term, ref)

Class to define the data for stop criteria based on the TMD method.

class neurots.generate.algorithms.common.TMDStop(bif_id, bif, term_id, term, ref)

Bases: object

Class to define the data for stop criteria based on the TMD method.

Parameters:
  • bif_id (int) – The bifurcation ID.

  • bif (float) – The bifurcation value.

  • term_id (int) – The termination ID.

  • term (float) – The termination value.

  • ref (float) – The reference value (i.e for path or radial distances).

child_length()

Return the child length.

Return the absolute difference between bifurcation and termination, which defines the length of the bar.

expected_bifurcation_length()

Compute an estimate for the length of the branch if a bifurcation occurs.

That will happen at distance bif and therefore the expected length is: (bifurcation - current length). If bifurcation is inf, the expected length is zero.

expected_maximum_length()

Return the expected length of the current section.

That is computed as the difference between reference value and the expected bifurcation value. If bifurcation < termination, then the reference value minus the termination will be computed instead. In real morphologies termination will be larger than bifurcation, unless bifurcation is set to inf. So the expected length will be computed based on term only if the section will terminate before it bifurcates.

expected_termination_length()

Compute an estimate for the length of the branch if a termination occurs.

That will happen at distance term and therefore the expected length is: (termination - current length). If termination is inf, the expected length is zero.

printme()

Print all features.

update_bif(bif_id, bif)

Set new values to bifurcation.

update_term(term_id, term)

Set new values to termination.

verify()

Check the validity of the TMDStop.

Validity is defined by bif < term unless bif in infinity. Also both bif and term have to be larger than the reference distance.

Returns:

True if stop is valid, False otherwise.

Return type:

bool

neurots.generate.algorithms.common.checks_bif_term(ref, bif, term, target_length)

Check bif/term.

Parameters:
  • bif (float) – The bifurcation value.

  • term (float) – The termination value.

  • target_length (float) – The target value.

Returns:

True if:

  1. Ref < Bif < Term unless Bif is infinite, then Ref < Term.

  2. target_length >= (Bif - Ref).

  3. target_length >= (Term - Ref).

Otherwise returns False.

Return type:

bool

neurots.generate.algorithms.common.section_data(direction, first_point, stop_criteria, process_type)

Generate section data dictionary from arguments.