|
1 |
| - |
| 1 | + |
2 | 2 |
|
3 | 3 | # pyiso2mesh - One-liner 3D Surface and Tetrahedral Mesh Generation Toolbox
|
4 | 4 |
|
5 |
| -* Copyright: (C) Qianqian Fang (2024-2025) <q.fang at neu.edu>, Edward Xu (2024) <xu.ed at northeastern.edu> |
6 |
| -* License: GNU Public License V3 or later |
7 |
| -* Version: 0.3.3 |
8 |
| -* URL: [https://pypi.org/project/iso2mesh/](https://pypi.org/project/iso2mesh/) |
9 |
| -* Github: [https://github.com/NeuroJSON/pyiso2mesh](https://github.com/NeuroJSON/pyiso2mesh) |
| 5 | +* **Copyright**: (C) Qianqian Fang (2024-2025) <q.fang at neu.edu> |
| 6 | +* **License**: GNU Public License V3 or later |
| 7 | +* **Version**: 0.3.4 |
| 8 | +* **URL**: [https://pypi.org/project/iso2mesh/](https://pypi.org/project/iso2mesh/) |
| 9 | +* **Homepage**: [https://iso2mesh.sf.net](https://iso2mesh.sf.net) |
| 10 | +* **Github**: [https://github.com/NeuroJSON/pyiso2mesh](https://github.com/NeuroJSON/pyiso2mesh) |
| 11 | +* **Acknowledgement**: This project is supported by the US National Institute of Health (NIH) |
| 12 | + grants [U24-NS124027](https://reporter.nih.gov/project-details/10308329) and |
| 13 | + [R01-CA204443](https://reporter.nih.gov/project-details/10982160) |
| 14 | + |
10 | 15 |
|
11 | 16 | 
|
12 | 17 |
|
@@ -170,3 +175,140 @@ no, fc, _, _ = v2s(img, 0.5, {'distbound': 0.2})
|
170 | 175 | ax = plotmesh(no, fc, 'y < 30', alpha=0.5, edgecolor='none')
|
171 | 176 | plotmesh(no, fc, 'y > 30', parent = ax)
|
172 | 177 | ```
|
| 178 | + |
| 179 | +## Iso2Mesh function port status |
| 180 | + |
| 181 | +The progress of converting MATLAB-based Iso2Mesh functions to Python is |
| 182 | +tracked in https://github.com/NeuroJSON/pyiso2mesh/issues/1 |
| 183 | + |
| 184 | +| Ported | Tested | | Ported | Tested | |
| 185 | +| ------ | ------ | --- | ------ | ------ | |
| 186 | +| > Streamlined mesh generation - shortcuts| | | > File I/O | | |
| 187 | +| ✅ `v2m.m` | ✅ tested | | ✅ `saveasc.m` | ⭕️ tested | |
| 188 | +| ✅ `v2s.m` | ✅ tested | | ✅ `savedxf.m` | ⭕️ tested | |
| 189 | +| ✅ `s2m.m` | ✅ tested | | ✅ `savestl.m` | ⭕️ tested | |
| 190 | +| ✅ `s2v.m` | ⭕️ tested | | ✅ `savebinstl.m` | ⭕️ tested | |
| 191 | +| ✅ `m2v.m` | ⭕️ tested | | ✅ `saveinr.m` | ⭕️ tested | |
| 192 | +| ✅ `sms.m` | ✅ tested | | ✅ `saveoff.m` | ✅ tested | |
| 193 | +| > Streamlined mesh generation| | | ⭕️ `savesmf.m` | ⭕️ tested | |
| 194 | +| ✅ `vol2mesh.m` | ✅ tested | | ✅ `savesurfpoly.m` | ✅ tested | |
| 195 | +| ✅ `vol2surf.m` | ✅ tested | | ⭕️ `savegts.m` | ⭕️ tested | |
| 196 | +| ✅ `surf2mesh.m` | ✅ tested | | ⭕️ `readgts.m` | ⭕️ tested | |
| 197 | +| ✅ `surf2vol.m` | ⭕️ tested | | ⭕️ `savemsh.m` | ⭕️ tested | |
| 198 | +| ✅ `mesh2vol.m` | ⭕️ tested | | ⭕️ `savevrml.m` | ⭕️ tested | |
| 199 | +| > Iso2mesh main function backend| | | ✅ `readasc.m` | ⭕️ tested | |
| 200 | +| ✅ `binsurface.m` | ✅ tested | | ⭕️ `readinr.m` | ⭕️ tested | |
| 201 | +| ✅ `cgalv2m.m` | ✅ tested | | ✅ `readmedit.m` | ⭕️ tested | |
| 202 | +| ✅ `cgals2m.m` | ⭕️ tested | | ✅ `readoff.m` | ✅ tested | |
| 203 | +| ✅ `vol2restrictedtri.m` | ✅ tested | | ⭕️ `readsmf.m` | ⭕️ tested | |
| 204 | +| ✅ `surf2volz.m` | ⭕️ tested | | ✅ `readtetgen.m` | ✅ tested | |
| 205 | +| ✅ `mesh2mask.m` | ⭕️ tested | | ✅ `deletemeshfile.m` | ✅ tested | |
| 206 | +| > Iso2mesh primitive meshing functions| | | ✅ `mcpath.m` | ✅ tested | |
| 207 | +| ✅ `meshabox.m` | ✅ tested | | ✅ `mwpath.m` | ✅ tested | |
| 208 | +| ✅ `meshasphere.m` | ✅ tested | | ✅ `savemedit.m` | ✅ tested | |
| 209 | +| ✅ `meshanellip.m` | ✅ tested | | ⭕️ `savejson.m` | ⭕️ tested | |
| 210 | +| ✅ `meshunitsphere.m` | ✅ tested | | ⭕️ `loadjson.m` | ⭕️ tested | |
| 211 | +| ✅ `meshacylinder.m` | ✅ tested | | ⭕️ `saveubjson.m` | ⭕️ tested | |
| 212 | +| ✅ `meshgrid5.m` | ✅ tested | | ⭕️ `loadubjson.m` | ⭕️ tested | |
| 213 | +| ✅ `meshgrid6.m` | ✅ tested | | ⭕️ `loadmsgpack.m` | ⭕️ tested | |
| 214 | +| ✅ `latticegrid.m` | ✅ tested | | ⭕️ `savemsgpack.m` | ⭕️ tested | |
| 215 | +| ✅ `extrudecurve.m` | ⭕️ tested | | ⭕️ `savebj.m` | ⭕️ tested | |
| 216 | +| ✅ `meshcylinders.m` | ✅ tested | | ⭕️ `loadbj.m` | ⭕️ tested | |
| 217 | +| > Mesh decomposition and query| | | ⭕️ `savemphtxt.m` | ⭕️ tested | |
| 218 | +| ✅ `finddisconnsurf.m` | ✅ tested | | ⭕️ `savetetgenele.m` | ⭕️ tested | |
| 219 | +| ✅ `surfedge.m` | ✅ tested | | ⭕️ `savetetgennode.m` | ⭕️ tested | |
| 220 | +| ✅ `volface.m` | ✅ tested | | ⭕️ `saveabaqus.m` | ⭕️ tested | |
| 221 | +| ✅ `extractloops.m` | ✅ tested | | ⭕️ `savenirfast.m` | ⭕️ tested | |
| 222 | +| ✅ `meshconn.m` | ✅ tested | | ⭕️ `readnirfast.m` | ⭕️ tested | |
| 223 | +| ✅ `meshcentroid.m` | ✅ tested | | ⭕️ `readnifti.m` | ⭕️ tested | |
| 224 | +| ✅ `nodevolume.m` | ✅ tested | | ⭕️ `readmptiff.m` | ⭕️ tested | |
| 225 | +| ✅ `elemvolume.m` | ✅ tested | | ⭕️ `loadjsnirf.m` | ⭕️ tested | |
| 226 | +| ✅ `neighborelem.m` | ✅ tested | | ⭕️ `savejsnirf.m` | ⭕️ tested | |
| 227 | +| ✅ `layersurf.m` | ⭕️ tested | | ⭕️ `loadsnirf.m` | ⭕️ tested | |
| 228 | +| ✅ `faceneighbors.m` | ✅ tested | | ⭕️ `savesnirf.m` | ⭕️ tested | |
| 229 | +| ✅ `edgeneighbors.m` | ✅ tested | | ⭕️ `readobjmesh.m` | ⭕️ tested | |
| 230 | +| ✅ `maxsurf.m` | ⭕️ tested | | ⭕️ `loadjmesh.m` | ⭕️ tested | |
| 231 | +| ✅ `flatsegment.m` | ⭕️ tested | | ⭕️ `readobjmesh.m` | ⭕️ tested | |
| 232 | +| ✅ `orderloopedge.m` | ⭕️ tested | | > Volumetric image pre-processing| | |
| 233 | +| ✅ `mesheuler.m` | ✅ tested | | ⭕️ `bwislands.m` | ⭕️ tested | |
| 234 | +| ✅ `bbxflatsegment.m` | ⭕️ tested | | ⭕️ `fillholes3d.m` | ⭕️ tested | |
| 235 | +| ✅ `surfplane.m` | ⭕️ tested | | ⭕️ `deislands2d.m` | ⭕️ tested | |
| 236 | +| ✅ `surfinterior.m` | ⭕️ tested | | ⭕️ `deislands3d.m` | ⭕️ tested | |
| 237 | +| ✅ `surfpart.m` | ⭕️ tested | | ⭕️ `ndgaussian.m` | ⭕️ tested | |
| 238 | +| ✅ `surfseeds.m` | ⭕️ tested | | ⭕️ `ndimfilter.m` | ⭕️ tested | |
| 239 | +| ✅ `meshquality.m` | ✅ tested | | ⭕️ `imedge3d.m` | ⭕️ tested | |
| 240 | +| ✅ `meshedge.m` | ✅ tested | | ⭕️ `internalpoint.m` | ⭕️ tested | |
| 241 | +| ✅ `meshface.m` | ✅ tested | | ⭕️ `smoothbinvol.m` | ⭕️ tested | |
| 242 | +| ✅ `surfacenorm.m` | ✅ tested | | ⭕️ `thickenbinvol.m` | ⭕️ tested | |
| 243 | +| ✅ `nodesurfnorm.m` | ✅ tested | | ⭕️ `thinbinvol.m` | ⭕️ tested | |
| 244 | +| ✅ `uniqedges.m` | ✅ tested | | ⭕️ `maskdist.m` | ⭕️ tested | |
| 245 | +| ✅ `uniqfaces.m` | ✅ tested | | > Mesh plotting| | |
| 246 | +| ✅ `advancefront.m` | ⭕️ tested | | ✅ `plotmesh.m` | ✅ tested | |
| 247 | +| ✅ `innersurf.m` | ⭕️ tested | | ✅ `plotsurf.m` | ✅ tested | |
| 248 | +| ✅ `outersurf.m` | ⭕️ tested | | ✅ `plottetra.m` | ✅ tested | |
| 249 | +| ✅ `surfvolume.m` | ✅ tested | | ✅ `plotedges.m` | ✅ tested | |
| 250 | +| ✅ `insurface.m` | ✅ tested | | ✅ `qmeshcut.m` | ✅ tested | |
| 251 | +| > Mesh processing and reparing| | | > Miscellaneous functions| | |
| 252 | +| ✅ `meshcheckrepair.m` | ✅ tested | | ⭕️ `surfdiffuse.m` | ⭕️ tested | |
| 253 | +| ✅ `meshreorient.m` | ✅ tested | | ⭕️ `volmap2mesh.m` | ⭕️ tested | |
| 254 | +| ✅ `removedupelem.m` | ✅ tested | | ⭕️ `isoctavemesh.m` | ⭕️ tested | |
| 255 | +| ✅ `removedupnodes.m` | ✅ tested | | ⭕️ `getvarfrom.m` | ⭕️ tested | |
| 256 | +| ✅ `removeisolatednode.m` | ✅ tested | | ✅ `raytrace.m` | ✅ tested | |
| 257 | +| ✅ `removeisolatedsurf.m` | ⭕️ tested | | ⭕️ `linextriangle.m` | ⭕️ tested | |
| 258 | +| ✅ `surfaceclean.m` | ⭕️ tested | | ⭕️ `getplanefrom3pt.m` | ⭕️ tested | |
| 259 | +| ✅ `getintersecttri.m` | ⭕️ tested | | ✅ `getexeext.m` | ✅ tested | |
| 260 | +| ✅ `delendelem.m` | ⭕️ tested | | ✅ `fallbackexeext.m` | ✅ tested | |
| 261 | +| ✅ `surfreorient.m` | ✅ tested | | ⭕️ `iso2meshver.m` | ⭕️ tested | |
| 262 | +| > Mesh registration - Metch Toolbox| | | ⭕️ `raysurf.m` | ⭕️ tested | |
| 263 | +| ✅ `proj2mesh.m` | ⭕️ tested | | ⭕️ `getoptkey.m` | ⭕️ tested | |
| 264 | +| ✅ `dist2surf.m` | ⭕️ tested | | ✅ `rotatevec3d.m` | ⭕️ tested | |
| 265 | +| ✅ `regpt2surf.m` | ⭕️ tested | | ✅ `rotmat2vec.m` | ⭕️ tested | |
| 266 | +| ✅ `affinemap.m` | ⭕️ tested | | ✅ `varargin2struct.m` | ⭕️ tested | |
| 267 | +| > Polyline handling| | | ✅ `jsonopt.m` | ⭕️ tested | |
| 268 | +| ⭕️ `slicesurf.m` | ⭕️ tested | | ⭕️ `mergestruct.m` | ⭕️ tested | |
| 269 | +| ⭕️ `slicesurf3.m` | ⭕️ tested | | ⭕️ `orthdisk.m` | ⭕️ tested | |
| 270 | +| ⭕️ `polylinelen.m` | ⭕️ tested | | ⭕️ `nestbracket2dim.m` | ⭕️ tested | |
| 271 | +| ⭕️ `polylinesimplify.m` | ⭕️ tested | | ⭕️ `memmapstream.m` | ⭕️ tested | |
| 272 | +| ⭕️ `polylineinterp.m` | ⭕️ tested | | ⭕️ `aos2soa.m` | ⭕️ tested | |
| 273 | +| ⭕️ `closestnode.m` | ⭕️ tested | | ⭕️ `soa2aos.m` | ⭕️ tested | |
| 274 | +| > Mesh resampling and optimization| | |
| 275 | +| ✅ `meshresample.m` | ✅ tested | |
| 276 | +| ✅ `remeshsurf.m` | ⭕️ tested | |
| 277 | +| ✅ `smoothsurf.m` | ✅ tested | |
| 278 | +| ✅ `sortmesh.m` | ⭕️ tested | |
| 279 | +| ✅ `mergemesh.m` | ⭕️ tested | |
| 280 | +| ✅ `meshrefine.m` | ⭕️ tested | |
| 281 | +| ✅ `mergesurf.m` | ⭕️ tested | |
| 282 | +| ✅ `surfboolean.m` | ✅ tested | |
| 283 | +| ✅ `fillsurf.m` | ⭕️ tested | |
| 284 | +| ✅ `highordertet.m` | ⭕️ tested | |
| 285 | +| ✅ `elemfacecenter.m` | ⭕️ tested | |
| 286 | +| ✅ `barydualmesh.m` | ⭕️ tested | |
| 287 | +| ✅ `meshinterp.m` | ⭕️ tested | |
| 288 | +| ✅ `meshremap.m` | ⭕️ tested | |
| 289 | +| ✅ `extrudesurf.m` | ⭕️ tested | |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | +## Acknowledgement |
| 294 | + |
| 295 | +The `pyiso2mesh` module was converted from the MATLAB/Octave version of |
| 296 | +of Iso2Mesh (https://github.com/fangq/iso2mesh) written by the same author. |
| 297 | + |
| 298 | +We utilized large-language-model (LLM) and AI chatbot in the initial MATLAB-to-Python |
| 299 | +conversion, with specific instructions to **faithfully replicate** the algorithms |
| 300 | +developed in the MATLAB code to avoid introducing external copyrighted materials |
| 301 | +into this toolbox. With the assumption that the AI chatbot functions primarily |
| 302 | +as an automated syntax translator without altering the originality of the code, |
| 303 | +the upstream author of the original MATLAB-based Iso2Mesh retains the full copyright |
| 304 | +of this derived Python module. |
| 305 | + |
| 306 | +The initial translation was further manually tested, adjusted and restructured |
| 307 | +to produce matching outputs as the original MATLAB toolbox. Dr. Edward Xu |
| 308 | +<xu.ed at northeastern.edu> had contributed to the initial conversion and |
| 309 | +testing of a subset of functions in the `geometry.py` and `trait.py` units. |
| 310 | + |
| 311 | +The development of this software is supported by the US National Institute of Health (NIH) |
| 312 | +under research awards [U24-NS124027](https://reporter.nih.gov/project-details/10308329) and |
| 313 | +[R01-CA204443](https://reporter.nih.gov/project-details/10982160), with the author, |
| 314 | +Dr. Qianqian Fang, serving as the principle investigator on both awards. |
0 commit comments