rsohlot / optviewer

Web viewer for 3D data in image stacks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OPT viewer
==========

This is a web-browser based viewer for 3d datasets that are stored as
stacks of images.

Most of the logic is implemented in client-side javascript so it is possible to
run this using a webserver that only serves static content. However for quick
setup and testing it is also possible to run this from a small Flask webapp
that pulls image data directly from unmodified dataset Zip archive files.

Installation using the Flask web application
--------------------------------------------
Setup a virtualenv with the necessary dependencies and run the webapp,

    # (apt-get or yum) install python-virtualenv
    $ virtualenv env
    $ env/bin/pip install -r requirements.txt

Update IMAGE_NAME in flaskapp.py to export data from zip archives in the
current folder that are named,

    <IMAGE_NAME>_Sagittal.zip
    <IMAGE_NAME>_Coronal.zip
    <IMAGE_NAME>_Transverse.zip

Start the Flask web application

    $ env/bin/python flaskapp.py runserver

Now you should be able to point your webbrowser at http://localhost:5000/ and
view the dataset.


Installation using static files
-------------------------------
Setup the Flask web application and run

    $ env/bin/python flaskapp.py make_static_site <path>

This will extract the datasets archives to <path>/<IMAGE_NAME>, copy the
javascript and image resources and renders the template to <path>/index.html.

If you want to relocate the image data it is possible to set optview.urls to
the appropriate values using FRAMEn to mark the location of the frame number.
f.i. FRAME3 will be replaced by a frame number that is padded to a 3-digit
number (i.e. 000, 001, etc). Available substitutions in the urls are NAME, PLANE
and FRAME1 through FRAME9. for instance

    optview = {
        name: "asset",
        urls: {
            'sagittal':   "NAME/1FRAME5.png",
            'coronal':    "NAME/2FRAME5.png",
            'transverse': "NAME/3FRAME5.png",
        }
    }

About

Web viewer for 3D data in image stacks

License:Other


Languages

Language:HTML 56.7%Language:Python 31.8%Language:JavaScript 11.5%