namespace validator

Validator namespace contains the validator template class and the prebuilt validators and check functions.

Summary

Members Descriptions
classValidator
classValidatorItem
classcheck_func_traits
public const auto is_true Dummy. Checks that a given boolean is true
public const auto is_false Dummy. Checks that a given boolean is false
public const auto empty_string Dummy. Checks that a given string is empty
public template<typename T>
inline auto range_check_factory(T min,T max)
Range check factory. Checks that a given value is in the range [min, max)
public const auto neurites_attached_to_soma Neurite validator. Checks that neurites are attached to the soma
public const auto neuron_has_soma Neuron validator. Checks that neuron soma is defined
public const auto no_trifurcations_validator Node validator. Checks that the number of descendants of a node is at most 2.
public const auto zero_length_segments_validator Node validator. Checks that the length of the compartment associated to each node is not zero.
public const auto radius_length_segments_validator Node validator. Check that the distance between two consecutive nodes is greater than the sum of their radii.
public const auto increasing_radius_validator Node validator. Checks that the node radius is not increasing.
public const auto segment_collision_validator Node validator. Check that the node compartment don't collide with any other compartment in the reconstruction
public const auto extreme_angles_validator Node validator. Check that the elongation/bifurcation angle are not too high to be plausible
public inline auto planar_reconstruction_validator_factory(float min) Neurite validator. Verifies that neurite reconstruction is not planar by checking that its non-axis aligned box volume is over the minimum value (close to 0)
public inline auto dendrite_count_validator_factory(unsigned int min,unsigned int max) Neuron validator. Checks that the number of dendrites in the neuron is in the range [min,max)
public inline auto apical_count_validator_factory(bool strict) Neuron validator. Checks that the number of apical dendrites in the neuron is not greater than 2
public inline auto axon_count_validator_factory(bool strict) Neuron validator. Checks that the number of axons in the neuron is not greater than 2
public inline auto linear_branches_validator_factory(float min) Branch validator. Verifies that the branch reconstruction is not a prefect straight line by checking that its tortuosity value is not equal to 1
public inline auto branch_collision_validator_factory(bool ignore_diams) Branch validator. Check that the Branch dont collide with any other branch in the neuron

class Validator

Summary

Members Descriptions
public inline Validator(M measure,C check) Creates a validator with given measure and check functions.
public inline void validate(const Neuron & n) Runs the validation for the given Neuron.
public inline storage_type::const_iterator begin() const Begin const bidirectional iterator to the validation results.
public inline storage_type::const_iterator end() const End const bidirectional iterator to the validation results.
public inline storage_type::size_type size() const Returns the number of validated items.
public inline void set_name(const std::string & s) Sets the validation name.
public inline void set_description(const std::string & s) Sets the validation description string.
public inline bool pass() const Check if all validated elements passed the check function.
public inline std::ostream & toJSON(std::ostream & os,bool failuresOnly) const Writes the validator (name and description), the neuron id and the results as a JSON string in the given stream.
public inline std::ostream & toJSON(std::ostream & os,const std::string & name,const std::string & desc,bool failuresOnly) const Writes the validator, the neuron id and the results as a JSON string in the given stream.

Members


public inline Validator(M measure,C check)

Creates a validator with given measure and check functions.

Parameters

  • measure Measure function. Should take a single element as imput

  • check Check function. Should take a single measure value as input

Returns

Validator


public inline void validate(const Neuron & n)

Runs the validation for the given Neuron.

Parameters

  • n Neuron to be validated

public inline storage_type::const_iterator begin() const

Begin const bidirectional iterator to the validation results.

Returns

Bidirectional iterator to ValidatorItem


public inline storage_type::const_iterator end() const

End const bidirectional iterator to the validation results.

Returns

Bidirectional iterator to ValidatorItem


public inline storage_type::size_type size() const

Returns the number of validated items.

Returns

Number of validated items


public inline void set_name(const std::string & s)

Sets the validation name.

Parameters

  • s Validation shortname

public inline void set_description(const std::string & s)

Sets the validation description string.

Parameters

  • s Validation description

public inline bool pass() const

Check if all validated elements passed the check function.

Returns

True if all elements passed


public inline std::ostream & toJSON(std::ostream & os,bool failuresOnly) const

Writes the validator (name and description), the neuron id and the results as a JSON string in the given stream.

Parameters

Returns

Stream


public inline std::ostream & toJSON(std::ostream & os,const std::string & name,const std::string & desc,bool failuresOnly) const

Writes the validator, the neuron id and the results as a JSON string in the given stream.

Parameters

  • os Output stream

  • name Validation shortname

  • desc Validation description

  • failuresOnly Write only failing ValidatorItem

Returns

Output stream


class ValidatorItem

Summary

Members Descriptions
public std::reference_wrapper< T > element Validated element.
public V value Measure value.
public bool valid Check function value.
public inline ValidatorItem() Default empty constructor.
public inline ValidatorItem(T & el,value_typeval,bool is_valid) Creates an item with the given parameters.
public inline std::string element_id_json() const Creates a JSON object with the full ID for the given element.
public inline std::string element_type() const Returns an string with the element name (Neuron, Neurite, Branch or Node)
public inline std::ostream & toJSON(std::ostream & os) const Writes the Item to the given stream as a JSON object.

