Skip to content

Commit

Permalink
Merge pull request #900 from rordenlab/maint/enable-wasm-zlib-and-bum…
Browse files Browse the repository at this point in the history
…p-version

add zlib to wasm compile command and bump version
  • Loading branch information
neurolabusc authored Dec 9, 2024
2 parents c9617a8 + d7654cb commit 108cafe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion console/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ noroi:
g++ $(CFLAGS) -I. $(JSFLAGS) $(JFLAGS) $(LFLAGS) $(UFILES) -DmyNoRois

wasm:
emcc -O3 $(UFILES) -s DEMANGLE_SUPPORT=1 -s EXPORTED_RUNTIME_METHODS='["callMain", "ccall", "cwrap", "FS", "FS_createDataFile", "FS_readFile", "FS_unlink", "allocateUTF8", "getValue", "stringToUTF8", "setValue"]' -s STACK_OVERFLOW_CHECK=2 -s STACK_SIZE=16MB -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS='["_main", "_malloc", "_free"]' -s FORCE_FILESYSTEM=1 -s INVOKE_RUN=0 -o ../js/src/dcm2niix.js
emcc -O3 $(UFILES) -lz -s USE_ZLIB -s DEMANGLE_SUPPORT=1 -s EXPORTED_RUNTIME_METHODS='["callMain", "ccall", "cwrap", "FS", "FS_createDataFile", "FS_readFile", "FS_unlink", "allocateUTF8", "getValue", "stringToUTF8", "setValue"]' -s STACK_OVERFLOW_CHECK=2 -s STACK_SIZE=16MB -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s EXPORT_ES6=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS='["_main", "_malloc", "_free"]' -s FORCE_FILESYSTEM=1 -s INVOKE_RUN=0 -o ../js/src/dcm2niix.js
# STACK_SIZE=16MB is the minimum value found to work with the current codebase when targeting WASM

2 changes: 1 addition & 1 deletion js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h1>dcm2niix WASM Demo</h1>
const t0 = performance.now();

const inputFileList = selectedFiles
const resultFileList = await dcm2niix.input(inputFileList).run()
const resultFileList = await dcm2niix.input(inputFileList).z('y').run()
console.log(resultFileList);

const t1 = performance.now();
Expand Down
4 changes: 2 additions & 2 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@niivue/dcm2niix",
"version": "0.1.1-dev.2",
"version": "1.0.0",
"main": "dist/index.js",
"module": "dist/index.js",
"exports": {
Expand Down

0 comments on commit 108cafe

Please sign in to comment.