google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.06k stars 294 forks source link

Generating Meshes from Precomputed Labels #293

Open atomized1 opened 3 years ago

atomized1 commented 3 years ago

I generated precomputed labels based on nifti files using neuroglancer-scripts. Is there a way I can generate meshes using these in neuroglancer to also be displayed?

Currently my output looks like this SampleOutput

xgui3783 commented 3 years ago

You will need to do some metadata wrangling:

Then, in the viewer side, on select a fragment (hover and double click on a fragment), you should see the mesh loading.

If not, check the console, it should give you some hint on what went wrong.

atomized1 commented 3 years ago

Thank you so much for your help. I can see that it is looking for a file with a name like 1:0. I am on a windows machine, and cannot name a file that. Is there an alternative way of formatting this?

jbms commented 3 years ago

I hadn't thought about the issue of colons on Windows. Currently there is not, though it would probably make sense to add an option to the precomputed format metadata to do that. The :0 was originally intended to support multiple levels of detail, but that was later implemented a different way.

However, it turns out that the Windows NTFS filesystem supports something called "alternate data streams" which is indicated by filename:stream. So I think you can actually create a stream named "0" of a file named "12345" which will be opened with the path "12345:0". When you list the directory, it will just show "12345".

xgui3783 commented 3 years ago

@atomized1 if you are using the nginx config either from https://github.com/HumanBrainProject/neuroglancer-docker or https://hub.docker.com/r/ylep/neuroglancer , you can instead name the file 1, 12345 the nginx conf takes care of the :0 part

atomized1 commented 3 years ago

jbms's solution worked, and it can now see the file. It read the 1:0 file and looks for the files mentioned under fragments. My last question is just if examples of these fragment files are available so I can see if I am formatting mine correctly.