Skip to content
chafey edited this page Mar 21, 2014 · 7 revisions

Each image enabled element has a viewport which describes how the image should be rendered. The viewport for an image enabled element can be obtained via the getViewport() function and set using the setViewport() function. The viewport parameters are:

  • scale - The scale applied to the image. A scale of 1.0 will display no zoom (one image pixel takes up one screen pixel). A scale of 2.0 will be double zoom and a scale of .5 will be zoomed out by 2x
  • centerX - The pan offset from the center of the image in image pixels.
  • centerY - The pan offset from the center of the image in image pixels.
  • windowWidth - The window width to apply to grayscale images.
  • windowCenter - The window center to apply to grayscale images

TODO:

  • Add invert
  • Add rotation
  • Add flip

It may make more sense to combine the related attributes into an object like this:

  • scale - The scale applied to the image. A scale of 1.0 will display no zoom (one image pixel takes up one screen pixel). TODO: Figure out how this works with retina
  • center - An object that describes the pan offset from the center of the image in image pixels.
    • x - the x offset
    • y - the y offset
  • voi - The VOI lut to apply to gray scale images.
    • windowWidth - the window width
    • windowCenter - the window center