       @model.user.briConNames.push(@datasetPostfix)
       @model.user.brightness.push(@settings.brightness)
       @model.user.contrast.push(@settings.contrast)
-      @dataSetPosition = data.briConNames.length - 1
+      @dataSetPosition = @user.briConNames.length - 1
 
 
     @gui = new dat.GUI(autoPlace: false, width : 280, hideable : false, closed : true)

    for i in [0..(@qualityArray.length - 1)]
      if @qualityArray[i] == value
        value = i
    @setNumber("quality", value)

  setComment : (value) =>
    @model.route.setComment(value)

    stringPos = Math.round(globalPos[0]) + ", " + Math.round(globalPos[1]) + ", " + Math.round(globalPos[2])
    $("#trace-position-input").val(stringPos)

  set : (name, value, type) =>
    @model.user.setValue( name, (type) value)

  setBrightnessAndContrast : =>
    @model.binary.updateLookupTable(@settings.brightness, @settings.contrast)
