BlueBrain / MorphIO

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

Seemingly incorrect parsing error #468

Closed Helveg closed 1 year ago

Helveg commented 1 year ago

Using the attached SWC file (I had to change the extension to upload it here) and this snippet:

>>> import morphio
>>> morphio.Morphology("BasketCell.swc")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
morphio._morphio.MissingParentError:
BasketCell.swc:5164:error
Sample id: 5164 refers to non-existant parent ID: 0

But these are lines 5163-5165, there is not a single line in the entire morphology with parent id 0:

5163 2 -69.74903869628906 -21.408447265625 -0.26000022888183594 0.33000001311302185 5162
5164 2 -69.80905151367188 -21.6484375 -0.020000457763671875 0.3400000035762787 5163
5165 2 -69.82904052734375 -21.688446044921875 0.0 0.3199999928474426 5164

The morphology parses just fine with my own SWC parser.

BasketCell.txt

Helveg commented 1 year ago

Problem solved by upgrading from morphio 3.3.3 to 3.3.6