Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neuroglancer link generation #11

Open
stuarteberg opened this issue Apr 2, 2020 · 0 comments
Open

Neuroglancer link generation #11

stuarteberg opened this issue Apr 2, 2020 · 0 comments

Comments

@stuarteberg
Copy link
Collaborator

stuarteberg commented Apr 2, 2020

It should be relatively easy to write a convenience function to programmatically generate neuroglancer links showing selected bodies, ROIs, and perhaps synapses.

Here's an example neuroglancer link.

And here's a script that parses neuroglancer links into human-readable form.

And here's what the human-readable version of the above link looks like.
https://hemibrain-dot-neuroglancer-demo.appspot.com/#!    
{
    "dimensions": {
        "x": [
            8e-09,
            "m"
        ],
        "y": [
            8e-09,
            "m"
        ],
        "z": [
            8e-09,
            "m"
        ]
    },
    "position": [
        25055.619140625,
        20692.138671875,
        15192.470703125
    ],
    "crossSectionScale": 66.24585188318474,
    "crossSectionDepth": -37.62185354999912,
    "projectionOrientation": [
        -0.21849310398101807,
        0.07027091830968857,
        0.08402863889932632,
        0.9696710705757141
    ],
    "projectionScale": 39285.54718181589,
    "layers": [
        {
            "type": "image",
            "source": "precomputed://gs://neuroglancer-janelia-flyem-hemibrain/emdata/clahe_yz/jpeg",
            "name": "emdata"
        },
        {
            "type": "segmentation",
            "source": "precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation",
            "segments": [
                "910442723",
                "915273354"
            ],
            "name": "segmentation"
        },
        {
            "type": "segmentation",
            "source": {
                "url": "precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/rois",
                "subsources": {
                    "default": true,
                    "properties": true,
                    "mesh": true
                },
                "enableDefaultSubsources": false
            },
            "pick": false,
            "saturation": 0.59,
            "objectAlpha": 0.8,
            "ignoreNullVisibleSet": false,
            "colorSeed": 2685294016,
            "meshSilhouetteRendering": 3,
            "segments": [
                "20",
                "36"
            ],
            "name": "roi"
        },
        {
            "type": "annotation",
            "source": "precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/synapses",
            "tab": "rendering",
            "shader": "#uicontrol vec3 preColor color(default=\"red\")\n#uicontrol vec3 postColor color(default=\"blue\")\n#uicontrol float preConfidence slider(min=0_ max=1_ default=0)\n#uicontrol float postConfidence slider(min=0_ max=1_ default=0)\n\nvoid main() {\n  setColor(defaultColor());\n  setEndpointMarkerColor(\n    vec4(preColor_ 0.5)_\n    vec4(postColor_ 0.5));\n  setEndpointMarkerSize(2.0_ 2.0);\n  setLineWidth(2.0);\n  if (prop_pre_synaptic_confidence()< preConfidence ||\n      prop_post_synaptic_confidence()< postConfidence) discard;\n}\n",
            "ignoreNullSegmentFilter": false,
            "linkedSegmentationLayer": {
                "pre_synaptic_cell": "segmentation",
                "post_synaptic_cell": "segmentation"
            },
            "filterBySegmentation": [
                "post,synaptic,cell",
                "pre,synaptic,cell"
            ],
            "name": "synapse",
            "visible": false
        },
        {
            "type": "segmentation",
            "source": "precomputed://gs://neuroglancer-janelia-flyem-hemibrain/mito_20190717.27250582",
            "tab": "segments",
            "pick": false,
            "selectedAlpha": 0.82,
            "name": "mito",
            "visible": false
        },
        {
            "type": "segmentation",
            "source": "precomputed://gs://neuroglancer-janelia-flyem-hemibrain/mask_normalized_round6",
            "tab": "segments",
            "pick": false,
            "selectedAlpha": 0.53,
            "segments": [
                "2"
            ],
            "name": "mask",
            "visible": false
        }
    ],
    "showSlices": false,
    "selectedLayer": {
        "layer": "roi",
        "visible": true,
        "size": 290
    },
    "layout": "4panel",
    "selection": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant