connectome-neuprint / neuVid

Generates neuroscience videos from high-level descriptions using Blender or VVDViewer.
Other
28 stars 7 forks source link

roiSources and roiNames have different lengths in importMeshes.py #181

Closed floesche closed 7 months ago

floesche commented 7 months ago

When a description lists several potential sources in the rois dictionary, but only uses one of them, importMeshes fails in line 452 trying to access roiNames at index i.

Example:

"rois": {
    "source": [
        "cache1/"
      , "cache2/"
    ]
    , "ME": {"ids": ["ME(R)"], "sourceIndex": 0}
}

The error occurs because the assumption that roiSources and roiNames contain the same number of elements is not guaranteed by utilsJson.parseRoiNames().

I ran into this problem for automatically generated descriptions and can fix it on my side.

In my case, there is always a sourceIndex of 0, but I wonder what happens if 0 is skipped?

I wasn't sure, if the issue should be addressed at all, and if so, if in importMeshes or in utilsJson.

hubbardp commented 7 months ago

Thanks for the report. Let me take a look.

hubbardp commented 7 months ago

Should be fixed now with this change: https://github.com/connectome-neuprint/neuVid/pull/184