35 #ifndef UG__LIB_GRID__REFINEMENT__PROJECTORS__NEURITE_PROJECTOR_H
36 #define UG__LIB_GRID__REFINEMENT__PROJECTORS__NEURITE_PROJECTOR_H
41 #include <boost/serialization/split_member.hpp>
92 template <
class Archive>
93 void serialize(Archive& ar,
const unsigned int version)
96 for (
size_t i = 0; i < 4; ++i)
106 struct BranchingPoint;
119 template<
class Archive>
120 void save(Archive & ar,
const unsigned int version)
const
124 bool owns_bp =
bp->vRegions[0] ==
this;
130 template<
class Archive>
131 void load(Archive & ar,
const unsigned int version)
145 BOOST_SERIALIZATION_SPLIT_MEMBER()
154 template <
class Archive>
160 size_t sz =
vNid.size();
163 for (
size_t i = 0; i < sz; ++i)
181 template <
class Archive>
182 void serialize(Archive& ar,
const unsigned int version) {
187 template<
class Archive>
188 void load(Archive & ar,
const unsigned int version)
225 std::vector<BranchingRegion>
vBR;
227 std::vector<SomaBranchingRegion>
vSBR;
229 template <
class Archive>
235 size_t sz =
vSec.size();
238 for (
size_t i = 0; i < sz; ++i)
244 for (
size_t i = 0; i < sz; ++i)
251 for (
size_t i = 0; i < sz; ++i)
257 for (
size_t i = 0; i < sz; ++i) {
316 std::vector<SomaBranchingRegion>&
somata();
328 number numberOfRadii = 5.0
387 template <
class TElem>
400 number s = diff.x() + diff.y() + diff.z();
405 template<
class Archive>
406 void save(Archive & ar,
const unsigned int version)
const
416 for (
size_t i = 0; i < sz; ++i) {
426 template<
class Archive>
427 void load(Archive & ar,
const unsigned int version)
435 for (
size_t i = 0; i < sz; ++i) {
441 for (
size_t n = 0; n < nNeurites; ++n)
445 for (
size_t b = 0; b < nBR; ++b)
449 if (bp.
valid() && !bp->vRegions.size())
451 size_t nReg = bp->vNid.size();
452 bp->vRegions.resize(nReg);
453 bp->vRegions[0] = &br;
454 for (
size_t r = 1; r < nReg; ++r)
457 "No branching region in neurite where there should be one.")
458 bp->vRegions[r] = &
m_vNeurites[bp->vNid[r]].vBR[0];
459 bp->vRegions[r]->bp = bp;
466 BOOST_SERIALIZATION_SPLIT_MEMBER()
470 std::ostream&
operator<<(std::ostream& os,
const NeuriteProjector::SurfaceParams& surfParams);
471 std::istream&
operator>>(std::istream& in, NeuriteProjector::SurfaceParams& surfParams);
#define UG_EMPTY_BASE_CLASS_SERIALIZATION(clsDerived, clsBase)
Definition: boost_serialization.h:51
bool valid() const
returns true if the pointer is valid, false if not.
Definition: smart_pointer.h:206
A generic specialization of IAttachment.
Definition: attachment_pipe.h:263
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Base class for all classes which consist of a group of vertices.
Definition: grid_base_objects.h:317
Definition: neurite_projector.h:47
bool IsElementInsideSphere(const TElem *elem, const ug::vector3 ¢er, const number radius) const
check if an element is inside a sphere
Definition: neurite_projector.h:389
void load(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:427
Grid::VertexAttachmentAccessor< Attachment< SurfaceParams > > & surface_params_accessor()
Definition: neurite_projector.cpp:257
void average_params(uint32_t &neuriteID, float &t, float &angle, float &radius, const IVertexGroup *parent) const
Definition: neurite_projector.cpp:547
number axial_range_around_soma_region(const SomaBranchingRegion &sr, size_t numRadii, size_t nid, Vertex *vrt) const
Definition: neurite_projector.cpp:1622
void debug_neurites() const
Definition: neurite_projector.cpp:209
void print_surface_params(const Vertex *const v) const
Definition: neurite_projector.cpp:897
void save(Archive &ar, const unsigned int version) const
Definition: neurite_projector.h:406
std::vector< std::pair< number, number > > m_qPoints
for quadrature when projecting within branching points
Definition: neurite_projector.h:378
const Neurite & neurite(uint32_t nid) const
Definition: neurite_projector.cpp:248
Attachment< SurfaceParams > m_aSurfParams
Definition: neurite_projector.h:366
std::vector< Neurite > & neurites()
Definition: neurite_projector.cpp:242
number push_into_place(Vertex *vrt, const IVertexGroup *parent)
Definition: neurite_projector.cpp:1664
Grid::VertexAttachmentAccessor< Attachment< SurfaceParams > > m_aaSurfParams
Definition: neurite_projector.h:367
virtual number new_vertex(Vertex *vrt, Vertex *parent)
called when a new vertex was created from an old vertex
Definition: neurite_projector.cpp:98
std::vector< Section >::const_iterator get_section_iterator(uint32_t nid, float t) const
Definition: neurite_projector.cpp:277
virtual ~NeuriteProjector()
Definition: neurite_projector.cpp:87
std::vector< NeuriteProjector::Section >::const_iterator get_soma_section_iterator(uint32_t nid, float t) const
Definition: neurite_projector.cpp:291
vector3 position(Vertex *vrt) const
Definition: neurite_projector.cpp:848
number axial_range_around_branching_region(uint32_t nid, size_t brInd, number numberOfRadii=5.0) const
Definition: neurite_projector.cpp:854
void average_pos_from_parent(vector3 &posOut, const IVertexGroup *const parent) const
Definition: neurite_projector.cpp:793
void direction_at_grid_object(vector3 &dirOut, GridObject *o) const
spline direction at some grid object
Definition: neurite_projector.cpp:134
void prepare_quadrature()
Definition: neurite_projector.cpp:308
void attach_surf_params()
Definition: neurite_projector.cpp:195
std::vector< Neurite > m_vNeurites
storage for cubic splines: Vector of sorted vectors of sections; each inner vector represents a singl...
Definition: neurite_projector.h:376
virtual void set_geometry(SPIGeometry3d geometry)
Definition: neurite_projector.cpp:90
friend class boost::serialization::access
Definition: neurite_projector.h:404
NeuriteProjector()
Definition: neurite_projector.cpp:61
const std::vector< std::pair< number, number > > & quadrature_points() const
Definition: neurite_projector.cpp:270
std::vector< SomaBranchingRegion > & somata()
void project(Vertex *vrt)
project a vertex to its model position
Definition: neurite_projector.cpp:128
bool is_in_axial_range_around_soma_region(const SomaBranchingRegion &sr, size_t nid, Vertex *vrt) const
Definition: neurite_projector.cpp:1652
Adjusts vertex coordinates during refinement.
Definition: refinement_projector.h:55
virtual SPIGeometry3d geometry() const
Definition: refinement_projector.h:81
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
std::ostream & operator<<(std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
Definition: math_matrix.cpp:38
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
ugtypes::uint32_t uint32
Definition: types.h:116
double number
Definition: types.h:124
TNumber sq(TNumber val)
returns the square of a value (val*val)
Definition: math_util_impl.hpp:91
void CalculateCenter(vector_t ¢erOut, const vector_t *pointSet, size_t numPoints)
calculates the center of a point-set
Definition: math_util_impl.hpp:98
void VecSubtract(vector_t &vOut, const vector_t &v1, const vector_t &v2)
subtracts v2 from v1 and stores the result in a vOut
Definition: math_vector_functions_common_impl.hpp:226
void VecPow(vector_t &vOut, const vector_t &v1, typename vector_t::value_type s)
component-wise exponentiation of a vector
Definition: math_vector_functions_common_impl.hpp:239
DECLARE_ATTACHMENT_INFO_TRAITS(Attachment< bool >, "bool")
const number SMALL
Definition: math_constants.h:41
std::istream & operator>>(std::istream &in, NeuriteProjector::SurfaceParams &surfParams)
Definition: neurite_projector.cpp:1814
@ AT_GUI
Definition: boost_serialization.h:66
@ AT_DATA
Definition: boost_serialization.h:65
APosition aPosition("position", true)
The standard 3d position type.
Definition: common_attachments.h:84
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836
Provides custom information for different archives.
Definition: boost_serialization.h:71
Definition: neurite_projector.h:299
number end
Definition: neurite_projector.h:301
std::vector< Section >::const_iterator sec_start
Definition: neurite_projector.h:302
const SomaBranchingRegion * sr
Definition: neurite_projector.h:303
number start
Definition: neurite_projector.h:300
Definition: neurite_projector.h:150
void serialize(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:155
std::vector< BranchingRegion * > vRegions
Definition: neurite_projector.h:152
std::vector< uint32_t > vNid
Definition: neurite_projector.h:151
Definition: neurite_projector.h:108
void load(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:131
void save(Archive &ar, const unsigned int version) const
Definition: neurite_projector.h:120
number t
the axial parameter where other neurite(s) branch off
Definition: neurite_projector.h:114
BranchingRegion(number _t)
Definition: neurite_projector.h:110
BranchingRegion()
Definition: neurite_projector.h:109
SmartPtr< BranchingPoint > bp
pointer to whole branching point
Definition: neurite_projector.h:117
Definition: neurite_projector.h:292
bool operator()(const BranchingRegion &a, const BranchingRegion &b)
Definition: neurite_projector.h:293
Definition: neurite_projector.h:287
bool operator()(const Section &a, const Section &b)
Definition: neurite_projector.h:288
Definition: neurite_projector.h:308
bool operator()(const SomaBranchingRegion &a, const SomaBranchingRegion &b)
Definition: neurite_projector.h:309
Mapping of model to surface vertices.
Definition: neurite_projector.h:214
vector3 v2
start vertex of edge
Definition: neurite_projector.h:217
vector3 v1
TODO: Mapping should store unique indices of 1d vertices from SWC file.
Definition: neurite_projector.h:216
number lambda
end vertex of edge
Definition: neurite_projector.h:218
Definition: neurite_projector.h:222
vector3 refDir
Definition: neurite_projector.h:223
std::vector< BranchingRegion > vBR
Definition: neurite_projector.h:225
std::vector< Section > vSomaSec
Definition: neurite_projector.h:226
std::vector< Section > vSec
Definition: neurite_projector.h:224
void serialize(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:230
std::vector< SomaBranchingRegion > vSBR
Definition: neurite_projector.h:227
Definition: neurite_projector.h:80
number splineParamsZ[4]
Definition: neurite_projector.h:89
Section()
Definition: neurite_projector.h:81
number endParam
Definition: neurite_projector.h:85
number splineParamsX[4]
Definition: neurite_projector.h:87
void serialize(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:93
Section(number _endParam)
Definition: neurite_projector.h:82
number splineParamsY[4]
Definition: neurite_projector.h:88
number splineParamsR[4]
Definition: neurite_projector.h:90
Definition: neurite_projector.h:174
SomaBranchingRegion(const vector3 ¢er, number radius, number t)
Definition: neurite_projector.h:194
void serialize(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:182
void load(Archive &ar, const unsigned int version)
Definition: neurite_projector.h:188
vector3 center
Definition: neurite_projector.h:177
vector3 bp
Definition: neurite_projector.h:179
number radius
Definition: neurite_projector.h:176
SomaBranchingRegion()
Definition: neurite_projector.h:205
SmartPtr< SomaPoint > somaPt
Definition: neurite_projector.h:175
number t
Definition: neurite_projector.h:178
SomaBranchingRegion(number t)
Definition: neurite_projector.h:200
Definition: neurite_projector.h:168
SomaPoint(const vector3 &soma, number radius)
Definition: neurite_projector.h:171
number radius
Definition: neurite_projector.h:170
vector3 soma
Definition: neurite_projector.h:169
Definition: neurite_projector.h:264
float angular
Definition: neurite_projector.h:280
float axial
Definition: neurite_projector.h:279
float radial
Definition: neurite_projector.h:281
uint32 neuriteID
Neurite ID a vertex belongs to.
Definition: neurite_projector.h:278