Skip to content

Commit

Permalink
Merge pull request #379 from favreau/master
Browse files Browse the repository at this point in the history
Fixed nonSimulatedNodes param in neuron reports
  • Loading branch information
favreau authored Jun 25, 2024
2 parents 45b2e62 + be81398 commit 2ed4d80
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bioexplorer/backend/science/morphologies/Neurons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void Neurons::_buildModel(const LoaderProgress& callback)
std::string sqlNodeFilter = _details.sqlNodeFilter;

// Neurons
const auto somas = connector.getNeurons(_details.populationName, sqlNodeFilter);
auto somas = connector.getNeurons(_details.populationName, sqlNodeFilter);

// Report parameters
float* voltages = nullptr;
Expand All @@ -210,6 +210,18 @@ void Neurons::_buildModel(const LoaderProgress& callback)
_attachSimulationReport(*model, somas.size());
voltages = static_cast<float*>(
model->getSimulationHandler()->getFrameData(_neuronsReportParameters.initialSimulationFrame));
if (!_neuronsReportParameters.loadNonSimulatedNodes)
{
auto it = somas.begin();
while (it != somas.end())
{
const auto itg = _simulationReport.guids.find((*it).first);
if (itg == _simulationReport.guids.end())
it = somas.erase(it);
else
++it;
}
}
}

if (somas.empty())
Expand Down Expand Up @@ -374,8 +386,6 @@ void Neurons::_buildSomasOnly(Model& model, ThreadSafeContainer& container, cons
else
{
const auto it = _simulationReport.guids.find(neuronId);
if (it == _simulationReport.guids.end() && !_neuronsReportParameters.loadNonSimulatedNodes)
continue; // Ignore non-simulated nodes
somaUserData = (*it).second;
}
break;
Expand Down Expand Up @@ -550,8 +560,6 @@ void Neurons::_buildMorphology(ThreadSafeContainer& container, const uint64_t ne
else
{
const auto it = _simulationReport.guids.find(neuronId);
if (it == _simulationReport.guids.end() && !_neuronsReportParameters.loadNonSimulatedNodes)
return; // Ignore non-simulated nodes
somaUserData = (*it).second + 1;
}
break;
Expand Down

0 comments on commit 2ed4d80

Please sign in to comment.