   events:
     'next' : 'nextPage getNextSubject'
     'prev' : 'prevPage getNextSubject'
-  
+    'setting:alpha' : 'updateAlpha'
+    'setting:q' : 'updateQ'
+    'setting:scale' : 'updateScale'
+    'setting:extent' : 'updateExtent'
   
   constructor: (selector) ->
     _.extend @, Ubret.Sequential

  start: =>
    console.log 'start'

  setBand: (band) =>
    if band is 'gri'
      @wfits.drawColor('i', 'r', 'g')
    else

      @wfits.setImage(band)
      @wfits.setStretch(@stretch)
  
  updateAlpha: =>
    @wfits.setAlpha(@opts.alpha)
    
  updateQ: =>
    @wfits.setQ(@opts.q)
    
  updateScale: =>
    band = @opts.scale.band
    value = @opts.scale.value

    scales = @collection.getColorScales()
    index = if band is 'i' then 0 else if band is 'g' then 1 else 2
    scales[index] = value
    @wfits.setScales.apply(@wfits, scales)
  
  updateStretch: =>
    @stretch = @opts.stretch
    @wfits.setStretch(@stretch)

  getExtent: (value) ->
    return (@max - @min) * value / 1000

  updateExtent: =>
    min = @opts.extent.min
    max = @opts.extent.max
    @wfits.setExtent(min, max)


