本文整理汇总了C++中Experiment::targets方法的典型用法代码示例。如果您正苦于以下问题:C++ Experiment::targets方法的具体用法?C++ Experiment::targets怎么用?C++ Experiment::targets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Experiment
的用法示例。
在下文中一共展示了Experiment::targets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char* argv[])
{
/*
* Build 48 Index with Links
*/
// Load Circuit
Experiment experiment;
experiment.open(blue_config_filename);
Microcircuit & microcircuit = experiment.microcircuit();
const Targets & targets = experiment.targets();
const Cell_Target target = targets.cell_target("Column");
microcircuit.load(target, NEURONS | MORPHOLOGIES);
//Make Neuron Rtrees
ISpatialIndex *neuronTrees[MORPHOLOGIES_COUNT];
string *morphologyLabels[MORPHOLOGIES_COUNT];
int cm=0;
Morphologies & myMorphologies = microcircuit.morphologies();
Morphologies::iterator myMorphologiesEnd = myMorphologies.end();
for (Morphologies::iterator i = myMorphologies.begin(); i != myMorphologiesEnd; ++i)
{
morphologyLabels[cm] = i->label();
neuronTrees[cm] = RTree::createNewRTree (createNewMemoryStorageManager(), 0.7, 127, 127, 3,RTree::RV_RSTAR,indexIdentifier);
cm++;
}
Neurons & myNeurons = microcircuit.neurons();
Neurons::iterator myNeuronsEnd = myNeurons.end();
for (Neurons::iterator i = myNeurons.begin(); i != myNeuronsEnd; ++i)
{
cm=0;
for (cm=0;cm<MORPHOLOGIES_COUNT;cm++)
if (strcmp(i->morphology().label(),morphologyLabels[cm])==0) break;
Transform_3D<Micron> trafo = i->global_transform();
Sections mySections = i->morphology().all_sections();
Sections::iterator mySectionsEnd = mySections.end();
for (Sections::iterator s = mySections.begin(); s != mySectionsEnd; ++s)
{
Segments segments = s->segments();
Segments::const_iterator segments_end = segments.end();
for (Segments::const_iterator j = segments.begin(); j != segments_end ; ++j)
{
vect plow, phigh;
get_segment_mbr (*j, trafo, &plow, &phigh);
SpatialIndex::Region mbr = SpatialIndex::Region(plow.data(),phigh.data(),3);
std::stringstream strStream;
strStream << i->gid() <<"-"<< s->id()<< "-" << j->id();
neuronTrees[cm]->insertData (strStream.str().length(), (byte*)(strStream.str().c_str()), mbr, segmentid);
}
}
}
// Make Morphology Rtrees
Morphologies & myMorphologies = microcircuit.morphologies();
Morphologies::iterator myMorphologiesEnd = myMorphologies.end();
for (Morphologies::iterator i = myMorphologies.begin(); i != myMorphologiesEnd; ++i)
{
cout << "Indexing Morphology: " << i->label();
string baseName = i->label();
IStorageManager* diskfile = StorageManager::createNewDiskStorageManager(baseName, 4096);
ISpatialIndex *tree = RTree::createNewRTree (*diskfile, 0.7, 127, 127, 3,RTree::RV_RSTAR,indexIdentifier);
indexIdentifier++; segmentid=0;
Sections mySections = i->all_sections();
Sections::iterator mySectionsEnd = mySections.end();
for (Sections::iterator s = mySections.begin(); s != mySectionsEnd; ++s)
{
Segments segments = s->segments();
Segments::const_iterator segments_end = segments.end();
for (Segments::const_iterator j = segments.begin(); j != segments_end ; ++j)
{
Box<bbp::Micron> Mbr = AABBCylinder::calculateAABBForCylinder(j->begin().center(),
j->begin().radius(),j->end().center(),j->begin().radius());
vect plow, phigh;
plow[0] = Mbr.center().x() - Mbr.dimensions().x() / 2;
phigh[0] = Mbr.center().x() + Mbr.dimensions().x() / 2;
plow[1] = Mbr.center().y() - Mbr.dimensions().y() / 2;
phigh[1] = Mbr.center().y() + Mbr.dimensions().y() / 2;
plow[2] = Mbr.center().z() - Mbr.dimensions().z() / 2;
phigh[2] = Mbr.center().z() + Mbr.dimensions().z() / 2;
SpatialIndex::Region mbr = SpatialIndex::Region(plow.data(),phigh.data(),3);
std::stringstream strStream;
strStream << s->id()<< "-" << j->id();
tree->insertData (strStream.str().length(), (byte*)(strStream.str().c_str()), mbr, segmentid);
segmentid++;
}
}
cout << ".. Total Segments: " << segmentid << "\n";
tree->~ISpatialIndex();
//.........这里部分代码省略.........
示例2: main
int main(int argc, const char* argv[])
{
const URI blue_config_filename(argv[1]);
try {
// LOADING CURCUIT
Experiment experiment;
experiment.open(blue_config_filename);
Microcircuit & microcircuit = experiment.microcircuit();
const Targets & targets = experiment.targets();
const Cell_Target target = targets.cell_target("Column");
microcircuit.load(target, NEURONS | MORPHOLOGIES);
// PRELOAD the Trees amd Neuron Morphology Mapping
ISpatialIndex *trees[MORPHOLOGIES_COUNT];
ISpatialIndex *neurons[NEURONS_COUNT];
global_transformer *transforms[NEURONS_COUNT];
int cm=0;
int cn=0;
string baseName = "";
Morphologies & myMorphologies = microcircuit.morphologies();
Neurons & myNeurons = microcircuit.neurons();
cout << "PreLoading Mappings \n";
Morphologies::iterator myMorphologiesEnd = myMorphologies.end();
for (Morphologies::iterator m = myMorphologies.begin(); m != myMorphologiesEnd; ++m)
{
baseName = m->label();
IStorageManager* diskfile = StorageManager::loadDiskStorageManager(baseName);
trees[cm] = RTree::loadRTree(*diskfile, 1);
std::cout << "Checking R-tree structure... ";
if (!trees[cm]->isIndexValid()) std::cerr << "R-tree internal checks failed!\n"; else std::cout << "OK\n";
IStatistics * tree_stats;
trees[cm]->getStatistics (&tree_stats);
cout << *tree_stats;
Neurons::iterator myNeuronsEnd = myNeurons.end();
for (Neurons::iterator n = myNeurons.begin(); n != myNeuronsEnd; ++n)
{
if (strcmp(n->morphology().label().c_str(),m->label().c_str())==0)
{
transforms[cn] = n->global_transform().inverse();
neurons[cn] = trees[cm];
}
cn++;
if (cn>=NEURONS_COUNT) break;
}
cn=0;cm++;
}
/*
// SINGLE QUERY
cout << "Start Querying \n";
range_query_visitor visitor;
SpatialIndex::Region query;
micron_vector plow,phigh;
plow[0] = 0; plow[1] = 0; plow[2] = 0;
phigh[0]=90; phigh[1]=90; phigh[2]=90;
for (int i=0;i<NEURONS_COUNT;i++)
{
get_transformed_cube_mbr(plow,phigh,*transforms[i],&query);
neurons[i]->intersectsWithQuery(query,visitor);
visitor.inc_neuron();
}
visitor.print_stats();
*/
// PERFORMANCE EVALUATION RANDOM RANGE QUERIES
{
cout << "Start Range Query Analysis \n";
range_query_visitor visitor;
double plow[3],phigh[3];
plow[0] = 98.2538; plow[1] = 1005.14; plow[2] = 92.9046;
phigh[0] = 452.301; phigh[1] = 1385.56; phigh[2] = 456.743;
//plow[0] = -1698.38; plow[1] = -1065.03; plow[2] = -1724.75;
// phigh[0] = 2248.56; phigh[1]= 1894.28; phigh[2]= 2276.71;
SpatialIndex::Region query_region = SpatialIndex::Region(plow,phigh,3);
boost::mt11213b generator (42u);
const double x[3] = {0.0, 0.0, 0.0};
SpatialIndex::Point rnd_point1 (x, query_region.m_dimension);
SpatialIndex::Point rnd_point2 (x, query_region.m_dimension);
SpatialIndex::Region query;
for (int j=0;j<QUERIES_FOR_ANALYSIS;j++)
{
for (size_t i = 0; i < query_region.m_dimension; i++)
{
boost::uniform_real<> uni_dist (query_region.m_pLow[i],query_region.m_pHigh[i]);
boost::variate_generator<boost::mt11213b &,boost::uniform_real<> > uni(generator, uni_dist);
rnd_point1.m_pCoords[i] = uni();
boost::uniform_real<> uni_dist1 (rnd_point1.m_pCoords[i],query_region.m_pHigh[i]);
boost::variate_generator<boost::mt11213b &,boost::uniform_real<> > uni1(generator, uni_dist1);
rnd_point2.m_pCoords[i] = uni1();
}
visitor.new_query();
visitor.reset_neuron();
for (int i=0;i<NEURONS_COUNT;i++)
//.........这里部分代码省略.........