MetaCell / NetPyNE-UI

NetPyNE User interface
24 stars 7 forks source link

3D positions of cells being displayed incorrectly #794

Open pgleeson opened 11 months ago

pgleeson commented 11 months ago

This NeuroML file contains 2 cells, a basket cell on the left (at the origin) and a pyramidal cell on the right (at <location x="400.0" y="-200.0" z="0.0"/>). The soma of the pyramidal cell should be below the basket cell as shown in this export of the cell from NML (use: pynml -png TwoCell.net.nml, see here):

TwoCell net

However when this is imported into NetPyNE (e.g. by creating a workspace from https://v2.opensourcebrain.org/repositories/14 and importing the NML file above) the soma is above the basket cell (left below):

Screenshot 2023-12-19 at 16 19 43

The correct position seems to be in netpyne's memory, as the right panel shows its own 3D view, with the yellow dot on the right for the pyramidal cell at the right locaion.

Also a json file exported from the neuroml version has the right location: https://github.com/OpenSourceBrain/NetPyNEShowcase/blob/master/NetPyNE/TwoCells/LEMS_TwoCell_netpyne_data.json#L29

Is it possibly the issue is to do with the "ynorm": -2.0 linked above, as the y position looks like it is wrongly multiplied by -2?

pgleeson commented 3 months ago

This seems to be the source of the error... https://github.com/MetaCell/NetPyNE-UI/blob/eb3b3a3c5d5eaaffaed044147c13d8125128b387/netpyne_ui/netpyne_model_interpreter.py#L100-L102

The y value is being multiplied by -1, but not x or z... I can't think of any reason why you would explicitly state in the cellList that you want x=10, y=20, z=30 and then use (10,-20,30)... If the y axis should be pointing down for positive y, then why are all the cells displayed correctly with increasing y values on segments pointing up???