BioDynaMo  v1.05.119-a4ff3934
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
bdm::neuroscience::NeuronSoma Class Reference

#include <neuron_soma.h>

Inheritance diagram for bdm::neuroscience::NeuronSoma:
[legend]
Collaboration diagram for bdm::neuroscience::NeuronSoma:
[legend]

Public Member Functions

 NeuronSoma ()
 
 ~NeuronSoma () override
 
 NeuronSoma (const Real3 &position)
 
 NeuronSoma (const NeuronSoma &other)
 
void Initialize (const NewAgentEvent &event) override
 This method is used to initialise the values of daughter 2 for a cell division event. More...
 
void Update (const NewAgentEvent &event) override
 This method is used to update attributes after a cell division. or new neurite branching event. More...
 
const AgentUidGetUid () const override
 
SpinlockGetLock () override
 
void CriticalRegion (std::vector< AgentPointer<>> *aptrs) override
 
NeuriteElementExtendNewNeurite (const Real3 &direction, NeuriteElement *prototype=nullptr)
 Extend a new neurite from this soma. More...
 
NeuriteElementExtendNewNeurite (real_t diameter, real_t phi, real_t theta, NeuriteElement *prototype=nullptr)
 Extend a new neurite from this soma. More...
 
void RemoveDaughter (const AgentPointer< NeuriteElement > &daughter) override
 
Real3 OriginOf (const AgentUid &daughter_uid) const override
 
void UpdateDependentPhysicalVariables () override
 
void UpdateRelative (const NeuronOrNeurite &old_rel, const NeuronOrNeurite &new_rel) override
 
const std::vector< AgentPointer< NeuriteElement > > & GetDaughters () const
 
void PrintSWC (std::ostream &out) const
 Exports the soma and the attached neurite elements to the SWC file format. More...
 
- Public Member Functions inherited from bdm::Cell
 Cell ()
 
 Cell (real_t diameter)
 
 Cell (const Real3 &position)
 
 ~Cell () override=default
 
Shape GetShape () const override
 
virtual CellDivide ()
 Divide this cell. More...
 
virtual CellDivide (real_t volume_ratio)
 Divide this cell. More...
 
virtual CellDivide (const Real3 &axis)
 Divide this cell. More...
 
virtual CellDivide (real_t volume_ratio, const Real3 &axis)
 Divide this cell. More...
 
virtual CellDivide (real_t volume_ratio, real_t phi, real_t theta)
 Divide this cell. More...
 
real_t GetAdherence () const
 
real_t GetDiameter () const override
 
real_t GetMass () const
 
real_t GetDensity () const
 
const Real3GetPosition () const override
 
const Real3GetTractorForce () const
 
real_t GetVolume () const
 
void SetAdherence (real_t adherence)
 
void SetDiameter (real_t diameter) override
 
void SetVolume (real_t volume)
 
void SetMass (real_t mass)
 
void SetDensity (real_t density)
 
void SetPosition (const Real3 &position) override
 
void SetTractorForce (const Real3 &tractor_force)
 
void ChangeVolume (real_t speed)
 
void UpdateDiameter ()
 
void UpdateVolume ()
 
void UpdatePosition (const Real3 &delta)
 
Real3 CalculateDisplacement (const InteractionForce *force, real_t squared_radius, real_t dt) override
 
void ApplyDisplacement (const Real3 &displacement) override
 
void MovePointMass (const Real3 &normalized_dir, real_t speed)
 
- Public Member Functions inherited from bdm::Agent
 Agent ()
 
 Agent (TRootIOCtor *io_ctor)
 
 Agent (const Agent &other)
 
virtual ~Agent ()
 
virtual AgentNew () const =0
 Create a new instance of this object using the default constructor. More...
 
virtual AgentNewCopy () const =0
 Create a copy of this object. More...
 
void CreateNewAgents (const NewAgentEvent &event, const std::initializer_list< Agent * > &prototypes)
 
virtual const char * GetTypeName () const
 
virtual std::set< std::string > GetRequiredVisDataMembers () const
 
virtual void RunDiscretization ()
 
void AssignNewUid ()
 
const AgentUidGetUid () const
 
SpinlockGetLock ()
 
uint32_t GetBoxIdx () const
 
void SetBoxIdx (uint32_t idx)
 
void SetStaticnessNextTimestep (bool value) const
 
bool GetPropagateStaticness () const
 
void SetPropagateStaticness (bool value=true)
 
void PropagateStaticness (bool beginning=false)
 
void UpdateStaticness ()
 
bool IsStatic () const
 
template<typename TAgent = Agent>
AgentPointer< TAgent > GetAgentPtr () const
 Return agent pointer. More...
 
