Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify loading of Standard Morphology Files. #2218

Merged
merged 19 commits into from
Mar 5, 2024

Conversation

thorstenhater
Copy link
Contributor

@thorstenhater thorstenhater commented Sep 11, 2023

All morphology loaders now return a loaded_morphology object comprising

  • morphology: the morphology corresponding to the data on disk
  • segment_tree: the raw segment tree
  • label_dict: all labels defined in the file
    • asc/swc: axon, soma, dend, and apic based on tag 1, 2, 3, 4.
    • nml: the union of the label dicts contained in the metadata, prefixed by grp:, nmd:, and seg:.
  • metadata: a set of items given by the fileformat
    • swc: nothing
    • asc: a list of spines and marker sets
    • nml:
      • named_segments a label dict
      • segment_groups a label dict name -> segment ids
      • group_segments a map from segment id to group name(s)
      • segments a label dict, one entry per id
      • cell_id id of the cell defining this morphology, if any
      • id id of the morphology

Note that loading neuroml still goes via the neuroml object and the cell_morphology/morphology
accessors return an optional loaded_morphology.

⚠️ Breaking ⚠️

  • Removed the load_*_raw functions, as loaded_morphology bundles the segment tree.
  • The interface of load_* now has an extra indirection.
  • The interface of neuroml changed.
  • label_dict::import is now called extend for future safety (=C++ modules) and Python; calling things import (=a keyword) is not well received by black et al.

Issues

Closes #1981

void import(const label_dict_proxy& other, std::string prefix = "") {
dict.import(other.dict, prefix);

auto extend(const label_dict_proxy& other, std::string prefix = "") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy of *this intended when returning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, good catch.

python/identifiers.cpp Show resolved Hide resolved
@thorstenhater thorstenhater requested a review from boeschf March 5, 2024 13:17
Copy link
Contributor

@boeschf boeschf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@thorstenhater thorstenhater merged commit 08a157f into arbor-sim:master Mar 5, 2024
25 checks passed
@thorstenhater thorstenhater deleted the qa/unify-morph-loaders branch March 5, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean-up Morphology Loaders
2 participants