Skip to content

Commit

Permalink
add support for zlib and mesh inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
hanayik committed Dec 9, 2024
1 parent 9f3a301 commit 85bb24e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions js/src/niimathOperators.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
"args": [],
"help": "reslice to 1mm size in coronal slice direction with 256^3 voxels"
},
"comply": {
"args": [
"nx",
"ny",
"nz",
"dx",
"dy",
"dz",
"f_high",
"isLinear"
],
"help": "conform to axial slice with dx*dy*dzmm size and dx*dy*dz voxels. f_high bright clamping (0.98 for top 2%). Linear (1) or nearest-neighbor (0)"
},
"crop": {
"args": [
"tmin",
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ sanitize:
$(CNAME) -O1 -g -Wno-deprecated -fsanitize=address -fno-omit-frame-pointer $(MFLAGS) $(UFLAGS) $(ZFLAGS) -o niimath

wasm:
emcc -O3 $(MFLAGS) $(UFLAGS) -s DEMANGLE_SUPPORT=1 -s EXPORTED_RUNTIME_METHODS='["callMain", "ccall", "cwrap", "FS_createDataFile", "FS_readFile", "FS_unlink", "allocateUTF8", "getValue", "stringToUTF8", "setValue"]' -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS='["_main", "_malloc", "_free"]' -s INVOKE_RUN=0 -o ../js/src/niimath.js
emcc -O3 $(MFLAGS) $(UFLAGS) $(ZFLAGS) -s USE_ZLIB=1 -s DEMANGLE_SUPPORT=1 -s EXPORTED_RUNTIME_METHODS='["callMain", "ccall", "cwrap", "FS_createDataFile", "FS_readFile", "FS_unlink", "allocateUTF8", "getValue", "stringToUTF8", "setValue"]' -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS='["_main", "_malloc", "_free"]' -s INVOKE_RUN=0 -o ../js/src/niimath.js
# hint: consider further optimizations:
# wasm-opt -O3 -o output.wasm niimath.wasm; rm niimath.wasm; mv output.wasm niimath.wasm

Expand Down

0 comments on commit 85bb24e

Please sign in to comment.