void AddBehavior (Behavior *behavior)
 Add a behavior to this agent. More...
 
void RemoveBehavior (const Behavior *behavior)
 
void RunBehaviors ()
 Execute all behaviorsq. More...
 
const InlineVector< Behavior *, 2 > & GetAllBehaviors () const
 Return all behaviors. More...
 
virtual void RemoveFromSimulation ()
 
void * operator new (size_t size)
 
void operator delete (void *p)
 
- Public Member Functions inherited from bdm::neuroscience::NeuronOrNeurite
virtual ~NeuronOrNeurite ()
 
AgentPointer< NeuronOrNeuriteGetNeuronOrNeuriteAgentPtr () const
 
virtual StructureIdentifierSWC GetIdentifierSWC () const
 Returns the SWC classification of the object. More...
 
bool IsNeuronSoma () const
 
bool IsNeuriteElement () const
 

Protected Attributes

std::vector< AgentPointer< NeuriteElement > > daughters_
 
std::unordered_map< AgentUid, Real3daughters_coord_
 
- Protected Attributes inherited from bdm::Agent
AgentUid uid_
 unique id More...
 
uint32_t box_idx_ = std::numeric_limits<uint32_t>::max()
 Grid box index. More...
 
InlineVector< Behavior *, 2 > behaviors_
 collection of behaviors which define the internal behavior More...
 

Private Member Functions

 BDM_AGENT_HEADER (NeuronSoma, Cell, 1)
 

Additional Inherited Members

- Static Public Attributes inherited from bdm::Cell
static const Real3 kXAxis = {1.0, 0.0, 0.0}
 First axis of the local coordinate system. More...
 
static const Real3 kYAxis = {0.0, 1.0, 0.0}
 Second axis of the local coordinate system. More...
 
static const Real3 kZAxis = {0.0, 0.0, 1.0}
 Third axis of the local coordinate system. More...
 
- Protected Member Functions inherited from bdm::Cell
Real3 TransformCoordinatesGlobalToPolar (const Real3 &coord) const
 
- Protected Member Functions inherited from bdm::Agent
template<typename TFrom , typename TTo >
std::enable_if< std::is_base_of< TFrom, TTo >::value, TTo * >::type Cast (TFrom *agent) const
 
template<typename TFrom , typename TTo >
std::enable_if<!std::is_base_of< TFrom, TTo >::value, TTo * >::type Cast (TFrom *agent) const
 

Detailed Description

Definition at line 30 of file neuron_soma.h.

Constructor & Destructor Documentation

◆ NeuronSoma() [1/3]

bdm::neuroscience::NeuronSoma::NeuronSoma ( )
default

◆ ~NeuronSoma()

bdm::neuroscience::NeuronSoma::~NeuronSoma ( )
overridedefault

◆ NeuronSoma() [2/3]

bdm::neuroscience::NeuronSoma::NeuronSoma ( const Real3 position)
explicit

Definition at line 33 of file neuron_soma.cc.

◆ NeuronSoma() [3/3]

bdm::neuroscience::NeuronSoma::NeuronSoma ( const NeuronSoma other)
inline

Definition at line 39 of file neuron_soma.h.

Member Function Documentation

◆ BDM_AGENT_HEADER()

bdm::neuroscience::NeuronSoma::BDM_AGENT_HEADER ( NeuronSoma  ,
Cell  ,
 
)
private

◆ CriticalRegion()

void bdm::neuroscience::NeuronSoma::CriticalRegion ( std::vector< AgentPointer<>> *  aptrs)
overridevirtual

If the thread-safety mechanism is set to user-specified this function will be called before the operations are executed for this agent.
Subclasses define the critical region by adding the AgentPointers of all agents that must not be processed in parallel.
Don't forget to add the current agent.
Here an example from NeuronSoma.

void NeuronSoma::CriticalRegion(std::vector<AgentPointer<>>* aptrs) {
  aptrs->reserve(daughters_.size() + 1);
  aptrs->push_back(Agent::GetAgentPtr<>());
  for (auto& daughter : daughters_) {
    aptrs->push_back(daughter);
  }
}
See also
Param::thread_safety_mechanism
AgentPointer
NeuronSoma::CriticalRegion

Reimplemented from bdm::Agent.

Definition at line 69 of file neuron_soma.cc.

◆ ExtendNewNeurite() [1/2]

NeuriteElement * bdm::neuroscience::NeuronSoma::ExtendNewNeurite ( const Real3 direction,
NeuriteElement prototype = nullptr 
)

Extend a new neurite from this soma.

Uses default diameter for new neurite

See also
NewNeuriteExtensionEvent

Definition at line 77 of file neuron_soma.cc.

◆ ExtendNewNeurite() [2/2]

NeuriteElement * bdm::neuroscience::NeuronSoma::ExtendNewNeurite ( real_t  diameter,
real_t  phi,
real_t  theta,
NeuriteElement prototype = nullptr 
)

Extend a new neurite from this soma.

See also
NewNeuriteExtensionEvent

Definition at line 86 of file neuron_soma.cc.

◆ GetDaughters()

const std::vector< AgentPointer< NeuriteElement > > & bdm::neuroscience::NeuronSoma::GetDaughters ( ) const

Definition at line 136 of file neuron_soma.cc.

◆ GetLock()

Spinlock* bdm::neuroscience::NeuronSoma::GetLock ( )
inlineoverridevirtual

Implements bdm::neuroscience::NeuronOrNeurite.

Definition at line 62 of file neuron_soma.h.

◆ GetUid()

const AgentUid& bdm::neuroscience::NeuronSoma::GetUid ( ) const
inlineoverridevirtual

Implements bdm::neuroscience::NeuronOrNeurite.

Definition at line 60 of file neuron_soma.h.

◆ Initialize()

void bdm::neuroscience::NeuronSoma::Initialize ( const NewAgentEvent event)
overridevirtual

This method is used to initialise the values of daughter 2 for a cell division event.

Please note that this implementation does not allow division of neuron somas with already attached neurite elements.

See also
CellDivisionEvent

Reimplemented from bdm::Cell.

Definition at line 35 of file neuron_soma.cc.

◆ OriginOf()

Real3 bdm::neuroscience::NeuronSoma::OriginOf ( const AgentUid daughter_uid) const
overridevirtual

Returns the absolute coordinates of the location where the daughter is attached.

Parameters
daughter_element_idxelement_idx of the daughter
Returns
the coord

Implements bdm::neuroscience::NeuronOrNeurite.

Definition at line 105 of file neuron_soma.cc.

◆ PrintSWC()

void bdm::neuroscience::NeuronSoma::PrintSWC ( std::ostream &  out) const

Exports the soma and the attached neurite elements to the SWC file format.

Exports neuron as an SWC file following the conventions of neuromorpho.org. Unfortunately, the file format is not defined without ambiguities in the scientific community. The export follows the following convention: for each element, we export a line containing the information <element id> <type id> <pos x> <pos y> <pos z> <radius> <prev element id>. The <prev element id> resembles the connectivity of the neuron.

Usage:

std::ofstream myfile;
myfile.open(simulation.GetOutputDir() + "/neuron.swc");
soma->PrintSWC(myfile);
See also
pyramidal_cell.h example. Exports can be visualized with various tools, for instance https://neuroinformatics.nl/HBP/morphology-viewer/#, although we recommend the built-in ParaView visualization for this case. SWC files can be used to extract meaningful descriptive features of the morphology with third party software packages.

Definition at line 147 of file neuron_soma.cc.

◆ RemoveDaughter()

void bdm::neuroscience::NeuronSoma::RemoveDaughter ( const AgentPointer< NeuriteElement > &  daughter)
overridevirtual

Implements bdm::neuroscience::NeuronOrNeurite.

Definition at line 98 of file neuron_soma.cc.

◆ Update()

void bdm::neuroscience::NeuronSoma::Update ( const NewAgentEvent event)
overridevirtual

This method is used to update attributes after a cell division. or new neurite branching event.

Performs the transition mother to daughter 1

See also
Event, CellDivisionEvent

Reimplemented from bdm::Agent.

Definition at line 49 of file neuron_soma.cc.

◆ UpdateDependentPhysicalVariables()

void bdm::neuroscience::NeuronSoma::UpdateDependentPhysicalVariables ( )
overridevirtual

Implements bdm::neuroscience::NeuronOrNeurite.

Definition at line 119 of file neuron_soma.cc.

◆ UpdateRelative()

void bdm::neuroscience::NeuronSoma::UpdateRelative ( const NeuronOrNeurite old_rel,
const NeuronOrNeurite new_rel 
)
overridevirtual

Implements bdm::neuroscience::NeuronOrNeurite.

Definition at line 121 of file neuron_soma.cc.

Member Data Documentation

◆ daughters_

std::vector<AgentPointer<NeuriteElement> > bdm::neuroscience::NeuronSoma::daughters_
protected

Definition at line 123 of file neuron_soma.h.

◆ daughters_coord_

std::unordered_map<AgentUid, Real3> bdm::neuroscience::NeuronSoma::daughters_coord_
protected

Daughter attachment points in local coordinates Key: neurite segment uid Value: position

Definition at line 128 of file neuron_soma.h.


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