Example of loading images using itk-wasm?

I’m looking to render a 3D TIFF file using vtk.js, and I understand I can handle the reading of the images using itk-wasm, and then convert it to a VTK object. I’m struggling to understand from the itk-wasm API docs how I can do this though… can anyone point to a self contained example showing how I can read in a 3D TIFF file using itk-wasm?

Reading a 3D TIFF should not be different from reading a 3D NRRD or 3D MetaImage. Did you take a look at docs, section @itk-wasm/image-io? It has demo and doc links.

@jadh4v and @Forrest might provide more info.

Thanks, I did look at the @itk-wasm/image-io docs but it just seems to have API reference and no examples.

Have you seen itk-vtk-viewer? It is self-contained, though a bit big. Or these examples from the docs?

The vite example dzenanz linked to is good. The link to the actual code is broken sadly, but now here:

Another example, the itk-viewer repo uses itkwasm in a smaller code base.

First need to configure how to where to load .wasm files at runtime:

That runtime location is defined by vite in this repos case:

The actual call to readImage

If you have the time, feel free to open an issue or PR updating docs at the itk-wasm repo. =)

1 Like