     @dfs = undefined
     
     @wfits.setCalibrations(1, 1, 1)
-    scales = @opts.scales or @defaultScales
+    
+    # Get settings or fallback to defaults
+    scales  = @opts.scales or @defaultScales
+    alpha   = @opts.alpha or @defaultAlpha
+    Q       = @opts.q or @defaultQ
+    min     = @opts.extent.min or gMin
+    max     = @opts.extent.max or gMax
+    
     @wfits.setScales.apply(@wfits, scales)
-    @wfits.setAlpha(@opts.alpha or @defaultAlpha)
-    @wfits.setQ(@opts.q or @defaultQ)
-    @wfits.setExtent(gMin, gMax)
+    @wfits.setAlpha(alpha)
+    @wfits.setQ(Q)
+    @wfits.setExtent(min, max)
     
     # Enable mouse controls
     @wfits.setupControls({

        })
    })
    
    # Default to color composite
    @wfits.drawColor('i', 'r', 'g')
    @trigger 'swviewer:loaded'
  
  updateBand: =>
    console.log 'updateBand'
    if @wfits?
      band = @opts.band
      if band is 'gri'
        @wfits.drawColor('i', 'r', 'g')
      else
        # Compute the min/max of the image set
        unless @collection.hasExtent
          mins = @collection.map( (l) -> return l.get('minimum'))
          maxs = @collection.map( (l) -> return l.get('maximum'))
          @min = Math.min.apply(Math, mins)
          @max = Math.max.apply(Math, maxs)
          @wfits.setExtent(@min, @max)
          @collection.hasExtent = true
        
        @wfits.setImage(band)
        @wfits.setStretch(@opts.stretch)
  

    @wfits?.setStretch(@stretch)

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


window.Ubret.SpacewarpViewer = SpacewarpViewer
