Skip to content
chafey edited this page Mar 23, 2014 · 11 revisions

An ImageLoader is a javascript plugin that is responsible for taking an ImageId for an image and returning the corresponding pixel data for that image to cornerstone.

TODO: Finish the ImageLoader design and document it here

General flow:

  • ImageLoaders register themselves with cornerstone to load specific ImageId URL schemes
  • When cornerstone needs to load the pixel data for an ImageId, it will look up the ImageLoader registered with the URL scheme in the ImageId and call the ImageLoader with the ImageId
  • The ImageLoader will return a deferred which it will resolve once the pixel data has been fetched. When resolved, it will return an Image Object to cornerstone.

The live examples use an ImageLoader plugin to server up images for these examples without requiring a server at all. In this case, the images are base64 encoded and stored in the ImageLoader plugin itself. The plugin simply converts the base64 pixel data into an array of pixels.

NOTE: It is anticipated that a WADO ImageLoader plugin will be created to allow cornerstone to talk directly to a WADO server.