BioDynaMo  v1.05.159-3be850bb
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:
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_
Definition: cell.h:40
Real3 OriginOf(const AgentUid &daughter_uid) const override
Definition: neuron_soma.cc:105
void RemoveDaughter(const AgentPointer< NeuriteElement > &daughter) override
Definition: neuron_soma.cc:98
NeuriteElement * ExtendNewNeurite(const Real3 &direction, NeuriteElement *prototype=nullptr)
Extend a new neurite from this soma.
Definition: neuron_soma.cc:77
NeuronSoma(const NeuronSoma &other)
Definition: neuron_soma.h:39
void CriticalRegion(std::vector< AgentPointer<>> *aptrs) override
Definition: neuron_soma.cc:69
void PrintSWC(std::ostream &out) const
Exports the soma and the attached neurite elements to the SWC file format.
Definition: neuron_soma.cc:147
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
void UpdateRelative(const NeuronOrNeurite &old_rel, const NeuronOrNeurite &new_rel) override
Definition: neuron_soma.cc:121
Spinlock * GetLock() override
Definition: neuron_soma.h:62
std::unordered_map< AgentUid, Real3 > daughters_coord_
Definition: neuron_soma.h:128
const std::vector< AgentPointer< NeuriteElement > > & GetDaughters() const
Definition: neuron_soma.cc:136
const AgentUid & GetUid() const override
Definition: neuron_soma.h:60
BDM_AGENT_HEADER(NeuronSoma, Cell, 1)
void UpdateDependentPhysicalVariables() override
Definition: neuron_soma.cc:119
std::vector< AgentPointer< NeuriteElement > > daughters_
Definition: neuron_soma.h:123
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
Definition: agent.cc:39
double real_t
Definition: real_t.h:21