allensdk.core.obj_utilities module¶
-
allensdk.core.obj_utilities.
parse_obj
(lines)[source]¶ Parse a wavefront obj file into a triplet of vertices, normals, and faces. This parser is specific to obj files generated from our annotation volumes
Parameters: - lines : list of str
Lines of input obj file
Returns: - vertices : np.ndarray
Dimensions are (nSamples, nCoordinates=3). Locations in the reference space of vertices
- vertex_normals : np.ndarray
Dimensions are (nSample, nElements=3). Vectors normal to vertices.
- face_vertices : np.ndarray
Dimensions are (sample, nVertices=3). References are given in indices (0-indexed here, but 1-indexed in the file) of vertices that make up each face.
- face_normals : np.ndarray
Dimensions are (sample, nNormals=3). References are given in indices (0-indexed here, but 1-indexed in the file) of vertex normals that make up each face.
Notes
This parser is specialized to the obj files that the Allen Institute for Brain Science generates from our own structure annotations.