labelling skeleton nodes/links by ROI / downloading ROI mask data

201 views
Skip to first unread message

Andrew Lin

unread,
Apr 8, 2020, 1:28:58 PM4/8/20
to neuPrint
Hello all,

I would like to be able to label particular links or nodes in neuron's skeletons according to which brain region (region of interest or ROI) they belong to. I haven't found a neuprint function that does this, but I understand one can download the ROI segmentation of the hemibrain. I got as far as downloading .shard files from gs://neuroglancer-janelia-flyem-hemibrain/v1.0/rois, which I understand are in Neuroglancer compressed segmentation format. I found this: https://github.com/google/neuroglancer/tree/master/src/neuroglancer/sliceview/compressed_segmentation but I don't know what to do with it. How do you run the de-compression, or access the data inside the .shard file?  (I suppose actually decompressing them would create a ridiculously huge file?)

Alternatively, I understand one can download a mesh surface of each ROI using fetch_roi_mesh in neuprint_python, but it also says this is not suitable for quantitative analysis - can anyone explain why not?

Or is there perhaps some other way to label the links or nodes of a neuron's skeleton according to ROI?

Many thanks,
Andrew

Greg Jefferis

unread,
Apr 8, 2020, 7:16:19 PM4/8/20
to neuPrint
Dear Andrew,

No official role here, but we have developed an R client (http://natverse.org/neuprintr/) that provides an interface with our natverse (http://natverse.org) suite of tools for R.

I assume the issue with using meshes for analysis is that they sometimes overlap a little and there may be more gaps. See the example below in which about 2 % of nodes are outside all neuropil meshes or present in 2 adjacent meshes.

All the best,

Greg.


library(natverse)
library(neuprintr)

# read in the meshes and name the result 
roinames=neuprint_ROIs(superLevel = T)
hemibrain.super.rois=nlapply(roinames, neuprint_ROI_mesh)
names(hemibrain.super.rois)=roinames

# a couple of sample neurons
mbons01 <- neuprint_read_skeletons('type:MBON01')

# for each point in the neuron find which rois it overlaps
roi.overlap.1 <-
  sapply(hemibrain.super.rois, function(roi)
    pointsinside(mbons01[[1]], roi))

# summary of how many rois are associated with each point
table(rowSums(roi.overlap.1 ))

    0     1     2 
 1347 55824  1233 
Message has been deleted
Message has been deleted

Stuart Berg

unread,
Apr 10, 2020, 8:20:01 PM4/10/20
to neuPrint
Hi Andrew,

The most precise way to assign points to ROIs is to refer to ROI segmentation.  But downloading the ROI segmentation from DVID or from the precomputed neuroglancer store might be a bit of a nuisance, so I've extracted the volume into hdf5 format in the following tar file:

https://storage.cloud.google.com/hemibrain/v1.0/hemibrain-v1.0.1-primary-roi-segmentation.tar.gz

It contains a README and example python script demonstrating exactly what you're looking for.  Let me know if you have any questions or run into any problems.

The segmentation in the above tarfile contains the exact ROI segments that were used to populate the neuprint server.  As noted in the README, our ROI segments are defined at a lower resolution than the full-res data, so the volume is not too huge.  (The tar file is under 10 MB, and the enclosed volume uncompresses to ~2 GB when loaded into RAM.)

BTW, the reason we advise against using neuprint's ROI meshes for analysis is that they have been smoothed and simplified (decimated) for nicer viewing.  That means the mesh boundaries do not correspond exactly to the ROI segments.

Best regards,
Stuart


Stuart Berg

unread,
Jun 21, 2020, 10:06:49 PM6/21/20
to neuPrint
Update: In the v1.1 hemibrain release, a few of the ROI shapes have been edited.  The updated volume has been exported to the following link:



Reply all
Reply to author
Forward
0 new messages