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