Skip to content

Conversation

@Knight680
Copy link
Contributor

The surf2vol function return error when input face is 5 columns (tetrahedral mesh with label). The error comes from two places:
1, Line 664:

face = np.empty((0, 4)) # face should be interger array

create float array by deafult, which cause line 728 error
2, Line 666:

fc = volface(el[el[:, 4] == lbl, :4]) # fc should be the face array, not truple

volfacereturn two value: openface and elemid. so fc here will be a truple and cause line 667 error. I guess here we just need the face.

Fix:
1, line 664: face = np.empty((0, 4), dtype="int64")
2, line 666: fc, _ = volface(el[el[:, 4] == lbl, :4])

@Knight680
Copy link
Contributor Author

The error can be reproduced by the following code

import iso2mesh as i2m
no, fc, c0 = i2m.latticegrid([0,1,3], [0, 2], [0, 0.8, 1])
no2, el2, fc2 = i2m.s2m(no, fc, 1, maxvol=0.3, regions=c0)
img = i2m.s2v(no2, el2, 50, label=1)

@fangq fangq merged commit f93a1bd into NeuroJSON:main Aug 21, 2025
28 checks passed
@fangq
Copy link
Member

fangq commented Aug 21, 2025

thanks!

with the new pmmc and pyiso2mesh modules, I actually took a careful look to BlenderPhotonics code last week and realized that much of it can be significantly reduced and simplified, making it much easier to install and maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants