fruitflybrain / neu3d Goto Github PK
View Code? Open in Web Editor NEWA javascript 3D visualization engine for neural data in SWC format
A javascript 3D visualization engine for neural data in SWC format
It might be useful to put some dividers (instead of folders which needs to unfold them to see them) to group, for example, opacity settings for highlight mode, opacity settings for pinned mode, size for radius, size for soma radius, size for synapse. This can make the settings for opacity and size a bit more understandable.
As title, update typing definition in typings/index.d.ts
addJSON should only resolve when threejs objects have been rendered.
For example, in these lines, the this.loadObjCallback
should return a promise. The promise of the addJSON callback should in turn depend on that promise.
The current side effect of this bug is that examples/activity.html
bugs out.
To replicate:
BG opacity
or wireframe opacity
Add capability to highlight both neurons and synapses.
Since the scene only contains objects that do not necessarily need to be rendered in an activate animation frame, could we benefit from using static rendering?
The specific changes are:
animate()
function. Specifically, remove call to requestAnimationFrame()
.TrackBallControl
to OrbitControl
.A preliminary test suggests that the performance difference is minimal, but worth a look.
A thread to trace performance enhancements.
as title
As title, perhaps consider removing Propman dependency since it is not actively maintained.
as title. add neu3d.dispose
logic
$('#' + this.container.id).on({
'dragover dragenter': function (e) {
e.preventDefault();
e.stopPropagation();
},
'drop': function (e) {
let dataTransfer = e.originalEvent.dataTransfer;
if (dataTransfer && dataTransfer.files.length) {
e.preventDefault();
e.stopPropagation();
$.each(dataTransfer.files, function (i, file) {
let reader = new FileReader();
reader.onload = $.proxy(function (file, event) {
if (file.name.match('.+(\.swc)$')) {
let name = file.name.split('.')[0];
let json = {};
json[name] = {
label: name,
dataStr: event.target.result,
filetype: 'swc'
};
ffbomesh.addJson({ ffbo_json: json });
}
}, this, file);
reader.readAsText(file);
});
}
}
});
was written to enable drag-dropping files onto the neu3d widget relies on container.id
being specified because it uses JQuery
.
Change this to use JavaScript's native method, see here
Line 342 in e9300cc
Neu3D currently handles loading data of a few formats, here we standardize the input data formats.
MorphologyData sent for multiple objects should be a dictionary with the rid of Morphology data as the key,
and each value is a dictionary with the following fields:
The following attributes will be applied to all except gltf files.
_registerObject
loadSWCCallBack
)Each row of the swcString
is assumed to be a length-7 array with each item corresponding to the following entries
sample | type | x | y | z | radius | parent |
---|---|---|---|---|---|---|
int | int | float | float | float | float | int |
parent = -1
indicates root
loadMeshCallBack
)loadMorphJSONCallBack
)MorphJSON is assumed to be a json of 7 fields (as below) where each field is an array of corresponding items.
sample | identifier | x | y | z | r | parent |
---|---|---|---|---|---|---|
int | int | float | float | float | float | int |
identifiers used for Neurons:
Synapses need to take the special format to start listing all presynaptic sites with parent -1 and followed by postsynaptic sites using sample of its presynaptic sites as parent, e.g.
sample | identifier | x | y | z | r | parent |
---|---|---|---|---|---|---|
1 | 7 | float | float | float | float | -1 |
2 | 7 | float | float | float | float | -1 |
3 | 7 | float | float | float | float | -1 |
4 | 8 | float | float | float | float | 1 |
5 | 8 | float | float | float | float | 2 |
6 | 8 | float | float | float | float | 3 |
loadGltfCallBack
)As title.
Change following code block to enable multiple file upload when clicking on the upload button.
let fileUploadInput = document.createElement('input');
fileUploadInput.id = "neu3d-file-upload";
fileUploadInput.setAttribute("type", "file");
fileUploadInput.style.visibility = 'hidden';
fileUploadInput.onchange = (evt) => {
$.each(evt.target.files, function (i, file) {
let reader = new FileReader();
reader.onload = $.proxy(function (file, event) {
if (file.name.match('.+(\.swc)$')) {
let name = file.name.split('.')[0];
let json = {};
json[name] = {
label: name,
dataStr: event.target.result,
filetype: 'swc'
};
ffbomesh.addJson({ ffbo_json: json });
}
}, this, file);
reader.readAsText(file);
});
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.