Hacking ITK-Wasm#

Thank you for contributing a pull request!

Welcome to the ITK community!

We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines.

Build dependencies#

Building#

To build itk-wasm itself:

npm install
npm run build

Run the tests:

npm test

Serve the documentation:

npm i -g docsify
docsify serve ./docs/

Create a debug build (see also: the debugging example):

# pull the latest debug Docker images
./src/docker/pull.sh
git clean -fdx
npm install
npm run build:debug

To step into itk-wasm source from a browser Wasm module: In the C/C++ DevTools browser extension, add a path substitution for /ITKWebAssemblyInterface/ that points to the root directory of your itk-wasm repository. This is in addition to the /work/ substitution for your Wasm module’s source code.

Example: /ITKWebAssemblyInterface/ -> /home/dingbat/src/itk-wasm/

Add test data#

To prevent Git repository bloat, we add testing data through CMake content links of Content Identifiers (CIDs). To add new test data,

  1. Upload the data and download its content link .cid file with the CMake w3 ExternalData Upload Tool

  2. Move the .cid file to itk-wasm/test/Input/

  3. Reference the content link with a DATA{<path>} call in itk-wasm/test/CMakeLists.txt.

Contributing#

We use semantic-release for handling the change log and version. Therefore, we recommend using the following command line when creating a commit:

$ npm run commit

Otherwise you can follow the specification available here.