           #
           labelmapTypeCtl.onChange (value) ->
             _index = labelmapTypes.indexOf(value)
-            
             # Now we (re-)load the selected label map files.
             if _index > 0
-              labelmapFilename: labelmapFiles[_index]
+              labelmapData: null
+              colortableData: null
+              labelmapFilename = overlays[_index].labelmap.temp_accessor
+              labelmapFilename: labelmapFilename
               labelmapFile = File.read(labelmapFilename, responseType: 'arraybuffer').then (labelmapData) =>
                 # Set the data property to the label map file content.
                 @labelmapData = labelmapData
-              colortableFilename: colortableFiles[_index]
+              colortableFilename = overlays[_index].colortable.temp_accessor
+              colortableFilename: colortableFilename
               colortableFile = File.read(colortableFilename, responseType: 'arraybuffer').then (colortableData) =>
                 # Set the data property to the color table file content.
                 @colortableData = colortableData
-              volume.labelmap.colortable.file = colortableFiles[_index]
               volume.labelmap.file = @labelmapFilename
               volume.labelmap.filedata = @labelmapData
               volume.labelmap.colortable.file = @colortableFilename

    # @param timePoint the series time point
    # @returns a new image object
    create = (parent, filename, timePoint) ->

      # Temporary hard-coded filepaths to the label map and color table.
      labelmapFilename = 'data/QIN_Test/k_trans_map.nii.gz'
      colortableFilename = 'data/QIN_Test/generic-colors.txt'

      parent: parent
      filename: filename

          # Display the label map (overlay) controls.
          labelmapCtls = gui.addFolder('Overlay')
          labelmapTypeCtl = labelmapCtls.add(_loader, 'Type', labelmapTypes).name('Type')
          labelmapOpacityCtl = labelmapCtls.add(volume.labelmap, 'opacity', 0, 1).name('Opacity')
          labelmapCtls.open()

          # Change the label map type callback.
