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

Replace detection of soma type from static to dynamic? #314

Open
asanin-epfl opened this issue May 12, 2021 · 5 comments
Open

Replace detection of soma type from static to dynamic? #314

asanin-epfl opened this issue May 12, 2021 · 5 comments

Comments

@asanin-epfl
Copy link
Contributor

If morphology is built dynamically then it always has SomaType.SOMA_UNDEFINED.

from morphio.mut import Morphology
morpho = Morphology()
morpho.soma.points = [[0, 0, 0]]
morpho.soma.diameters = [1, 1]
print(morpho.soma.type)
# SomaType.SOMA_UNDEFINED

Dynamic detection poses a question. How to detect soma types that exist only for SWC? For example SOMA_CYLINDERS?

cc @tomdele @mgeplf

@tomdele
Copy link
Contributor

tomdele commented May 12, 2021

iirc, no matter the number of points you use for the soma, the soma will always be undefined when you are using the mut morphologies.
You must set yourself the correct morpho.soma.type.

@asanin-epfl
Copy link
Contributor Author

I'm afraid that morpho.soma.type is read-only.

Traceback (most recent call last):
  File "/Users/sanin/workspace/MorphIO/deleteme.py", line 23, in <module>
    morpho.soma.type = morphio.SomaType.SOMA_CYLINDERS
AttributeError: can't set attribute

@tomdele
Copy link
Contributor

tomdele commented May 12, 2021

My god. I am sorry, I totally misread the ticket ...
I just repeated what you already said and knew.

I am not sure that not having a proper type is bad for the mut during the building. To me the important thing is that we have the correct type when you write the file in a given format and then read it again.

@asanin-epfl asanin-epfl changed the title Replace detection of soma type from static to dynamic Replace detection of soma type from static to dynamic? May 12, 2021
@asanin-epfl
Copy link
Contributor Author

No worries

To me the important thing is that we have the correct type when you write the file in a given format and then read it again.

I can agree with that.

The more I dig into MorphIO, the more code I want to delete there :D. MorphIO should be a blunt tool that reads/writes. It should not assume any soma types. It should not provide soma properties like surface or volume (they can be calculated only for some of SWC somas, and single point soma). It's up to the end user to interpret. Currently MorphIO implementation is tangled in the mix of vague specifications, common sense and subjective view.

@tomdele
Copy link
Contributor

tomdele commented May 12, 2021

The more I dig into MorphIO, the more code I want to delete there :D.

I cannot agree more. I feel like the surface/volume and everything that implies computing should be handled by (maybe) neuroM or morph-tool or something else.
Unfortunately, we have the same problem with a lot of I/O tools where analysis codes lurk.

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

No branches or pull requests

2 participants