Skip to content

Commit

Permalink
Merge pull request #84 from brainglobe/morphio_fix
Browse files Browse the repository at this point in the history
Explicitly load neuron via morphio before passing to neuromorph
  • Loading branch information
alessandrofelder authored Nov 11, 2024
2 parents 5755d25 + fc11f74 commit 437e0bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
- uses: neuroinformatics-unit/actions/test@v2
with:
python-version: ${{ matrix.python-version }}
secret-codecov-token: ${{ secrets.CODECOV_TOKEN }}

build_sdist_wheels:
name: Build source distribution
Expand Down
8 changes: 7 additions & 1 deletion morphapi/morphology/morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from pathlib import Path

import neurom as nm
from morphio import Morphology as MorphioMorphology
from morphio import Option
from neurom.core.dataformat import COLS
from vedo import merge
from vedo.colors import color_map
Expand Down Expand Up @@ -77,7 +79,11 @@ def load_from_swc(self):
if self.neuron_name is None:
self.neuron_name = self.data_file.name

nrn = nm.load_morphology(self.data_file)
morphio_input = MorphioMorphology(
str(self.data_file),
options=Option.allow_unifurcated_section_change,
)
nrn = nm.load_morphology(morphio_input)
self.morphology = nrn

try:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ dependencies = [
"brainglobe-atlasapi >=2.0.1",
"brainglobe-space >=1.0.0",
"imagecodecs; python_version>='3.9'",
"neurom>=3,<4",
"neurom>=3",
"numpy",
"morphio>=3.4.0",
"pandas",
"pyyaml>=5.3",
"requests",
Expand Down

0 comments on commit 437e0bc

Please sign in to comment.