namespace neurostr

Neurostr namespace contains all other namespaces in the library as well as the data model classes.

Summary

Members Descriptions
namespacelog Log namespace contains logger functions.
namespaceio IO namespace contains write/read functionality for most common file formats.
namespacetraits Core template traits
namespacegeometry Geometry namespace hides geometry specific implementation details from the rest of the library.
classBranch Representation of a single branch in a reconstruction. Conceptually is an ordered sequence of nodes.
classNeurite Represents a single neurite (dendrite, apical dend. or axon)
classContour 3D contour in the reconstruction. It is an ordered sequence of 3D points (not nodes). Contours are usually closed but it is not mandatory.
classNeuron Represents a single neuron, its soma and neurites
classNode Node concept class. stores a numeric ID, x,y,z coordinates and radius. Also stores references to its branch and parent node if they exist and implements basic operations.
classPropertyMap Auxiliar class. Stores key-value properties
classReconstruction Stores several neuron as well as common contours
classWithProperties Base class for neuron , neurite ... that have a property map

namespace geometry

Geometry namespace hides geometry specific implementation details from the rest of the library.

Summary

Members Descriptions
classDiscreteFrechet
classRDPSimplifier
classTriangleMesh
public template<int I>
inline float get(constpoint_type& p)
Gets the ith component from a point.
public template<int I>
inline float get(constplanar_point& p)
Gets the ith component from a 2D point.
public inline float getx(constpoint_type& p) Gets point x coordinate.
public inline float gety(constpoint_type& p) gets pòint y coordinate
public inline float getz(constpoint_type& p) Gets point z coordinate.
public inline float get(constpoint_type& p,int coord) Gets the ith component from a point.
public template<int I>
planar_pointplanar_projection(constpoint_type& p)
Removes the ith component from P.
publicplanar_pointplanar_projection(constpoint_type& p,int i) Dynamic planar projection.
public float distance(constpoint_type& a,constpoint_type& b) Euclidean distance between a and b.
publicpoint_typevectorFromTo(constpoint_type& from,constpoint_type& to) Vector with origin in from and end in to.
public void traslate(point_type& p,constpoint_type& v) Adds v to p.
public void scale(point_type& p,float scale,constpoint_type& ref) Modifies the point p scaling it by scale wrt ref so its norm is multiplied by scale.
public void scale(point_type& p,float rx,float ry,float rz) Modifies the point p scaling it by (rx,ry,rz)
public void scale(point_type& p,float scale) Modifies p multiplying its norm by scale.
publicpoint_typecross_product(constpoint_type& p,constpoint_type& q) Computes the 3D cross product p ^ q.
public float norm(constpoint_type& p) Returns de 2-norm of p as vector.
public inline bool equal(constpoint_type& a,constpoint_type& b) Checks whether two point a and b are equal.
public inline bool equal(constplanar_point& a,constplanar_point& b) Checks whether two point a and b are equal.
public std::array<point_type, 3 > get_basis(constpoint_type& vx,constpoint_type& up) Retunrs a orthonormal right-oriented basis where vx is the first vector.
public float segment_segment_distance(constpoint_type& p0,constpoint_type& p1,constpoint_type& q0,constpoint_type& q1) Computes the distance between two line-segments p and q.
public Eigen::Quaternionf align_vectors(constpoint_type& v,constpoint_type& u,constpoint_typeup) Returns the quaternion to transform v into u (both unitary)
public bool segment_box_intersection(constbox_type& b,constsegment_type& s,point_type& inter) Computes the box-segment intersection of b and s.
public template<typename G1,typename G2>
inline bool covered_by(const G1 & g1,const G2 & g2)
Checks if first geometry is covered by the second.
public template<int I,typename Point>
inline bool segment_cross_plane(constsegment_type& s,const Point & v,Point & inter)
Segment-axis plane intersection.
public template<int I,typename Point>
inline void min_component(const Point & p,Point & res)
Set the ith component in res to the minimim betweeen the ith components in p and res.
public template<int I,typename Point>
inline void max_component(const Point & p,Point & res)
Set the ith component in res to the maximum betweeen the ith components in p and res.
public template<typename Point>
inline void max_by_component(const Point & p,Point & res)
Computes the component-wise maximum between p and res and stores it in res.
public template<typename Point>
inline void min_by_component(const Point & p,Point & res)
Computes the component-wise minimum between p and res and stores it in res.
public template<Axisaxis>
float axisLength(constbox_type& b)
Return box axis length.
public template<Axisaxis>
void setAxis(box_type& b,float v)
Set box axis to given value.
publicpolygon_typeas_planar_polygon(const std::vector<point_type> & v)
public template<typename G>
inline std::size_t num_points(const G & geom)
Number of points in the geometry.
public float polygon_area(constpolygon_type& p) Computes the pclosed polygon area.
public template<typename Iter>
inline float polygon_area(const Iter & begin,const Iter & end)
Computes the closed polygon area.
public void negate(point_type& p) Multiplies every component by -1.
publicpoint_typebarycenter(const std::vector<point_type> & v) Computes the barycenter of a pointset.
public void normalize(point_type& p) Modifies p so its norm is equal to 1.
public float vector_vector_angle(constpoint_type& a,constpoint_type& b) Computes the planar vector-vector shortest angle.
public bool box_box_intersection(constbox_type& a,constbox_type& b) Checks if box a intersects with box b (axis aligned)
public std::vector<point_type> box_corners(constbox_type& b) Returns 8 corner points in a axis-aligned box.
public float lineseg_dist(const std::vector<point_type> & u,const std::vector<point_type> & v) Euclidean distance between two line-segments.
publicbox_typebounding_box(const std::vector<point_type> & v) Computes the bounding box of a node set.
public float vector_vector_directed_angle(constpoint_type& a,constpoint_type& b,constpoint_typeup) Computes the planar angle from a to b.
public std::pair< float, float > local_orientation(constpoint_type& p,const std::array<point_type, 3 > & basis) Computes the local orientation (Azimuth and elevation) of p wrt basis.
public bool in_triangle_border(consttriangle_type& t,constpoint_type& p) Verifies if p is in the border of the triangle t.
public bool is_triangle_vertex(consttriangle_type& t,constpoint_type& p) Verifies if P is one of the vertices of T.
public bool within_triangle(consttriangle_type& t,constpoint_type& p) Verifies if p is inside the triangle t.
public bool triangle_ray_intersection(consttriangle_type& t,constpoint_type& ray_o,constpoint_type& ray_v,point_type& intersection) Computes Triangle-ray intersection with the moller-trumbore algorithm.
public float tetrahedron_volume(constpoint_type& p0,constpoint_type& p1,constpoint_type& p2,constpoint_type& p3) Returns the volume of the tetrahedron.
public float triangle_area(consttriangle_type& t) Compute the triangle area.

