<div dir="ltr">Dear all, <div><br></div><div>I have started using emscripten to develop a plugin to read medical images in the browser.</div><div><br></div><div>I have a compiled version of my code that works in Node.js. </div><div>I am able to read an image, manipulate the data and write the image. </div><div><br></div><div>However, whenever I tried to execute the same code in the browser, the itk::ImageReader seems to be creating a reader for PNG only. </div><div><br></div><div>This is an example code that I am execuitng:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="monospace, monospace">var itkImageJS = new module.itkImageJS();</font></div><div><div><font face="monospace, monospace">console.log("Installing file: ");</font></div></div><div><div><font face="monospace, monospace">var input_filepath = '/raw/test.nii.gz';</font></div></div><div><div><font face="monospace, monospace">FS.writeFile(input_filepath, imagedata, { encoding: 'binary' });</font></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><font face="monospace, monospace">var stat = FS.stat(input_filepath);//The file exists!</font><br></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace, monospace">itkImageJS.ReadImage(input_filepath);</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div></blockquote><font face="arial, helvetica, sans-serif">And this is the output from the exception: </font><div><font face="arial, helvetica, sans-serif"><br></font></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace, monospace">itk::ExceptionObject (0x6a5710)</font></div></div><div><div><font face="monospace, monospace">testFS.js:1 Location: "unknown" </font></div></div><div><div><font face="monospace, monospace">testFS.js:1 File: .../ITK/Modules/IO/PNG/src/itkPNGImageIO.cxx</font></div></div><div><div><font face="monospace, monospace">testFS.js:1 Line: 107</font></div></div><div><div><font face="monospace, monospace">testFS.js:1 Description: itk::ERROR: PNGImageIO(0x975628): PNGImageIO failed to read header for file: </font></div></div><div><div><font face="monospace, monospace">testFS.js:1 Reason: fread read only 0 instead of 8</font></div></div><div><font face="monospace, monospace"><br></font></div></blockquote><font face="arial, helvetica, sans-serif">Instead of creating the reader for a Nifti image, the reader is for PNG image. </font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Is it possible to read other type of files in the browser?</font></div><div><font face="arial, helvetica, sans-serif">Do I have to read the data server side and stream it to the client?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Any comments or suggestions will be greatly appreciated. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Best regards, </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Juan</font></div></div>