Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU based Image registration with itk-wasm #979

Open
sedghi opened this issue Oct 19, 2023 · 2 comments
Open

GPU based Image registration with itk-wasm #979

sedghi opened this issue Oct 19, 2023 · 2 comments

Comments

@sedghi
Copy link

sedghi commented Oct 19, 2023

I have a question about WASM and GPU. On the web, JavaScript is currently the primary means of interacting with the GPU, I believe. Therefore, JavaScript should inject functions into WASM in order to achieve this. Am I right?

Does itk-wasm support porting the GPU methods in ITK? I'm mainly interested in GPU based image registration. For instance this one GPUDemonsRegistrationFilter

And lastly, do you happen to know any other ITK non-linear GPU based image registration methods? gpu based rigid or affine

@thewtex
Copy link
Member

thewtex commented Oct 20, 2023

Hi,

Yes, WebAssembly currently does not have general GPU support. However, it does support calling function references that are provided as imports. In the browser, these are JavaScript functions. General compute support in web browsers is available through WebGPU, which has JavaScript APIs, which can be called in WebAssembly (and the Emscripten toolchain has some nice tooling to help automate some of this).

The GPU methods in ITK are OpenCL-based, which is not available in the browser. In the future, these will be migrated to WebGPU.

However, if you are just looking for "fast" registration, algorithms often out-perform brute force compute. The @itk-wasm/elastix package is a good place to look:

https://itk-wasm-elastix-app-js.on.fleek.co/

https://github.com/InsightSoftwareConsortium/ITKElastix

@sedghi
Copy link
Author

sedghi commented Oct 20, 2023

The itk-wasm-elastix is exactly what I'm looking for. I prioritize a fast browser-based registration and don't require a GPU-based solution, as you mentioned.

Thank you for your prompt response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants