NiftiViewer

Just by looking at my blog entries, one can easily tell that Web development isn’t my main activity, however I do it from time to time, when I see a need (or a business niche) 😉 This time I would like to present you a purely client-side HTML5-based Nifti file viewer service. It uses HTML5 FileReader class to access files without uploading them to any server and then a <canvas> element to render three orthogonal cross sections in a way that you’re used to on any medical image viewer. Acknowledgements: I used jDataView as an abstraction layer to JS typed arrays, Sylvester for matrix calculations and as usual jQuery to handle DOM, events, etc. Actually I’d like to give a big shout to jQuery as it’s such an amazing library and I honestly can’t imaging any single Web project without it. Enough said, below you will find a link to the service (which also becomes part of the header menu of my blog) and to some example Nifti files from SPM5 which you can use to test it. The limitations currently are: support for 3 dimensions only and no overlays. Otherwise you can open as many images as you’d like and navigate around them in a synchronized way. It’s a useful tool to quickly take a look at your Nifti files without downloading any software! Enjoy!

NiftiViewer: http://algoholic.eu/NiftiViewer/
Example Nifti files: example_nii.zip

Fine Print: This is actually copyrighted software so if you’d like to use it on your website, let me know and we can negotiate. But it’s completely free to use it here and as Nifti preview tool it should be enough in 99% of scenarios just to link here, right? 😉

6 Comments

  • Hi! I want to use this nice viewer for my website (with some patches like layer support). Is there any terms you want? Then could you let me know it?

  • Hi, I recently wrote DICOM to Nifti conversion scripts in Lua for my Conquest DICOM server (1.4.17) that could be called from its web interface. Combining this with your code may be an opportunity to add a simple 3D DICOM web viewer to Conquest. Let me know if you are interested. Marcel

  • Hello.
    I’m doing a Web App in my thesis and I would like to use some of your code, including some variations made by me, so that I can create a Viewer that meets my needs.
    Can you contact me in such a way we can establish an agreement?
    Greetings

  • Hi,
    I am doing a web app in my research study, and I need to generate the png images from your nifti file. can u please contact me to respectively negotiate.
    Best

    • It’s very easy to do using canvas.toDataURL(). The link generated by that call can be displayed for the user to click and download the image.


Leave a Reply

Your email address will not be published. Required fields are marked *