BioDynaMo  v1.05.120-25dc9790
neuron_soma.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef NEUROSCIENCE_NEURON_SOMA_H_
16 #define NEUROSCIENCE_NEURON_SOMA_H_
17 
18 #include <unordered_map>
19 #include <vector>
20 
21 #include "core/agent/cell.h"
24 
25 namespace bdm {
26 namespace neuroscience {
27 
28 class NeuriteElement;
29 
30 class NeuronSoma : public Cell, public NeuronOrNeurite {
32 
33  public:
34  NeuronSoma();
35  ~NeuronSoma() override;
36 
37  explicit NeuronSoma(const Real3& position);
38 
39  NeuronSoma(const NeuronSoma& other)
40  : Base(other),
41  daughters_(other.daughters_),
43 
51  void Initialize(const NewAgentEvent& event) override;
52 
58  void Update(const NewAgentEvent& event) override;
59 
60  const AgentUid& GetUid() const override { return Base::GetUid(); }
61 
62  Spinlock* GetLock() override { return Base::GetLock(); }
63 
64  void CriticalRegion(std::vector<AgentPointer<>>* aptrs) override;
65 
66  // ***************************************************************************
67  // METHODS FOR NEURON TREE STRUCTURE *
68  // ***************************************************************************
69 
74  NeuriteElement* ExtendNewNeurite(const Real3& direction,
75  NeuriteElement* prototype = nullptr);
76 
80  NeuriteElement* ExtendNewNeurite(real_t diameter, real_t phi, real_t theta,
81  NeuriteElement* prototype = nullptr);
82 
83  void RemoveDaughter(const AgentPointer<NeuriteElement>& daughter) override;
84 
89  Real3 OriginOf(const AgentUid& daughter_uid) const override;
90 
91  void UpdateDependentPhysicalVariables() override;
92 
93  void UpdateRelative(const NeuronOrNeurite& old_rel,
94  const NeuronOrNeurite& new_rel) override;
95 
96  const std::vector<AgentPointer<NeuriteElement>>& GetDaughters() const;
97 
120  void PrintSWC(std::ostream& out) const;
121 
122  protected:
123  std::vector<AgentPointer<NeuriteElement>> daughters_;
124 
128  std::unordered_map<AgentUid, Real3> daughters_coord_;
129 };
130 
131 } // namespace neuroscience
132 } // namespace bdm
133 
134 #endif // NEUROSCIENCE_NEURON_SOMA_H_
bdm::neuroscience::NeuronSoma::GetLock
Spinlock * GetLock() override
Definition: neuron_soma.h:62
bdm::NewAgentEvent
Definition: new_agent_event.h:61
bdm::neuroscience::NeuronSoma::daughters_coord_
std::unordered_map< AgentUid, Real3 > daughters_coord_
Definition: neuron_soma.h:128
bdm
Definition: agent.cc:39
bdm::neuroscience::NeuronSoma::Update
void Update(const NewAgentEvent &event) override
This method is used to update attributes after a cell division. or new neurite branching event.
Definition: neuron_soma.cc:49
bdm::AgentPointer
Definition: agent_pointer.h:58
bdm::neuroscience::NeuronSoma::Initialize
void Initialize(const NewAgentEvent &event) override
This method is used to initialise the values of daughter 2 for a cell division event.
Definition: neuron_soma.cc:35
bdm::real_t
double real_t
Definition: real_t.h:21
bdm::neuroscience::NeuronSoma::BDM_AGENT_HEADER
BDM_AGENT_HEADER(NeuronSoma, Cell, 1)
neuron_or_neurite.h
bdm::neuroscience::NeuronSoma::NeuronSoma
NeuronSoma()
bdm::neuroscience::NeuronSoma::NeuronSoma
NeuronSoma(const NeuronSoma &other)
Definition: neuron_soma.h:39
bdm::neuroscience::NeuronSoma
Definition: neuron_soma.h:30
bdm::neuroscience::NeuronSoma::PrintSWC
void PrintSWC(std::ostream &out) const
Exports the soma and the attached neurite elements to the SWC file format.
Definition: neuron_soma.cc:147
bdm::neuroscience::NeuronSoma::UpdateDependentPhysicalVariables
void UpdateDependentPhysicalVariables() override
Definition: neuron_soma.cc:119
bdm::neuroscience::NeuronOrNeurite
Definition: neuron_or_neurite.h:42
bdm::Spinlock
Definition: spinlock.h:22
math_array.h
bdm::Cell
Definition: cell.h:40
bdm::neuroscience::NeuronSoma::daughters_
std::vector< AgentPointer< NeuriteElement > > daughters_
Definition: neuron_soma.h:123
bdm::neuroscience::NeuronSoma::CriticalRegion
void CriticalRegion(std::vector< AgentPointer<>> *aptrs) override
Definition: neuron_soma.cc:69
bdm::neuroscience::NeuronSoma::UpdateRelative
void UpdateRelative(const NeuronOrNeurite &old_rel, const NeuronOrNeurite &new_rel) override
Definition: neuron_soma.cc:121
bdm::neuroscience::NeuronSoma::GetUid
const AgentUid & GetUid() const override
Definition: neuron_soma.h:60
bdm::AgentUid
Definition: agent_uid.h:25
bdm::neuroscience::NeuronSoma::GetDaughters
const std::vector< AgentPointer< NeuriteElement > > & GetDaughters() const
Definition: neuron_soma.cc:136
bdm::neuroscience::NeuronSoma::OriginOf
Real3 OriginOf(const AgentUid &daughter_uid) const override
Definition: neuron_soma.cc:105
bdm::neuroscience::NeuronSoma::~NeuronSoma
~NeuronSoma() override
bdm::MathArray
Definition: math_array.h:36
cell.h
bdm::neuroscience::NeuronSoma::RemoveDaughter
void RemoveDaughter(const AgentPointer< NeuriteElement > &daughter) override
Definition: neuron_soma.cc:98
bdm::neuroscience::NeuronSoma::ExtendNewNeurite
NeuriteElement * ExtendNewNeurite(const Real3 &direction, NeuriteElement *prototype=nullptr)
Extend a new neurite from this soma.
Definition: neuron_soma.cc:77
bdm::neuroscience::NeuriteElement
Definition: neurite_element.h:56