BlueBrain / MorphIO

A python and C++ library for reading and writing neuronal morphologies
https://morphio.readthedocs.io
Apache License 2.0
27 stars 24 forks source link

Add support for a storage container for many morphologies in one file #443

Closed matz-e closed 1 year ago

matz-e commented 1 year ago

A while ago we added support for reading morphologies from groups in #163. This has led to experimental work by @1uc to see how well HDF5 files work to store many morphologies in a single file (presentation incoming). I think it would be good to consolidate the work done in our internal MorphoKit in MorphIO by

mgeplf commented 1 year ago

Everything above looks fine. Please remember that this has to build under linux/mac and windows, since we produce wheels and such for all platforms.

a get method to obtain morphologies stored

What would be the argument to the get? A number? A string?

1uc commented 1 year ago

The current solution in morpho-kit is essentially:

class MorphologyStorage {
public:
    virtual morphio::Morphology get(const std::string& morph_name) const = 0;
};

class DirectoryStorage {
public:
    DirectoryStorage(const std::string& dirname);
    morphio::Morphology get(const std::string& morph_name) const override;

public:
    const std::string& dirname;
};

class FileStorage {
public:
    FileStorage(const std::string& container_name);
    morphio::Morphology get(const std::string& morph_name) const override;

public:
    HighFive::File file;
};

The assumption is that the file name is {dirname}/{morph_name}.{ext} where there's some guessing an precedence order for picking the extension.

matz-e commented 1 year ago

Everything above looks fine. Please remember that this has to build under linux/mac and windows, since we produce wheels and such for all platforms.

a get method to obtain morphologies stored

What would be the argument to the get? A number? A string?

As @1uc pointed out in the interface snippet, the morphology name as currently stored in SONATA. If we had integration with libsonata, one could actually use a node id. Not sure that this is desired, though.

1uc commented 1 year ago

Multiple circuits should be able to use the same morphology container. Hence, the node ID alone doesn't identify the morphology; conversely multiple nodes can map to the same morphology.