Members


public std::reference_wrapper< T > element

Validated element.


public V value

Measure value.


public bool valid

Check function value.


public inline ValidatorItem()

Default empty constructor.


public inline ValidatorItem(T & el,value_typeval,bool is_valid)

Creates an item with the given parameters.

Parameters

  • el Validated element reference

  • val Measure value

  • is_valid Check function value

public inline std::string element_id_json() const

Creates a JSON object with the full ID for the given element.

Returns

JSON ID Object string


public inline std::string element_type() const

Returns an string with the element name (Neuron, Neurite, Branch or Node)

Returns

Element type string


public inline std::ostream & toJSON(std::ostream & os) const

Writes the Item to the given stream as a JSON object.

Parameters

  • os Output stream

Returns

JSON Object with type, id, value and pass result.


Checks

public const auto is_true

Dummy. Checks that a given boolean is true


public const auto is_false

Dummy.

Checks that a given booelan is false


public const auto empty_string

Dummy.

Checks that a given string is empty


public template<typename T>
inline auto range_check_factory(T min,T max)

Range check factory. Checks that a given value is in the range [min, max)

Parameters

  • min Range minimum

  • max Range maximum

Prebuilt validators

Summary

Members Descriptions
public const auto neurites_attached_to_soma Neurite validator. Checks that neurites are attached to the soma
public const auto neuron_has_soma Neuron validator. Checks that neuron soma is defined
public const auto no_trifurcations_validator Node validator. Checks that the number of descendants of a node is at most 2.
public const auto zero_length_segments_validator Node validator. Checks that the length of the compartment associated to each node is not zero.
public const auto radius_length_segments_validator Node validator. Check that the distance between two consecutive nodes is greater than the sum of their radii.
public const auto increasing_radius_validator Node validator. Checks that the node radius is not increasing.
public const auto segment_collision_validator Node validator. Check that the node compartment don't collide with any other compartment in the reconstruction
public const auto extreme_angles_validator Node validator. Check that the elongation/bifurcation angle are not too high to be plausible
public inline auto planar_reconstruction_validator_factory(float min) Neurite validator. Verifies that neurite reconstruction is not planar by checking that its non-axis aligned box volume is over the minimum value (close to 0)
public inline auto dendrite_count_validator_factory(unsigned int min,unsigned int max) Neuron validator. Checks that the number of dendrites in the neuron is in the range [min,max)
public inline auto apical_count_validator_factory(bool strict) Neuron validator. Checks that the number of apical dendrites in the neuron is not greater than 2
public inline auto axon_count_validator_factory(bool strict) Neuron validator. Checks that the number of axons in the neuron is not greater than 2
public inline auto linear_branches_validator_factory(float min) Branch validator. Verifies that the branch reconstruction is not a prefect straight line by checking that its tortuosity value is not equal to 1
public inline auto branch_collision_validator_factory(bool ignore_diams) Branch validator. Check that the Branch dont collide with any other branch in the neuron

public const auto neurites_attached_to_soma

Neurite validator. Checks that neurites are attached to the soma


public const auto neuron_has_soma

Neuron validator. Checks that neuron soma is defined


public const auto no_trifurcations_validator

Node validator. Checks that the number of descendants of a node is at most 2.


public const auto zero_length_segments_validator

Node validator. Checks that the length of the compartment associated to each node is not zero.


public const auto radius_length_segments_validator

Node validator. Check that the distance between two consecutive nodes is greater than the sum of their radii.


public const auto increasing_radius_validator

Node validator. Checks that the node radius is not increasing.


public const auto segment_collision_validator

Node validator. Check that the node compartment don't collide with any other compartment in the reconstruction


public const auto extreme_angles_validator

Node validator. Check that the elongation/bifurcation angle are not too high to be plausible


public inline auto planar_reconstruction_validator_factory(float min)

Neurite validator. Verifies that neurite reconstruction is not planar by checking that its non-axis aligned box volume is over the minimum value (close to 0)


public inline auto dendrite_count_validator_factory(unsigned int min,unsigned int max)

Neuron validator. Checks that the number of dendrites in the neuron is in the range [min,max)


public inline auto apical_count_validator_factory(bool strict)

Neuron validator. Checks that the number of apical dendrites in the neuron is not greater than 2

Parameters

  • strict If true, Neurons with no apical dendrite are rejected

public inline auto axon_count_validator_factory(bool strict)

Neuron validator. Checks that the number of axons in the neuron is not greater than 2

Parameters

  • strict If true, Neurons with no axon are rejected

public inline auto linear_branches_validator_factory(float min)

Branch validator.Verifies that the branch reconstruction is not a prefect straight line by checking that its tortuosity value is not equal to 1

Parameters

  • min Minimum accepted tortuosity value

public inline auto branch_collision_validator_factory(bool ignore_diams)

Branch validator. Check that the Branch dont collide with any other branch in the neuron

Parameters

  • ignore_diams If true, node diameter value are ignored