BlueBrain / morph-tool

https://morph-tool.readthedocs.org/
GNU Lesser General Public License v3.0
8 stars 7 forks source link

convert amira format #100

Closed arnaudon closed 1 year ago

arnaudon commented 2 years ago

with @lidakanari we'll soon need to convert morphologies from so-called amira format to any of morphio handled format. There is some python parser here: https://github.com/zibneuro/udvary-et-al-2022/blob/master/structural_model/util_amira.py which could easily be adapted/integrated to morphtool convert module.

@mgeplf @eleftherioszisis , what do you think? (there is also a cpp parser in this github repo, in case we want to integrate to morphio, but I don't think we need full support, just an easy way to convert this format).

I can make a rough working PR next week here to start looking at how this works, unless you have any objections.

lidakanari commented 2 years ago

Two comments:

  1. At the moment we only need a read support for this format (no need for writer)
  2. We will have a lot of data of potential interest in this format, so we need to ensure some level of "correctness" for the amira reader

so the options are to either add a reader to morphIO (which might be harder and more time consuming) or add some prototype code in morph-tool to have a temporary solution that could be transferred in morphIO if there is a need in the future.

mgeplf commented 2 years ago

Sounds interesting. Is there a spec I can read, or do we only have example parsers?

arnaudon commented 2 years ago

I'm not aware of any spec, it's a format generated by this proprietary soft: https://www.thermofisher.com/ch/en/home/electron-microscopy/products/software-em-3d-vis/amira-software.html

eleftherioszisis commented 2 years ago

Are there any file examples that could be added here?

eleftherioszisis commented 2 years ago

In addition, is this a standardized format that is used in more than one lab? AmiraMesh seems to be a format for 3D surfaces. Is this "abused" here to represent skeletons? Or is it something different?

arnaudon commented 2 years ago

yes, there are a bunch in the 'model data' zip file here: https://cortexinsilico.zib.de/download

lidakanari commented 2 years ago

The software has some reconstruction algorithms (I think maybe some automatic reconstruction algorithms?) that are used to generate the skeletons. A few labs use this, so I assume there is a functionality to output the skeleton-versions of neurons in a way that corresponds to graph structure and coordinates. I do not have any more information to judge the validity of the representation and I cannot find a spec for this.

arnaudon commented 2 years ago

FYI, this is not urgent atm, but will be coming back on todo list in july

arnaudon commented 2 years ago

WIP converter here: https://github.com/BlueBrain/morph-tool/pull/108

arnaudon commented 1 year ago

Hello, in #108 I added a test with an example file to see better what is going on. Let me know if anything can be done to improve the amira loader. It is rather 'experimental', only for @alTeska 's project atm, so I would not go further in making it an 'officially supported bbp format' with writer and full morphio. The game was just to have a loader to then write an asc/h5 file for further internal processing. Aleksandra will try it more on her dataset, and report if anything does not quite work. In the meantime we could merge this, and open new PRs to fix issues later.

arnaudon commented 1 year ago

108 has been merged, I close this