-
Notifications
You must be signed in to change notification settings - Fork 7
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
dendrite subtypes handling #70
base: master
Are you sure you want to change the base?
Conversation
fdb7a94
to
163e354
Compare
for section in iter_sections(neuron): | ||
if section.type == SectionType.axon: | ||
extended_types[section.id] = "axon" | ||
if section.type == SectionType.basal_dendrite: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if section.type == SectionType.basal_dendrite: | |
elif section.type == SectionType.basal_dendrite: |
extended_types[section.id] = "axon" | ||
if section.type == SectionType.basal_dendrite: | ||
extended_types[section.id] = "basal" | ||
if section.type == SectionType.apical_dendrite: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if section.type == SectionType.apical_dendrite: | |
elif section.type == SectionType.apical_dendrite: |
for section in iter_sections(neuron): | ||
if section.type == SectionType.basal_dendrite: | ||
extended_types[section.id] = "basal" | ||
if section.type == SectionType.axon: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if section.type == SectionType.axon: | |
elif section.type == SectionType.axon: |
return neuron | ||
|
||
|
||
def _unset_subtypes(neuron, base_type): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using a mapping of base types? So it is possible to use several custom types at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I should rather use the REV_ mapping here, so we can revert only specific custom types
def set_apical_subtypes(neuron, tuft_percent=20): | ||
"""Set apical subtypes to a morphology. | ||
|
||
WARNING: cannot save it to .asc file, use unset_subtype to revert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use the .. warning::
directive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And by the way why can't we save custom types? Is it a limitation of MorphIO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try all format, abut asc is based on neurites, which can have only specific names via morphio. I'm not sure with new code of @eleftherioszisis in neurom how this can be better handled
For various project, it is convenient to have a way to assign sub sectiontypes to morphologies, based on a particular point (apical point, or 'axon point'). This is an attempt to provide such a little tool via the SectionType.custom[number] of morphio.
One set the subtypes, then use the provided dict to access specific section via names (trunk, oblique) instead of custom[number], then can unset them to return to original morphology (for example after some manipulations, to be able to save it on disc).
It is a bit of a mix-up between neurom and morphio, I'm open to any suggestions to make this cleaner.