Skip to content

Commit

Permalink
add scripts and header to import to neurojson.io
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jun 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f621a52 commit 7c53fea
Showing 2 changed files with 55 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .neurojson.header.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"README_":{
"JMeshVersion":"0.5",
"Dimension":3,
"Comment":"Created by the NeuroJSON Project (https://neurojson.org)",
"AnnotationFormat":"https://neurojson.org/jmesh",
"SerialFormat":"http://json.org",
"Parser":{
"Python":[
"https://pypi.org/project/jdata",
"https://pypi.org/project/bjdata"
],
"MATLAB":"https://github.com/NeuroJSON/jsonlab",
"JavaScript":[
"https://github.com/NeuroJSON/jsdata",
"https://github.com/NeuroJSON/js-bjdata"
],
"CPP":"https://github.com/nlohmann/json",
"C":[
"https://github.com/DaveGamble/cJSON",
"https://github.com/NeuroJSON/ubj"
]
},
"Descriptions":"Created using Iso2Mesh 1.9.6 (http://iso2mesh.sf.net)",
"License":"Public Domain",
"Reference":{
"Iso2Mesh": "Qianqian Fang and David Boas, \"Tetrahedral mesh generation from volumetric binary and gray-scale images,\" Proceedings of IEEE International Symposium on Biomedical Imaging 2009, pp. 1142-1145, 2009",
"JMesh": "Yuxuan Zhang and Qianqian Fang, \"BlenderPhotonics: an integrated open-source software environment for three-dimensional meshing and photon simulations in complex tissues\", J. of Biomedical Optics, 27(8), 083014 (2022) doi: https://doi.org/10.1117/1.JBO.27.8.083014"
},
"SourceURL":"https://github.com/NeuroJSON/JMeshSamples",
"Creator":"Qianqian Fang, q.fang at neu.edu"
}
}
22 changes: 22 additions & 0 deletions .neurojson.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
## Author: Qianqian Fang, q.fang at neu.edu
## Format: .neurojson.io <https://username:password@couchdbserver:port> <databasename>

ORG="neurojson_jmesh_samples"
if [ ! -z "$1" ]; then
NIO=$1
fi

if [ ! -z "$2" ]; then
ORG=$2
fi

[ -f .neurojson.header.json ] && NIO_HEADER=.neurojson.header.json

ff=`find -name "*.jmsh"`
for f in $ff; do
outfile=`realpath --relative-to=${PWD} "$f" | sed -e 's/\//./g'`
outputjson="${f%/*}/${outfile%.*}.json"
(tr -d '\n' < "$f") | jq -s add $NIO_HEADER - | jq 'del(._DataInfo_)' > "$outputjson"
curl -X PUT -d@"$outputjson" $NIO/$ORG/${outfile%.*}
done

0 comments on commit 7c53fea

Please sign in to comment.