namespace traits

Summary

Members Descriptions
Traitfunction_traits Extract basic information from a fuctor like out type, arg type, arity...
Traitis_vector Base false trait is vector.
Traitis_base_of_template Is base of template base trait.

namespace log

Log namespace contains logger functions.

Summary

Members Descriptions
class_logger_storage
public_logger_storage_nstr_logger_
public void init_log_file(const std::string & path) Inits file logger.
public void init_log_cout() Initializes the logger using the standard output stream.
public void init_log_cerr() Initializes the logger using the standard error stream.
public void disable_log() Disables the log.
public void enable_log() Enables the log.
public void set_format(const std::string & s) Changes current log format.
public void set_level(severity_levell) Changes current logger severity threshold.

namespace io

IO namespace contains write/read functionality for most common file formats.

Summary

Members Descriptions
classASCParser
classDATParser
classJSONParser
classJSONWriter
classParser
classSWCParser
classSWCWriter
structcontour_info Contour header in DAT files.
structmarker_type Markerset structure for NL files.
structsubtree_info SubTree header in DAT files.
structtree_info Tree header in DAT files.

namespace selector

Summary

Members Descriptions
structselector_func_traits Selector function traits.
structtype_chooser Trait that extracts the selector i/o type.
structtype_chooser< true, T >
public template<typename F1,typename F2,typename... Funcs,std::enable_if_t< sizeof...(Funcs)==0 > *>
inline constexpr auto compose_selector(const F1 & f1,const F2 & f2,Funcs... fns)
Recursive template for selector composition.
public template<typename F,std::enable_if_t<selector_func_traits< F >::out_set > *>
inline constexpr auto selector_out_single_to_set(const F & f)
Converts a selector with single output in one with set output Case: Output is already set.
public template<typename F,std::enable_if_t<selector_func_traits< F >::in_set > *>
inline constexpr auto selector_in_single_to_set(const F & f)
Converts a selector with single output in one with set output Case: Output is already set.
public template<typename F1,typename F2,std::enable_if_t<selector_func_traits< F1 >::in_set > *,std::enable_if_t<selector_func_traits< F2 >::out_set > *>
inline constexpr auto selector_foreach(const F1 & f1,const F2 & f2)
Creates a new selector that applies the selector f2 to each selected element of f1.
public template<typename F1,typename F2,typename... Funcs,std::enable_if_t< sizeof...(Funcs)==0 > *>
inline constexpr auto union_selector(const F1 & f1,const F2 & f2,Funcs... fns)
Recursive template for selector union.
public template<typename F1,typename F2,typename... Funcs,std::enable_if_t< sizeof...(Funcs)==0 > *>
inline constexpr auto intersection_selector(const F1 & f1,const F2 & f2,Funcs... fns)
Recursive template for selector intersection.
public template<typename F1,typename F2,std::enable_if_t<!selector_func_traits< F1 >::in_set > *>
inline constexpr auto diff_selector_factory(const F1 & f_1,const F2 & f_2)
Assymetric difference.

namespace measure

Summary

Members Descriptions
namespaceaggregate Namespace that contains aggregate-related functions and traits
template <typename Fn> auto measureEach(const Fn& f) Converts a single-input measure into a set measure that applies the original measure to each element of the input set
template <typename Fn, typename Aggr> auto measureEachAggregate(const Fn& f, const Aggr& aggr) Converts a single-input measure into a set measure that applies the original measure to each element of the input set and then aggregates the output.
template <typename S, typename M> auto selectorMeasureCompose(const S& selector, const M& measure) Creates a new measure as result of the composition of the selector and the measure (M o S). Types and arity must match
template <typename... Measures> auto createMeasureTuple(const Measures&... measures ) Creates a measure that applies several measures to the same input and returns their result in a tuple
template <typename F> struct measure_func_traits Measure function traits. Extracts input type, input arity and output type.

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