Closed neurolabusc closed 6 years ago
Hi Chris,
thank you for the input, that's really appreciated!
We do use .PLY a lot already, indeed when visualizing DBS electrodes with surfice instead of our builtin viewer, .PLY is used which I found easier to also display color (ea_elvis_surfice
function).
Also, one can export all DBS scenes as .PLY
To be honest, the ea_surficeoverlay_lr
function is pretty hidden in Lead-DBS and I built it in to automatize some standard nifti figures not really related to DBS at all (so a Menu item built mostly for myself). But it's great to know that .STL is not a good format and we'll refrain from using it in the future.
Sounds like a good idea. In my testing binary PLY outperforms OBJ (as well as STL) https://www.nitrc.org/plugins/mwiki/index.php/Image:Surfice:Surf_Ice_Formats.png For completeness, Matlab users who do want to load STL files can eliminate the facet artifacts using a couple lines of code, so it is easy to implement so for informed Matlab users STL files just take a lot of disk space and are a bit slow to load: http://www.mathworks.com/matlabcentral/fileexchange/29986-patch-slim--patchslim-m-
The current distribution comes with meshes in STL format, includes scripts to save meshes as STL format, and includes scripts to display STL format meshes. I would suggest using ANY format other than STL. Since STL does not reuse vertices, the file sizes are very large. Further, when loading these images the display software must either
For example, since Surfice follows the latter approach the current
ea_surficeoverlay_lr
script is much slower than if a different format was used. If Surfice is your main target, I would suggest its MZ3 format - this will be much faster and the files will require 20% the disk space of STL. You can find reading and writing code here https://github.com/bonilhamusclab/MRIcroS/tree/development/%2BfileUtils/%2Bmz3 The only concern is that this format is not popular. However, the Matlab scripts make it easy to load and save as different formats.More common alternatives that can also store vertex colors are PLY https://github.com/bonilhamusclab/MRIcroS/blob/development/%2BfileUtils/%2Bply/writePly.m or GIfTI https://www.artefact.tk/software/matlab/gifti/ of the very popular OBJ https://en.wikipedia.org/wiki/Wavefront_.obj_file Note that it is really easy to convert any format to STL. The challenge is welding together vertices when reading STL. I think by moving to a different format you could accelerate loads of files, accelerate download speeds, and you can always include the tiny script to save any other format to STL.