itk-js: Create Image from Buffer

Hi everyone,

I have some application that transfert a json file that contains buffer of pixels, image dimension, spacing, origin and type of each pixels (int, unsigned int, etc…). I can’t use a standard format like nrrd, Nifti, etc…

Is it possible to create an Image in javascript from those informations? I didn’t find anything on the examples.

Thank you.

Hello Romain,

Yes, a JavaScript Object can just be created as described here:

http://insightsoftwareconsortium.github.io/itk-js/api/Image.html

HTH,
Matt

Hello Matt,

I just saw the documentation…
Thanks you so much :slight_smile:

1 Like

Hi there,
this link you have provided is not working for me. Is there a new location for the docs?

itk.js is currently undergoing refactoring, that might be the reason. @matt.mccormick should be back in office next week, he will know where are the old and new docs.

Hi,

The docs are now here:

itk.js is migrating to itk-wasm :sparkler: :sparkling_heart: . If you are coming from itk.js, please see the migration guide.

1 Like