Preliminary notes on surface representations #2
Replies: 2 comments 3 replies
-
By @neurolabusc, August 10, 2021, 6:32pm The formats supported by Surfice are listed here. It simply supports popular formats, and should not be seen as an endorsement (e.g. STL format does not reuse vertices, so is inherently inefficient for both disk storage and modern GPUs). The supported formats fall into 3 classes:
With regards to streamlines, several people have noted that Python routines are slow and can be accelerated for existing formats. @frheault also sketched out a new format that could address many of the limitations with existing formats. |
Beta Was this translation helpful? Give feedback.
-
By @fangq, December 2, 2021, 3:06pm I wrote and have maintained a matlab based 3D mesh generator, Iso2Mesh (http://iso2mesh.sf.net, GitHub - fangq/iso2mesh: Iso2Mesh - a 3D surface and volumetric mesh generator for MATLAB/Octave), over the past years. We have also developed a brain-specific mesh generation pipeline built over iso2mesh - named Brain2Mesh (Brain2Mesh - A one-liner brain mesh generator). These toolboxes were build upon a number of other open-source meshing utilities - Tetgen, CGAL, Cork, meshfix … A big part of my computational work also involves mesh generation and tissue shape modeling (FEM based, or mesh-based Monte Carlo). In a drafted JSON-based mesh-data exchange specification - JMesh - I put together some of the typical data structures that I would expect to encounter in shape/surface/mesh based analysis tools, you can see the full document here specifically, the specification currently covers 1) discretized geometries (surfaces, solid elements, NURBS), 2) shape primitives (cubes, bricks, spheres, cylinders…), 3) textures (1D,2D,3D) and 4) constructive solid geometries (CSG). In one of my TODOs, I would like to include time-frame related keywords to represent shape changes over time (like what Blender/3DS handling of animations), but it will be less relevant to neuroimaging applications. Example categories of keywords from the JMesh spec are listed below, showing the scope of the geometry data that I would like to encapsulate using this format.
Please let me know if this is of interest to you. Majority of these support of these data structures are available in Iso2mesh for MATLAB/Octave. |
Beta Was this translation helpful? Give feedback.
-
By @effigies, August 9, 2021, 8:03pm
The basic problem of working with surfaces is that you have three types of data (previous notes at RFP: SurfaceImage API · Issue #936 · nipy/nibabel · GitHub:
For the purposes of efficiency, these will often be stored in separate files. Surface files typically contain topology and geometry, while data files typically purely contain one or more data vectors and no geometrical information at all.
Not all components are needed for many tasks. For example, vertex-wise calculations can typically be performed with one or more data arrays, without reference to the geometry. Spatial smoothing and plotting will require topological and geometric data as well.
In most cases, files are associated by keeping them in a common directory structure, which requires tooling to know about the directory conventions of each potential format.
The file formats currently supported in nibabel are:
Surface files contain topology and geometry, are maintained within the surf/ subdirectory. It is standard to have multiple geometries, each with the same topology, mapping to locations in the brain volume or in more abstract spaces used for visualization (inflated) or registration (sphere).
Different formats for parcellation (label) data, morphometric data, and generic vectors (MGH format is re-purposed here, IIRC).
There are many more, I suspect most comprehensively supported by Surf Ice.
Nilearn has adopted an extremely simple API:
Mesh = namedtuple("mesh", ["coordinates", "faces"])
Surface = namedtuple("surface", ["mesh", "data"])
This has the limitation:
CIFTI’s BrainModelAxis and WBSpec may provide a reasonable model to associate multiple surfaces (or other structures).
Beta Was this translation helpful? Give feedback.
All reactions