public void setBuffer() {

    IRasterDataSource dsetCopy = null;
    dsetCopy = rasterSE.getDataSource().newDataset();
    BufferFactory bufferFactory = new BufferFactory(dsetCopy);
    if (!RasterBuffer.loadInMemory(dsetCopy)) bufferFactory.setReadOnly(true);
    try {
      bufferFactory.setDrawableBands(this.bands);
      bufferFactory.setAreaOfInterest();
      buffer = bufferFactory.getRasterBuf();
    } catch (RasterDriverException e) {
      RasterToolsUtil.messageBoxError(
          PluginServices.getText(this, "raster_buffer_invalid_extension"), this, e);
    } catch (InterruptedException e) {
      RasterToolsUtil.messageBoxError(PluginServices.getText(this, "error_preview_stop"), this, e);
    }
  }