/hsi-data-generator

A generator for artificial hyperspectral image data.

Primary LanguageC++

HSI Data Generator

A tool for generating for artificial hyperspectral image data. Allows the user to define a spectral dictionary and a 2D image layout. This can then be exported to generate a binary HSI file.

Installation

Required Libraries and Tools

  • Qt 5+ (macOS: brew install qt). QtCreator is not required.
  • CMake (version 2.8+).

Build Instructions

git clone https://github.com/teammcr192/hsi-data-generator.git
cd hsi-data-generator
mdkir build
cd build
cmake ..
make

Common Issues

  • CMake cannot find Qt on macOS: try running cmake .. -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.8.0_2/ in place of cmake ... Modify the version as needed.
  • Build in release mode: use cmake .. -DCMAKE_BUILD_TYPE=Release. This can make the code run faster.
  • If you choose not to use CMake for whatever reason, make sure to define the preprocessor macro ROOT_CODE_DIRECTORY as the root code directory (i.e. /path/to/hsi-data-generator). This is the directory containing the qt_stylesheets, resources, and src directories. Omitting this may cause issues when running the code.

Usage

Run the binary (bin/HSIDataGenerator) after building the code.

The GUI is organized into three tabs. An overview is provided below.

Class Spectra Tab

This tab allows you to define a spectral dictionary. Each spectrum is a class, and the final image will be constructed as combination of these spectra.

Image Layout Tab

This tab allows you to define an image layout, which presents a 2D view of how the spectra will be organized in the final output.

Export Tab

This tab is where you can specify any final touches, such as spectral noise that will be added to the data, and save the final binary image. Currently, all images are exported in the following HSI format:

interleave      = bsq
data type       = float
byte order      = 0
header offset   = 0
  • Interleave is BSQ (band-sequential).
  • All data points are stored as floats.
  • Byte order is little endian.
  • The header is exported separately, and is not stored as a part of the data file.