Difference between revisions of "ViSUS WebViewer"
|  (Created page with "You can visualize interactively your data from a browser putting a simple javascript script in your webpage, as in the following example:  <pre> <html>  <head>     <meta chars...") | |||
| Line 32: | Line 32: | ||
| You can see a live demo of this script at this [http://rawgit.com/sci-visus/visus_javascript/master/david.html link]. | You can see a live demo of this script at this [http://rawgit.com/sci-visus/visus_javascript/master/david.html link]. | ||
| + | |||
| + | To customize the viewer script to visualize your data you need to change the getTileSources parameter accordingly: | ||
| + | |||
| + | ''getTileSources(server_URL, dataset_name, x_dim, y_dim,  bitmask_length-1, tile_size, false)'' | ||
| + | |||
| + | In particular the ''bitmask_length'' can be obtained counting the digits in the (bitmask) field of your IDX file. | ||
| For more code examples go to our GitHub repo: [https://github.com/sci-visus/visus_javascript GItHub ViSUS WebViewer] | For more code examples go to our GitHub repo: [https://github.com/sci-visus/visus_javascript GItHub ViSUS WebViewer] | ||
Revision as of 23:28, 8 August 2017
You can visualize interactively your data from a browser putting a simple javascript script in your webpage, as in the following example:
<html>
<head>
    <meta charset='utf-8'>
    <title>David Powered by Visus</title>
    <script src="https://openseadragon.github.io/openseadragon/openseadragon.min.js"></script>
    <script src="visus2.js" ></script>
</head>
<body>
    <div id="openseadragon1" class="openseadragon" style="width:100%; height:100%;background-color: black;"></div>
    <script type="text/javascript">
        var bXRoad=false;
        OpenSeadragon({
            id: "openseadragon1",
            prefixUrl: "https://raw.githubusercontent.com/openseadragon/svg-overlay/master/openseadragon/images/",
            showNavigator: true,
            debugMode: false,
            tileSources: getTileSources("http://atlantis.sci.utah.edu", "david_subsampled", 29280, 70416, 32, 512, bXRoad)
        });
    </script>
</body>
</html>
This will include a ViSUS WebViewer in your page that will allow to navigate one or more high resolution images (i.e. in this example the dataset called "david_subsampled").
You can see a live demo of this script at this link.
To customize the viewer script to visualize your data you need to change the getTileSources parameter accordingly:
getTileSources(server_URL, dataset_name, x_dim, y_dim, bitmask_length-1, tile_size, false)
In particular the bitmask_length can be obtained counting the digits in the (bitmask) field of your IDX file.
For more code examples go to our GitHub repo: GItHub ViSUS WebViewer
