IIPMooViewer

IIPMooViewer is a high performance Ajax-based javascript image streaming and zooming client for the IIPImage system compatible with Firefox / Mozilla (and other gecko-based browsers), Internet Explorer versions 6 & 7, Safari and Opera. It is based on the Mootools javascript framework. Version 1.1 of IIPMooViewer requires Mootools version 1.2. The distribution contains all the necessary library files in both compressed and uncompressed formats. Modify the parameters in the iipmooviewer.html example file provided.

Example Usage

Here is a very minimal html example:

<?xml version="1.0" encoding="UTF">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/iip.css" />
<script type="text/javascript" src="javascript/mootools-1.2-core.js"></script>
<script type="text/javascript" src="javascript/mootools-1.2-more.js"></script>
<script type="text/javascript" src="javascript/iipmooviewer-1.1.js"></script>

<script type="text/javascript">
iip = new IIP( "targetframe", { image: '/path/to/image.tif' } );
</script>
</head>
<body>
<div id="targetframe" style="width:99%;height:99%"></div>
</body>
</html>

Note that you must name the div within which the viewer will be embedded “targetframe” and that you must assign the variable “iip” to your newly created IIP object. The “targetframe” div can be positioned to whatever size and position you wish within your page. Unlike in version 1.0, it’s size must be specified independently. If mootools clashes with javascript in the rest of your page, consider putting the viewer within an iframe.

Options

The IIP constructor can take a range of options. The only mandatory option is to set the “image” path:

image:
The full system path to the image. On Windows as on other systems this should be a UNIX style path such as “/path/to/image.tif”. Note that this is an absolute system path and not the path relative to the webserver root
server:
The address of the IIPImage server. [default : "/fcgi-bin/iipsrv.fcgi"]
credit:
a credit, copyright or information to be shown on the image itself
zoom:
the initial zoom level on start-up
render:
the way in which tiles are rendered. Either ‘random’ where the tiles are fetched and rendered randomly or ‘spiral’ where the tiles are rendered from the center outwards [default : 'random']
showNavButtons:
whether to show the navigation buttons on start up: true or false [default : true]
scale:
pixels per mm

Note that the page must have a standard-compliant XHTML declaration at the beginning. There is an example HTML page included in the IIPMooViewer distribution: just unpack the distribution, modify the server and image paths to get it working.

Advanced Application Development

The viewer can also be used as a component within an imaging application. See the multispectral visualization example for a good example of how the viewer can be easily used to create an advanced custom application. In this example, image blending is accomplished by loading an array of images and dynamically changing the opacity level of a layer of tiles. The spectral graph is drawn within a <canvas> (or VML in IE) element created via the cross browser MooCanvas library.

Ajax Security

Note also that due to the Ajax security model, the IIP server must point to the same host as that from which your page has been served. If you want to host the IIP image server on a different machine, you will need to forward proxy requests to this other machine via your web server. See the server page for more details on how to do this.

Demo

See the demo page to see the client in action.

New in Version 1.1

  • Updated to use Mootools 1.2
  • Can now be embedded within page
  • Navigation buttons
  • Navigation window can be dragged anywhere within window
  • Support for image layers and image blending
  • Download progress bar
  • Several bug fixes
  • Cosmetic enhancements
  • etc.

Download

IIPMooViewer must be used in conjunction with the IIPImage server. You can download the latest versions of both the server and IIPMooViewer on the download page.

Flattr this




Donations appreciated Bookmark and Share
Get IIPImage at SourceForge.net. Fast, secure and Free Open Source software downloads