Giter Club home page Giter Club logo

volumeraycasting's Introduction

Volume Rendering for the Browser

See it in action!

This project aims to develop a powerful real-time volume rendering engine for the browser.

MRI rendered using a specular shader

This is accomplished using volume ray casting, implemented in WebGL 2.

MRI rendered using an edge-detect shader

A variety of shaders exist, from basic maximum-intensity projection to photorealistic graphics.

Photorealistic rendering of a head

How do I render my own data?

I am planning to implement a better way to do this, but for now, you'll have to clone the project and edit the code to add your own images.

First, have a look at webgl2/images/sagittal.png. Slices from the image data are tiled into one image top-down, then left-right. Multiple columns are sometimes necessary because browsers have limits on the maximum size of a <canvas> element.

To generate such an image, ImageMagick is a powerful tool.

Once you have generated your image, add an entry to the volumes variable in webgl2/js/raycasting.js:

var volumes = {
    sagittal: {                        // any variable name
         src: "./images/sagittal.png"  // path to your image
        ,name: "Brain - Water"         // a (somewhat) descriptive name
        ,columns: 2                    // number of columns by which your tiles are arranged
        ,slices: 176                   // number of total image slices
        ,zScale: 0.7                   // ratio of distance between slices to distance between pixels
    }
    // ...
}

When you refresh the page, you should now see your volume in the drop down list.

Volume Generator

For testing, there's a volume generator, which might also be interesting for other projects working with volume data.

CPU-Only version

Before implementing this project in WebGL, I wrote a volume renderer in pure CPU-side, single-threaded JavaScript.

Volume rendering on the CPU

With some tweaking, I managed to get it running at 60fps on my old ThinkPad.

Previous work

This project is the successor of earlier experiments with volume rendering by drawing point clouds:
GitHub, Web

Disclaimer

This is an experimental project developed by someone who has no real experience or training in medical imaging.
It is not intended or suitable for clinical use.

volumeraycasting's People

Contributors

rolandr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

volumeraycasting's Issues

zScale definition

Hi @RolandR !
I used your volume rendering engine for my data and the z orientaion is longer than actual. Maybe zScale is not ratio of distance between slices to distance between pixels. I think it is ratio of distance between pixels to distance between slices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.