ug4
ug::NeuriteProjector Class Reference

#include <neurite_projector.h>

+ Inheritance diagram for ug::NeuriteProjector:

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 Neuriteneurite (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
IGeometry3dgeom ()
 
const IGeometry3dgeom () 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 &center, 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< SurfaceParamsm_aSurfParams
 
std::vector< std::pair< number, number > > m_qPoints
 for quadrature when projecting within branching points More...
 
std::vector< Neuritem_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
 

Constructor & Destructor Documentation

◆ NeuriteProjector() [1/2]

ug::NeuriteProjector::NeuriteProjector ( )

◆ NeuriteProjector() [2/2]

ug::NeuriteProjector::NeuriteProjector ( SPIGeometry3d  geometry)

◆ ~NeuriteProjector()

ug::NeuriteProjector::~NeuriteProjector ( )
virtual

Member Function Documentation

◆ attach_surf_params()

◆ average_params()

◆ average_pos_from_parent()

void ug::NeuriteProjector::average_pos_from_parent ( vector3 posOut,
const IVertexGroup *const  parent 
) const

◆ axial_range_around_branching_region()

number ug::NeuriteProjector::axial_range_around_branching_region ( uint32_t  nid,
size_t  brInd,
number  numberOfRadii = 5.0 
) const

◆ axial_range_around_soma_region()

number ug::NeuriteProjector::axial_range_around_soma_region ( const SomaBranchingRegion sr,
size_t  numRadii,
size_t  nid,
Vertex vrt 
) const

◆ debug_neurites()

void ug::NeuriteProjector::debug_neurites ( ) const

◆ direction_at_grid_object()

◆ get_section_iterator()

std::vector< NeuriteProjector::Section >::const_iterator ug::NeuriteProjector::get_section_iterator ( uint32_t  nid,
float  t 
) const
protected

◆ get_soma_section_iterator()

std::vector< NeuriteProjector::Section >::const_iterator ug::NeuriteProjector::get_soma_section_iterator ( uint32_t  nid,
float  t 
) const
protected

◆ is_in_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().

◆ IsElementInsideSphere()

template<class TElem >
bool ug::NeuriteProjector::IsElementInsideSphere ( const TElem *  elem,
const ug::vector3 center,
const number  radius 
) const
inlineprivate

check if an element is inside a sphere

Parameters
[in]elem
[in]center
[in]radius
Returns
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().

◆ load()

template<class Archive >
void ug::NeuriteProjector::load ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

◆ neurite()

const NeuriteProjector::Neurite & ug::NeuriteProjector::neurite ( uint32_t  nid) const

◆ neurites()

std::vector< NeuriteProjector::Neurite > & ug::NeuriteProjector::neurites ( )

References m_vNeurites.

◆ new_vertex() [1/4]

number ug::NeuriteProjector::new_vertex ( Vertex vrt,
Edge parent 
)
virtual

called when a new vertex was created from an old edge

Reimplemented from ug::RefinementProjector.

References push_into_place().

◆ new_vertex() [2/4]

number ug::NeuriteProjector::new_vertex ( Vertex vrt,
Face parent 
)
virtual

called when a new vertex was created from an old face

Reimplemented from ug::RefinementProjector.

References push_into_place().

◆ new_vertex() [3/4]

number ug::NeuriteProjector::new_vertex ( Vertex vrt,
Vertex parent 
)
virtual

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().

◆ new_vertex() [4/4]

number ug::NeuriteProjector::new_vertex ( Vertex vrt,
Volume parent 
)
virtual

called when a new vertex was created from an old volume

Reimplemented from ug::RefinementProjector.

References push_into_place().

◆ position()

vector3 ug::NeuriteProjector::position ( Vertex vrt) const

◆ prepare_quadrature()

void ug::NeuriteProjector::prepare_quadrature ( )
protected

points

weights

References ug::cmpQPairs(), and m_qPoints.

Referenced by NeuriteProjector().

◆ print_surface_params()

◆ project()

void ug::NeuriteProjector::project ( Vertex vrt)

project a vertex to its model position

References push_into_place().

◆ push_into_place()

number ug::NeuriteProjector::push_into_place ( Vertex vrt,
const IVertexGroup parent 
)
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().

◆ quadrature_points()

const std::vector< std::pair< number, number > > & ug::NeuriteProjector::quadrature_points ( ) const

References m_qPoints.

Referenced by ug::bp_defect_and_gradient().

◆ save()

template<class Archive >
void ug::NeuriteProjector::save ( Archive &  ar,
const unsigned int  version 
) const
inlineprivate

◆ set_geometry()

void ug::NeuriteProjector::set_geometry ( SPIGeometry3d  geometry)
virtual

◆ somata()

std::vector<SomaBranchingRegion>& ug::NeuriteProjector::somata ( )

◆ surface_params_accessor() [1/2]

Grid::VertexAttachmentAccessor< Attachment< NeuriteProjector::SurfaceParams > > & ug::NeuriteProjector::surface_params_accessor ( )

References m_aaSurfParams.

◆ surface_params_accessor() [2/2]

const Grid::VertexAttachmentAccessor< Attachment< NeuriteProjector::SurfaceParams > > & ug::NeuriteProjector::surface_params_accessor ( ) const

References m_aaSurfParams.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ m_aaSurfParams

◆ m_aSurfParams

Attachment<SurfaceParams> ug::NeuriteProjector::m_aSurfParams
private

Referenced by attach_surf_params().

◆ m_qPoints

std::vector<std::pair<number, number> > ug::NeuriteProjector::m_qPoints
private

for quadrature when projecting within branching points

Referenced by prepare_quadrature(), and quadrature_points().

◆ m_vNeurites

std::vector<Neurite> ug::NeuriteProjector::m_vNeurites
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().


The documentation for this class was generated from the following files: