diff --git a/brayns/json/JsonType.cpp b/brayns/json/JsonType.cpp index 9a354898d..df7aa0a2f 100644 --- a/brayns/json/JsonType.cpp +++ b/brayns/json/JsonType.cpp @@ -81,6 +81,20 @@ const JsonObject &JsonExtractor::extractObject(const JsonValue &json) return *json.extract(); } +JsonValue JsonFactory::array() +{ + auto json = JsonValue(); + emplaceArray(json); + return json; +} + +JsonValue JsonFactory::object() +{ + auto json = JsonValue(); + emplaceObject(json); + return json; +} + JsonArray &JsonFactory::emplaceArray(JsonValue &json) { auto array = Poco::makeShared(); diff --git a/brayns/json/JsonType.h b/brayns/json/JsonType.h index 0254af00e..e48f038aa 100644 --- a/brayns/json/JsonType.h +++ b/brayns/json/JsonType.h @@ -198,6 +198,8 @@ class JsonExtractor class JsonFactory { public: + static JsonValue array(); + static JsonValue object(); static JsonArray &emplaceArray(JsonValue &json); static JsonObject &emplaceObject(JsonValue &json); }; diff --git a/plugins/CircuitExplorer/api/neuron/NeuronMorphologyReader.cpp b/plugins/CircuitExplorer/api/neuron/NeuronMorphologyReader.cpp index 270f42145..e72c3306d 100644 --- a/plugins/CircuitExplorer/api/neuron/NeuronMorphologyReader.cpp +++ b/plugins/CircuitExplorer/api/neuron/NeuronMorphologyReader.cpp @@ -165,11 +165,6 @@ NeuronMorphology NeuronMorphologyReader::read(const std::string &path, bool soma throw std::invalid_argument("Nothing requested to be loaded"); } - if (!axon && !dendrites) - { - throw std::runtime_error("Soma-only NeuronMorphologies not allowed"); - } - auto morph = MorphIOReader::read(path); auto sections = NeuriteReader::read(morph, axon, dendrites); diff --git a/plugins/CircuitExplorer/io/BBPLoaderParameters.h b/plugins/CircuitExplorer/io/BBPLoaderParameters.h index 1bb3df072..164219056 100644 --- a/plugins/CircuitExplorer/io/BBPLoaderParameters.h +++ b/plugins/CircuitExplorer/io/BBPLoaderParameters.h @@ -116,7 +116,7 @@ struct JsonAdapter : ObjectAdapter [](auto &object) -> auto & { return object.neuron_morphology_parameters; }, [](auto &object, auto value) { object.neuron_morphology_parameters = std::move(value); }) .description("Settings to configure neuron morphology loading") - .required(false); + .defaultValue(brayns::JsonFactory::object()); builder .getset( "load_afferent_synapses", diff --git a/plugins/CircuitExplorer/io/CellPlacementLoaderParameters.h b/plugins/CircuitExplorer/io/CellPlacementLoaderParameters.h index 638e73173..dcee38cad 100644 --- a/plugins/CircuitExplorer/io/CellPlacementLoaderParameters.h +++ b/plugins/CircuitExplorer/io/CellPlacementLoaderParameters.h @@ -76,7 +76,7 @@ struct JsonAdapter : ObjectAdapter auto & { return object.morphology_parameters; }, [](auto &object, auto value) { object.morphology_parameters = std::move(value); }) .description("Settings for morphology geometry loading") - .required(false); + .defaultValue(brayns::JsonFactory::object()); return builder.build(); } }; diff --git a/plugins/CircuitExplorer/io/SonataLoaderParameters.h b/plugins/CircuitExplorer/io/SonataLoaderParameters.h index b69e379af..2b034d2cc 100644 --- a/plugins/CircuitExplorer/io/SonataLoaderParameters.h +++ b/plugins/CircuitExplorer/io/SonataLoaderParameters.h @@ -224,7 +224,7 @@ struct JsonAdapter : ObjectAdapter auto & { return object.neuron_morphology_parameters; }, [](auto &object, auto value) { object.neuron_morphology_parameters = std::move(value); }) .description("Settings for morphology geometry loading (ignored for vasculature populations)") - .required(false); + .defaultValue(brayns::JsonFactory::object()); builder .getset( "vasculature_geometry_parameters", diff --git a/python/brayns/plugins/cell_placement.py b/python/brayns/plugins/cell_placement.py index 64bdb385c..a82273be0 100644 --- a/python/brayns/plugins/cell_placement.py +++ b/python/brayns/plugins/cell_placement.py @@ -49,9 +49,7 @@ class CellPlacementLoader(Loader): density: float = 1.0 extension: str | None = None ids: list[int] | None = None - morphology: Morphology = field( - default_factory=lambda: Morphology(load_dendrites=True) - ) + morphology: Morphology = field(default_factory=Morphology) @classmethod @property