
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@janelia/sharkviewer
Advanced tools
09-26-2014 - Synapse Annotations. Load annotations from a separate file with format "x y z\n" for each annotation. You can use annotation_parser(annotation_text) to parse it into the format [{'x': x, 'y': y, 'z':z}, {'x': x1, 'y': y1, 'z':z1}, ..., {'x': xn, 'y': yn, 'z':zn}] and load that into the annotation property of SharkViewer.
08-08-2014 - Three.js loader version: html/js/sharkviewer_loader.js If you want to use the neuron rendered from SharkViewer in another scene use this version. html/Shark_Viewer_Loader_Version.html shows an example of how to use it.
06-18-2014 - Serverless SharkViewer! Now the html/Shark_Viewer.html file allows you to load and view your own SWC files without a server. Simply download the repository and open Shark_Viewer.html in a browser, then use the form to view your own SWC files.
SharkViewer is a web-based viewer for SWC neuron files. It is written entirely in JavaScript using Three.js. To view SWC format guidelines visit: http://research.mssm.edu/cnic/swc.html
http://janeliascicomp.github.io/SharkViewer/
npm install
npm run start
npm install @janelia/sharkviewer
import SharkViewer, { swcParser } from sharkViewer;
var s = new sharkViewer({ dom_element: 'container' });
s.init();
s.animate();
const swcJSON = swcParser(swcText);
s.loadNeuron('neuron_name', '#ff0000', swcJSON);
<script src="three.min.js"></script>
<script src="shark_viewer.js"></script>
var s = new sharkViewer.default({ swc: swc, dom_element: 'container' });
s.init();
s.animate();
var swcJSON = sharkViewer.swcParser(swcTxt); ;
s.loadNeuron('neuron_name', '#ff0000', swcJSON);
lib/index.html shows an example of this setup.
Create a new SharkViewer instance to display a collection of neurons.
dom_element - html element that will receive the webgl canvas
mode - sphere (full 3-D rendering for nodes and connections, slow), particle (uses particle system to speed rendering and make it look better), or skeleton (no nodes, just connections, very fast)
show_cones - show cones between cylinders for particle and sphere mode
colors - color array for display, nodes of type 0 show as first color, etc.
[
0x00be9e,
0x3919cb,
0x7d0bc4,
0xff6700,
0x3eef00,
0xffce00,
0xf50027,
0x606060,
]
metadata - array of javascript objects with labels and type numbers to display as legend (type number matches to type column in swc file) format:
[{"label":"undefined","type":0},{"label":"soma","type":1}]
[{'x': x, 'y': y, 'z':z}, {'x': x1, 'y': y1, 'z':z1}, ..., {'x': xn, 'y': yn, 'z':zn}]
annotation_color - color to display annotations
Default 0x111111
Parse SWC files into a JSON format for loading into the viewer.
Load a neuron SWC JSON object into the viewer and center the camera around it.
swc json object: {
id : {
type: <type number of node (string)>,
x: <x position of node (float)>,
y: <y position of node (float)>,
z: <z position of node (float)>,
parent: <id number of node parent (-1 if no parent)>,
radius: <radius of node (float)>,
}
}
Remove the neuron from memory and stop displaying it.
Show or hide the neuron object, without removing it from the scene.
SharkViewer was originally written by Charlotte Weaver (weaverc10@janelia.hhmi.org) and Christopher Bruns (brunsc@janelia.hhmi.org)
FAQs
SWC neuron file viewer
The npm package @janelia/sharkviewer receives a total of 11 weekly downloads. As such, @janelia/sharkviewer popularity was classified as not popular.
We found that @janelia/sharkviewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.