diff --git a/arbor/cable_cell.cpp b/arbor/cable_cell.cpp index 462c5602bebc1e42ab44ccfe4a71e2adfb302be0..2ec43f27ac6d750d7e531de9282d7ba34b725a40 100644 --- a/arbor/cable_cell.cpp +++ b/arbor/cable_cell.cpp @@ -104,9 +104,13 @@ struct cable_cell_impl { } } - mlocation_list locations(const locset& l) const { + mlocation_list concrete_locset(const locset& l) const { return thingify(l, provider); } + + mcable_list concrete_region(const region& r) const { + return thingify(r, provider); + } }; using impl_ptr = std::unique_ptr<cable_cell_impl, void (*)(cable_cell_impl*)>; @@ -137,8 +141,12 @@ const mprovider& cable_cell::provider() const { return impl_->provider; } -mlocation_list cable_cell::locations(const locset& l) const { - return impl_->locations(l); +mlocation_list cable_cell::concrete_locset(const locset& l) const { + return impl_->concrete_locset(l); +} + +mcable_list cable_cell::concrete_region(const region& r) const { + return impl_->concrete_region(r); } const cable_cell_location_map& cable_cell::location_assignments() const { diff --git a/arbor/include/arbor/cable_cell.hpp b/arbor/include/arbor/cable_cell.hpp index e268062a58d0d358e47cc2906228ec5c59e102e5..1a7522920efc7590cbe774738dbba523206e475b 100644 --- a/arbor/include/arbor/cable_cell.hpp +++ b/arbor/include/arbor/cable_cell.hpp @@ -179,7 +179,10 @@ public: } // Access to a concrete list of locations for a locset. - mlocation_list locations(const locset&) const; + mlocation_list concrete_locset(const locset&) const; + + // Access to a concrete list of cable segments for a region. + mcable_list concrete_region(const region&) const; // Generic access to painted and placed items. const cable_cell_region_map& region_assignments() const; diff --git a/python/cells.cpp b/python/cells.cpp index 10d98efedbf369ae07d774f87f1370a2a825e22a..852b51a7138e118362c4c74953dbc3df10379230 100644 --- a/python/cells.cpp +++ b/python/cells.cpp @@ -527,8 +527,11 @@ void register_cells(pybind11::module& m) { "Add a voltage spike detector at each location in locations.") // Get locations associated with a locset label. .def("locations", - [](arb::cable_cell& c, const char* label) {return c.locations(label);}, + [](arb::cable_cell& c, const char* label) {return c.concrete_locset(label);}, "label"_a, "The locations of the cell morphology for a locset label.") + .def("region", + [](arb::cable_cell& c, const char* label) {return c.concrete_region(label);}, + "label"_a, "The cable segments of the cell morphology for a region label.") // Discretization control. .def("compartments_on_samples", [](arb::cable_cell& c) {c.default_parameters.discretization = arb::cv_policy_every_sample{};}, diff --git a/python/example/single_cell_swc.py b/python/example/single_cell_swc.py index 4cdbb9c4e967cf94326517f7dc4d76d7cc464a7e..993f6d987aef0ae5543e08133d346ab93483ed47 100644 --- a/python/example/single_cell_swc.py +++ b/python/example/single_cell_swc.py @@ -9,8 +9,8 @@ tree = arbor.load_swc('../../test/unit/swc/example.swc') # Define the regions and locsets in the model. defs = {'soma': '(tag 1)', # soma has tag 1 in swc files. - 'axon': '(tag 2)', # axon has tag 1 in swc files. - 'dend': '(tag 3)', # dendrites have tag 1 in swc files. + 'axon': '(tag 2)', # axon has tag 2 in swc files. + 'dend': '(tag 3)', # dendrites have tag 3 in swc files. 'root': '(root)', # the start of the soma in this morphology is at the root of the cell. 'stim_site': '(location 1 0.5)'} # site for the stimulus, in the middle of branch 1. labels = arbor.label_dict(defs) diff --git a/python/single_cell_model.cpp b/python/single_cell_model.cpp index 29d5df5d8b9e2b29796c26902aace1b8c7c4342c..249e0325e855b5d9253adb80579239ba70f3e190 100644 --- a/python/single_cell_model.cpp +++ b/python/single_cell_model.cpp @@ -169,7 +169,7 @@ public: throw pyarb_error( util::pprintf("sampling frequency is not greater than zero", what)); } - for (auto& l: cell_.locations(where)) { + for (auto& l: cell_.concrete_locset(where)) { probes_.push_back({l, frequency}); } }