fruitflybrain / neu3d

A javascript 3D visualization engine for neural data in SWC format
7 stars 8 forks source link

Standarize Data Format #21

Closed TK-21st closed 2 years ago

TK-21st commented 4 years ago

Neu3D currently handles loading data of a few formats, here we standardize the input data formats.

Input format

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:

MeshDict Object (output items in MeshDict)

if loading from file

if loading from Obj

Morphology Transformations

The following attributes will be applied to all except gltf files.

Attributes added by _registerObject

SWC (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

type

parent = -1 indicates root

Mesh (loadMeshCallBack)

MorphJSON (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

GLTF (loadGltfCallBack)

TK-21st commented 2 years ago

@yiyin, related to my comment in #32, can you add in comments/edits to this issue?

yiyin commented 2 years ago

made some edits above

TK-21st commented 2 years ago

made some edits above

Great! Thanks! Will add this to a schema checker to object loader.

yiyin commented 2 years ago

Schema for MorphologyData (as of Neuroarch version 0.3.2)

'swc'

'mesh':

'obj'

not currently defined

TK-21st commented 2 years ago

Thanks @yiyin! Closed by 1a01f9450c0b46a6e2bf4fcd8b62dd97e9033520