MorphIO
MorphIO copied to clipboard
Ensure that duplicate point check includes diameters
It would be useful to indicate if the diameters between the last point of a section and the first points of its children are consistent. This will ensure the correctness of duplicate points as far as diameters are concerned.
All point properties should undergo this check. Astrocyte perimeters for example.
Agree, this should be standardized throughout!
This kinda of check does not really belong to MorphIO but rather to NeuroM. MorphIO is just an I/O reader that tries to follow the specifications. It's not really wrong to have a different diameter at the last point of a section and at the first point of the child section. It'l like having to successive tubes with different diameters. They share the coordinate where they are connected but they don't have the same diameter. I can't force this specification directly in MorphIO as it might penalize some users that need different diameters at the bifurcation point. The check is trivial to implement in NeuroM though.
I didn't know this was allowed by the spec but it makes sense indeed.
I agree that MorphIO shouldn't be unnecessarily restricted and that the check should be applied in downstream tools.
I/O should ensure that the output is correct. If the specs expect duplicate points (for example h5 is making this assumption if I am not mistaken) then the duplicate points should be present in all files that are produced. This cannot be ensured within NeuroM if it is related to O functionality. Alternatively and because indeed this does not make sense to be forced for all files, there should be an option to load with/without duplicates (this is already there, correct?) and write with/without duplicates. Only when this functionality is enabled this check should be performed.
I would expect the same but unfortunately in the h5 spec even though the coordinates are identical in the duplicate points, their diameters may differ. https://developer.humanbrainproject.eu/docs/projects/morphology-documentation/0.0.2/h5v1.html
OK, I agree, in this case I expect no tools will break if diameter are not consistent, and therefore we can ignore any of these checks. However it is useful to keep this discussion for future reference.
However, quoting the specs points = (x, y, z, diam) and should match:
points:
A 4 column data set composed of 32 bit floating point numbers representing morphology points, which are basically the position and diameter at a cross_section. The first three columns represent X, Y, and Z positions and the last column represents the Diameter, all in micrometers. Implicit in the points dataset is an index, starting at 0, of each point.
Note: Points on the boundaries between sections are duplicated, such that the start point of a child section is the same as the last point of its parent section.
The figure and the definition differ. Wonderful.
In this case we should consider what is written as true and that the figure is erroneous and needs to be fixed. The spec is not the figure in the end, just the text. The best solution I think would be to have an option to also check the properties, such as diameters and perimeters for the duplicate points.
In this case we should consider what is written as true and that the figure is erroneous and needs to be fixed
We should check, first, what is out there - when I wrote the H5 spec, it was by inspection, so the before fixing the self-inconsistency, we should see what is in the wild.