ug4
|
#include <neurite_projector.h>
Classes | |
struct | BPProjectionHelper |
struct | BranchingPoint |
struct | BranchingRegion |
struct | CompareBranchingRegionEnds |
struct | CompareSections |
struct | CompareSomaBranchingRegionsEnd |
struct | Mapping |
Mapping of model to surface vertices. More... | |
struct | Neurite |
struct | Section |
struct | SomaBranchingRegion |
struct | SomaPoint |
struct | SurfaceParams |
Public Member Functions | |
void | average_pos_from_parent (vector3 &posOut, const IVertexGroup *const parent) const |
number | axial_range_around_branching_region (uint32_t nid, size_t brInd, number numberOfRadii=5.0) const |
number | axial_range_around_soma_region (const SomaBranchingRegion &sr, size_t numRadii, size_t nid, Vertex *vrt) const |
void | debug_neurites () const |
void | direction_at_grid_object (vector3 &dirOut, GridObject *o) const |
spline direction at some grid object More... | |
bool | is_in_axial_range_around_soma_region (const SomaBranchingRegion &sr, size_t nid, Vertex *vrt) const |
const Neurite & | neurite (uint32_t nid) const |
NeuriteProjector () | |
NeuriteProjector (SPIGeometry3d geometry) | |
std::vector< Neurite > & | neurites () |
virtual number | new_vertex (Vertex *vrt, Edge *parent) |
called when a new vertex was created from an old edge More... | |
virtual number | new_vertex (Vertex *vrt, Face *parent) |
called when a new vertex was created from an old face More... | |
virtual number | new_vertex (Vertex *vrt, Vertex *parent) |
called when a new vertex was created from an old vertex More... | |
virtual number | new_vertex (Vertex *vrt, Volume *parent) |
called when a new vertex was created from an old volume More... | |
vector3 | position (Vertex *vrt) const |
void | print_surface_params (const Vertex *const v) const |
void | project (Vertex *vrt) |
project a vertex to its model position More... | |
const std::vector< std::pair< number, number > > & | quadrature_points () const |
virtual void | set_geometry (SPIGeometry3d geometry) |
std::vector< SomaBranchingRegion > & | somata () |
Grid::VertexAttachmentAccessor< Attachment< SurfaceParams > > & | surface_params_accessor () |
const Grid::VertexAttachmentAccessor< Attachment< SurfaceParams > > & | surface_params_accessor () const |
virtual | ~NeuriteProjector () |
Public Member Functions inherited from ug::RefinementProjector | |
virtual SPIGeometry3d | geometry () const |
virtual void | refinement_begins (const ISubGrid *sg) |
called before refinement begins More... | |
virtual bool | refinement_begins_requires_subgrid () const |
virtual void | refinement_ends () |
called when refinement is done More... | |
RefinementProjector () | |
RefinementProjector (SPElementCallback cb) | |
RefinementProjector (SPIGeometry3d geometry) | |
RefinementProjector (SPIGeometry3d geometry, SPElementCallback concernedElems) | |
virtual void | set_concerned_elements (SPElementCallback cb) |
virtual | ~RefinementProjector () |
Protected Member Functions | |
void | attach_surf_params () |
void | average_params (uint32_t &neuriteID, float &t, float &angle, float &radius, const IVertexGroup *parent) const |
std::vector< Section >::const_iterator | get_section_iterator (uint32_t nid, float t) const |
std::vector< NeuriteProjector::Section >::const_iterator | get_soma_section_iterator (uint32_t nid, float t) const |
void | prepare_quadrature () |
number | push_into_place (Vertex *vrt, const IVertexGroup *parent) |
Protected Member Functions inherited from ug::RefinementProjector | |
IGeometry3d & | geom () |
const IGeometry3d & | geom () const |
template<class TElem > | |
bool | is_concerned (TElem *e) |
vector3 | pos (Vertex *v) const |
void | set_pos (Vertex *v, const vector3 &p) |
Private Member Functions | |
template<class TElem > | |
bool | IsElementInsideSphere (const TElem *elem, const ug::vector3 ¢er, const number radius) const |
check if an element is inside a sphere More... | |
template<class Archive > | |
void | load (Archive &ar, const unsigned int version) |
template<class Archive > | |
void | save (Archive &ar, const unsigned int version) const |
Private Attributes | |
Grid::VertexAttachmentAccessor< Attachment< SurfaceParams > > | m_aaSurfParams |
Attachment< SurfaceParams > | m_aSurfParams |
std::vector< std::pair< number, number > > | m_qPoints |
for quadrature when projecting within branching points More... | |
std::vector< Neurite > | m_vNeurites |
storage for cubic splines: Vector of sorted vectors of sections; each inner vector represents a single neurite. Any complete neurite is parameterized by t in [0,1]. Each section in the neurite vector consists of the parameter t at which the section ends and the sixteen coefficients describing the spline in each dimension (monomial basis {(t_(i+1) - t)^i}_i). More... | |
Friends | |
class | boost::serialization::access |
ug::NeuriteProjector::NeuriteProjector | ( | ) |
References ug::GlobalAttachments::is_declared(), and prepare_quadrature().
ug::NeuriteProjector::NeuriteProjector | ( | SPIGeometry3d | geometry | ) |
References attach_surf_params(), ug::GlobalAttachments::is_declared(), and prepare_quadrature().
|
virtual |
|
protected |
References ug::RefinementProjector::geometry(), ug::Grid::has_vertex_attachment(), ug::GlobalAttachments::is_declared(), m_aaSurfParams, m_aSurfParams, and UG_COND_THROW.
Referenced by NeuriteProjector(), and set_geometry().
|
protected |
References ug::NeuriteProjector::SurfaceParams::angular, ug::NeuriteProjector::SurfaceParams::axial, ug::compute_angle(), ug::compute_first_section_end_points(), ug::compute_ONB(), ug::compute_position_and_velocity_in_section(), m_aaSurfParams, m_vNeurites, ug::NeuriteProjector::SurfaceParams::neuriteID, ug::IVertexGroup::num_vertices(), ug::PI, ug::RefinementProjector::pos(), position(), ug::NeuriteProjector::SurfaceParams::radial, UG_LOGN, ug::VecAdd(), ug::VecNorm(), ug::VecNormSquared(), ug::VecProd(), ug::VecScale(), ug::VecScaleAdd(), ug::VecSubtract(), ug::VecTwoNorm(), and ug::IVertexGroup::vertex().
Referenced by direction_at_grid_object(), and push_into_place().
void ug::NeuriteProjector::average_pos_from_parent | ( | vector3 & | posOut, |
const IVertexGroup *const | parent | ||
) | const |
References ug::IVertexGroup::num_vertices(), ug::RefinementProjector::pos(), and ug::IVertexGroup::vertex().
Referenced by ug::bp_newton_start_pos(), and ug::pos_on_surface_tip().
number ug::NeuriteProjector::axial_range_around_soma_region | ( | const SomaBranchingRegion & | sr, |
size_t | numRadii, | ||
size_t | nid, | ||
Vertex * | vrt | ||
) | const |
const float somaRad = sr.radius;
References ug::NeuriteProjector::SomaBranchingRegion::bp, ug::compute_first_section_end_points(), get_soma_section_iterator(), position(), s, ug::NeuriteProjector::SomaBranchingRegion::t, UG_CATCH_THROW, and ug::VecDistance().
void ug::NeuriteProjector::debug_neurites | ( | ) | const |
References m_vNeurites, neurite(), UG_LOGN, and ug::NeuriteProjector::Neurite::vBR.
void ug::NeuriteProjector::direction_at_grid_object | ( | vector3 & | dirOut, |
GridObject * | o | ||
) | const |
spline direction at some grid object
References average_params(), ug::NeuriteProjector::SurfaceParams::axial, ug::GridObject::base_object_id(), ug::NeuriteProjector::Section::endParam, get_section_iterator(), m_aaSurfParams, ug::NeuriteProjector::SurfaceParams::neuriteID, s, ug::NeuriteProjector::Section::splineParamsX, ug::NeuriteProjector::Section::splineParamsY, ug::NeuriteProjector::Section::splineParamsZ, UG_COND_THROW, and ug::VERTEX.
|
protected |
References m_vNeurites, and UG_COND_THROW.
Referenced by axial_range_around_branching_region(), and direction_at_grid_object().
|
protected |
References m_vNeurites, and UG_COND_THROW.
Referenced by axial_range_around_soma_region().
bool ug::NeuriteProjector::is_in_axial_range_around_soma_region | ( | const SomaBranchingRegion & | sr, |
size_t | nid, | ||
Vertex * | vrt | ||
) | const |
const number radius = axial_range_around_soma_region(sr, 0.1, nid, vrt);
References ug::NeuriteProjector::SomaBranchingRegion::center, and UG_LOGN.
Referenced by push_into_place().
|
inlineprivate |
check if an element is inside a sphere
[in] | elem | |
[in] | center | |
[in] | radius |
true
if element is inside or on sphere else false References ug::aPosition, ug::CalculateCenter(), ug::RefinementProjector::geometry(), s, ug::SMALL, ug::sq(), ug::VecPow(), and ug::VecSubtract().
|
inlineprivate |
const NeuriteProjector::Neurite & ug::NeuriteProjector::neurite | ( | uint32_t | nid | ) | const |
References m_vNeurites, and UG_COND_THROW.
Referenced by axial_range_around_branching_region(), ug::bp_newton_start_pos(), debug_neurites(), load(), ug::pos_in_bp(), and push_into_place().
std::vector< NeuriteProjector::Neurite > & ug::NeuriteProjector::neurites | ( | ) |
References m_vNeurites.
called when a new vertex was created from an old edge
Reimplemented from ug::RefinementProjector.
References push_into_place().
called when a new vertex was created from an old face
Reimplemented from ug::RefinementProjector.
References push_into_place().
called when a new vertex was created from an old vertex
Reimplemented from ug::RefinementProjector.
References m_aaSurfParams, ug::RefinementProjector::pos(), and ug::RefinementProjector::set_pos().
called when a new vertex was created from an old volume
Reimplemented from ug::RefinementProjector.
References push_into_place().
References ug::RefinementProjector::pos().
Referenced by average_params(), axial_range_around_soma_region(), and push_into_place().
|
protected |
void ug::NeuriteProjector::print_surface_params | ( | const Vertex *const | v | ) | const |
void ug::NeuriteProjector::project | ( | Vertex * | vrt | ) |
project a vertex to its model position
References push_into_place().
|
protected |
UG_LOGN("Number of soma branching regions for neurite with id: " << plainNID << ": " << vSBR.size());
This works due to the fact that vBR is sorted ascending
This works due to the fact that vSBR is sorted ascending
This should integrate along the neurite [0, END_SOMA_BRANCHING_REGION] but not [-range, range] to avoid dints in the soma interior close to the surface. A new position for the vertex based on the average of the (first) neurite section and the soma sphere position and radius will be calculated based on the SomaRegion information stored in a struct. FIXME: Optimize iteration: Find better starting position for iteration start pos_on_surface_soma_bp(pos, neurite, neuriteID, t, angle, parent, this, rad, vrt, *it2, m_aaSurfParams);
pos_on_surface_soma(pos, neurite, this, parent);
References average_params(), axial_range_around_branching_region(), is_in_axial_range_around_soma_region(), m_aaSurfParams, m_vNeurites, neurite(), ug::RefinementProjector::pos(), ug::pos_in_bp(), ug::pos_in_neurite(), ug::pos_on_surface_tip(), position(), ug::RefinementProjector::set_pos(), UG_CATCH_THROW, UG_COND_THROW, UG_LOGN, ug::NeuriteProjector::Neurite::vBR, and ug::NeuriteProjector::Neurite::vSBR.
Referenced by new_vertex(), and project().
const std::vector< std::pair< number, number > > & ug::NeuriteProjector::quadrature_points | ( | ) | const |
References m_qPoints.
Referenced by ug::bp_defect_and_gradient().
|
inlineprivate |
References ug::AT_DATA, ug::AT_GUI, m_vNeurites, and UG_EMPTY_BASE_CLASS_SERIALIZATION.
|
virtual |
Reimplemented from ug::RefinementProjector.
References attach_surf_params(), ug::RefinementProjector::geometry(), and ug::RefinementProjector::set_geometry().
std::vector<SomaBranchingRegion>& ug::NeuriteProjector::somata | ( | ) |
Grid::VertexAttachmentAccessor< Attachment< NeuriteProjector::SurfaceParams > > & ug::NeuriteProjector::surface_params_accessor | ( | ) |
References m_aaSurfParams.
const Grid::VertexAttachmentAccessor< Attachment< NeuriteProjector::SurfaceParams > > & ug::NeuriteProjector::surface_params_accessor | ( | ) | const |
References m_aaSurfParams.
|
friend |
|
private |
|
private |
Referenced by attach_surf_params().
for quadrature when projecting within branching points
Referenced by prepare_quadrature(), and quadrature_points().
|
private |
storage for cubic splines: Vector of sorted vectors of sections; each inner vector represents a single neurite. Any complete neurite is parameterized by t in [0,1]. Each section in the neurite vector consists of the parameter t at which the section ends and the sixteen coefficients describing the spline in each dimension (monomial basis {(t_(i+1) - t)^i}_i).
spline information for neurites
Referenced by average_params(), axial_range_around_branching_region(), debug_neurites(), get_section_iterator(), get_soma_section_iterator(), load(), neurite(), neurites(), push_into_place(), and save().