Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rd-party/arbor
Submodule arbor updated 93 files
+3 −3 .github/workflows/test-docs.yaml
+0 −122 .gitlab/cscs-ci-default.yaml
+0 −32 .gitlab/docker/Dockerfile.app
+0 −50 .gitlab/docker/Dockerfile.base
+2 −2 .readthedocs.yml
+1 −1 CHANGELOG.md
+10 −8 CITATION.bib
+9 −3 CMakeLists.txt
+1 −1 VERSION
+1 −0 arbor/CMakeLists.txt
+3 −0 arbor/backends/event.hpp
+35 −55 arbor/backends/event_stream_base.hpp
+1 −1 arbor/backends/gpu/shared_state.cpp
+9 −6 arbor/backends/multicore/shared_state.cpp
+152 −118 arbor/communication/communicator.cpp
+18 −3 arbor/communication/communicator.hpp
+18 −50 arbor/domain_decomposition.cpp
+7 −2 arbor/fvm_layout.cpp
+1 −3 arbor/fvm_lowered_cell.hpp
+45 −77 arbor/fvm_lowered_cell_impl.hpp
+7 −1 arbor/include/arbor/arbexcept.hpp
+0 −3 arbor/include/arbor/common_types.hpp
+5 −9 arbor/include/arbor/domain_decomposition.hpp
+30 −48 arbor/include/arbor/event_generator.hpp
+1 −1 arbor/include/arbor/iexpr.hpp
+2 −1 arbor/include/arbor/morph/label_dict.hpp
+2 −7 arbor/include/arbor/morph/locset.hpp
+13 −18 arbor/include/arbor/recipe.hpp
+1 −0 arbor/include/arbor/util/visibility.hpp
+95 −154 arbor/label_resolution.cpp
+46 −50 arbor/label_resolution.hpp
+14 −34 arbor/morph/label_dict.cpp
+3 −2 arbor/morph/stitch.cpp
+15 −20 arbor/simulation.cpp
+2 −0 arbor/util/filter.hpp
+1 −3 arbor/util/iterutil.hpp
+1 −0 arbor/util/partition.hpp
+78 −0 arbor/util/smallvec.hpp
+21 −13 arborio/include/arborio/swcio.hpp
+93 −65 arborio/swcio.cpp
+0 −4 bors.toml
+1 −1 doc/concepts/cable_cell.rst
+65 −3 doc/concepts/interconnectivity.rst
+0 −14 doc/contrib/release.rst
+42 −0 doc/cpp/event_generators
+79 −0 doc/cpp/event_generators.rst
+5 −0 doc/cpp/index.rst
+2 −2 doc/cpp/interconnectivity.rst
+552 −0 doc/cpp/labels.rst
+5 −4 doc/cpp/morphology.rst
+20 −0 doc/cpp/spike_source_cell.rst
+27 −0 doc/fileformat/index.rst
+1 −1 doc/fileformat/nmodl.rst
+9 −2 doc/index.rst
+53 −0 doc/python/event_generators.rst
+2 −0 doc/python/index.rst
+49 −30 doc/python/labels.rst
+24 −11 doc/tutorial/brunel.rst
+6 −3 doc/tutorial/full-feature-diffusion.rst
+1 −1 doc/tutorial/network_two_cells_gap_junctions.rst
+3 −3 doc/tutorial/plasticity.rst
+1 −1 doc/tutorial/single_cell_cable.rst
+3 −3 doc/tutorial/single_cell_model.rst
+1 −0 example/CMakeLists.txt
+76 −62 example/brunel/brunel.cpp
+4 −0 example/busyring-tiled/CMakeLists.txt
+29 −0 example/busyring-tiled/complex-n-128-depth-10.json
+26 −0 example/busyring-tiled/init-only-2048-complex.json
+114 −0 example/busyring-tiled/parameters.hpp
+10 −0 example/busyring-tiled/readme.md
+413 −0 example/busyring-tiled/ring.cpp
+1 −1 example/busyring/complex-n-128-depth-10.json
+1 −3 example/ornstein_uhlenbeck/CMakeLists.txt
+3 −3 python/cable_cell_io.cpp
+2 −2 python/cells.cpp
+90 −42 python/label_dict.cpp
+63 −100 python/label_dict.hpp
+4 −6 python/morphology.cpp
+30 −1 python/recipe.cpp
+34 −35 python/recipe.hpp
+4 −4 python/single_cell_model.cpp
+1 −1 scripts/check-all-tags.sh
+19 −3 scripts/run_cpp_examples.sh
+14 −14 spack/package.py
+1 −0 test/ubench/CMakeLists.txt
+2 −0 test/unit-distributed/CMakeLists.txt
+1 −0 test/unit/CMakeLists.txt
+38 −6 test/unit/test_diffusion.cpp
+4 −4 test/unit/test_event_generators.cpp
+37 −42 test/unit/test_label_resolution.cpp
+8 −13 test/unit/test_merge_events.cpp
+99 −1 test/unit/test_recipe.cpp
+9 −4 test/unit/test_swcio.cpp
59 changes: 45 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.27)
find_package(Git)

