make_local_volume_from_obj - jaybgager/tracertools GitHub Wiki
Generates a local neuroglancer volume that contains a legacy-format single-resolution precomputed mesh using a local OBJ file.
[!NOTE] This function doesn't work on Windows OS due to the volume format requiring colons
:in several file names, which is prohibited on Windows. Currently there's no known way around this limitation.
Arguments:
datastack(string, mandatory)- the name of the datastack the OBJ mesh is from
obj_path(string, mandatory)- the absolute path to the JSON state file to pull annotations from
- e.g.
/home/username/ng_jsons/state.json
output_path(string, mandatory)- the absolute path to the folder where you want to save the mesh output
- the volume folder called "image" will be created in this folder
- e.g. passing
"/home/username/ng_meshes"will create the volume/home/username/ng_meshes/image
Returns:
- creates local volume
Example
The code below creates a volume named image formatted for use with the brain_and_nerve_cord datastack in the /home/user/path/to/volume/folder directory using the data from the OBJ file file.obj for the mesh.
INPUT:
import tracertools as tt
tt.make_local_volume_from_obj(
datastack="brain_and_nerve_cord",
obj_path="/home/user/path/to/file.obj",
output_path="/home/user/path/to/volume/folder"
)
OUTPUT: The volume will be created in the specified directory.