Browser-compatible WASM bindings to the Rust implementation of the Neuroglancer Precomputed n-dimensional tensor file storage format. This library is based on the n5-wasm and rust-n5 libraries and reused a lot of its infrastructure. Sharded datasets are supported.
NGPre datasets must be available via CORS-compatible HTTP.
Currently only zip and jpeg chunk compression is supported.
This assumes you have rustup installed.
git clone https://github.com/tomka/ngpre-wasm
cd ngpre-wasm
rustup override set nightly
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack build --target no-modules --release
echo "self.ngpre_wasm = wasm_bindgen;" >> pkg/ngpre_wasm.jsThe built npm package will be in pkg/.
Buld and update CATMAID:
wasm-pack build --target no-modules --debug && echo "self.ngpre_wasm = wasm_bindgen;" >> pkg/ngpre_wasm.js && cp pkg/ngpre_wasm_bg.wasm /django/applications/catmaid/static/libs/ngpre-wasm && cp pkg/ngpre_wasm.js /django/applications/catmaid/static/libs/ngpre-wasm
chromium --disable-web-security --user-data-dir=/tmp/google-chrome-user