project(the-arbor-gui
VERSION 0.11.1
VERSION 0.11.2
LANGUAGES C CXX)

set(EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -186,22 +186,53 @@ if(ARBORGUI_BUILD_BUNDLE)

set(ARBORGUI_ICON arbor.icns)
set(ARBORGUI_ICON_PATH ${CMAKE_SOURCE_DIR}/images/${ARBORGUI_ICON})
set_source_files_properties(${ARBORGUI_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

add_executable(arbor-gui MACOSX_BUNDLE ${ARBORGUI_ICON_PATH} ${gui_srcs} $<TARGET_OBJECTS:imgui>)
set_target_properties(arbor-gui PROPERTIES MACOSX_BUNDLE_ICONFILE ${ARBORGUI_ICON})
set(arbgui_resources)
set_source_files_properties(${CMAKE_SOURCE_DIR}/imgui.ini
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
list(APPEND arbgui_resources ${CMAKE_SOURCE_DIR}/imgui.ini)

file(GLOB_RECURSE shaders ${CMAKE_SOURCE_DIR}/glsl/*/*.glsl)
foreach(SHADER_FILE ${shaders})
list(APPEND arbgui_resources ${SHADER_FILE})
file(RELATIVE_PATH SHADER_REL ${CMAKE_SOURCE_DIR}/glsl ${SHADER_FILE})
get_filename_component(SHADER_DIR ${SHADER_REL} DIRECTORY)
set_source_files_properties(${SHADER_FILE}
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources/glsl/${SHADER_DIR})
endforeach()

file(GLOB_RECURSE fonts ${CMAKE_SOURCE_DIR}/fonts/*/*.ttf)
foreach(FONT_FILE ${fonts})
list(APPEND arbgui_resources ${FONT_FILE})
file(RELATIVE_PATH FONT_REL ${CMAKE_SOURCE_DIR}/fonts ${FONT_FILE})
get_filename_component(FONT_DIR ${FONT_REL} DIRECTORY)
set_source_files_properties(${FONT_FILE}
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources/fonts/${FONT_DIR})
endforeach()

set_source_files_properties(${CMAKE_SOURCE_DIR}/images/arbor.icns
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)

add_executable(arbor-gui MACOSX_BUNDLE ${gui_srcs} $<TARGET_OBJECTS:imgui> ${arbgui_resources} ${CMAKE_SOURCE_DIR}/images/arbor.icns)
set_target_properties(arbor-gui
PROPERTIES
BUNDLE True
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_ICONFILE ${ARBORGUI_ICON}
MACOSX_BUNDLE_INFO_STRING "A GUI for Arbor"
RESOURCE ${arbgui_resources})
target_compile_definitions(arbor-gui PUBLIC FMT_HEADER_ONLY)
target_include_directories(arbor-gui PRIVATE src ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(arbor-gui PRIVATE ${ARBORGUI_LIBS} arbor arborio glbinding glfw arbor-gui-deps)

install(TARGETS arbor-gui
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime)

install(FILES ${ARBORGUI_ICON_PATH} DESTINATION ${resource_path})
install(FILES default.ini DESTINATION ${resource_path} RENAME imgui.ini)
install(DIRECTORY glsl DESTINATION ${resource_path})
install(DIRECTORY fonts DESTINATION ${resource_path})
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime)

set(CPACK_BINARY_DRAGNDROP ON)
set(CPACK_GENERATOR "DragNDrop")
Expand Down Expand Up @@ -237,7 +268,7 @@ else()
endif()

# install resources
install(DIRECTORY glsl DESTINATION ${resource_path})
install(DIRECTORY fonts DESTINATION ${resource_path})
install(FILES default.ini DESTINATION ${resource_path} RENAME imgui.ini)
install(DIRECTORY glsl DESTINATION ${resource_path})
install(DIRECTORY fonts DESTINATION ${resource_path})
install(FILES imgui.ini DESTINATION ${resource_path})
endif()
File renamed without changes.
24 changes: 22 additions & 2 deletions src/loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,33 @@ loaded_morphology load_swc(const std::filesystem::path &fn,
}

loaded_morphology load_neuron_swc(const std::filesystem::path &fn) {
auto loaded = arborio::load_swc_neuron(fn);
arborio::swc_loader_options opts;
auto loaded = arborio::load_swc_neuron(fn, opts);
loaded_morphology res{.morph=loaded.morphology};
for (const auto& [k, v]: loaded.labels.regions()) res.regions.emplace_back(k, to_string(v));
for (const auto& [k, v]: loaded.labels.locsets()) res.locsets.emplace_back(k, to_string(v));
log_info("Loaded SWC (Neuron) {} branches {} ", loaded.segment_tree.size(), loaded.morphology.num_branches());
return res;
}

loaded_morphology load_cnic_swc(const std::filesystem::path &fn) {
arborio::swc_loader_options opts {.allow_non_monotonic_ids=true,
.allow_mismatched_tags=true,
.tags={{0, "undefined"},
{1, "soma"}, {2, "axon"}, {3, "dend"}, {4, "apic"},
{5, "fork point"},
{6, "end point"}}
};

auto loaded = arborio::load_swc_neuron(fn, opts);
loaded_morphology res{.morph=loaded.morphology};
for (const auto& [k, v]: loaded.labels.regions()) res.regions.emplace_back(k, to_string(v));
for (const auto& [k, v]: loaded.labels.locsets()) res.locsets.emplace_back(k, to_string(v));
log_info("Loaded SWC (Neuron) {} branches {} ", loaded.segment_tree.size(), loaded.morphology.num_branches());
return res;
}


loaded_morphology load_arbor_swc(const std::filesystem::path &fn) {
auto loaded = arborio::load_swc_arbor(fn);
loaded_morphology res{.morph=loaded.morphology};
Expand Down Expand Up @@ -78,7 +97,8 @@ static std::unordered_map<std::string,
std::unordered_map<std::string,
std::function<loaded_morphology(const std::filesystem::path &fn)>>>
loaders{{".swc", {{"Arbor", load_arbor_swc},
{"Neuron", load_neuron_swc}}},
{"Neuron", load_neuron_swc},
{"CNIC", load_cnic_swc}}},
{".nml", {{"Cell", load_neuroml_cell},
{"Morph", load_neuroml_morph}}},
{".asc", {{"Default", load_asc}}}};
Expand Down
2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ std::filesystem::path get_resource_path(const std::filesystem::path& fn) {
CFURLRef appUrlRef = CFBundleCopyBundleURL( CFBundleGetMainBundle() );
CFStringRef macPath = CFURLCopyFileSystemPath( appUrlRef, kCFURLPOSIXPathStyle );
CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
const char* path = CFStringGetCStringPtr(macPath, encodingMethod);
auto path = std::string(CFStringGetCStringPtr(macPath, encodingMethod));
CFRelease(appUrlRef);
CFRelease(macPath);
return std::filesystem::path{path} / "Contents/Resources" / fn;
Expand Down