Exporting Selections of Cubes

After selecting one or more pixels in a cube, for example like this:

_images/data_viewer_export_selection_primary_view.png

The Export selection button is now available. Clicking it will open a new window that allows the user to export only the pixels belonging to the current selection of the cube:

_images/data_viewer_export_selection_window.png

The top left of the window contains a preview of the selection that will be exported.

At the bottom of the window the user has three options for exporting the current selection:

  • Save as will save the selection as a new HSI cube. The user will first be asked in what format to save the cube and whether to save the cube as intensities or reflectances:

    _images/data_viewer_export_selection_cube_output_format.png

    If the selection is exactly a rectangle, the data type of the cube will be kept as-is and the exported cube will just be a cropped version of the original cube.

    If the selection is not a rectangle (for example an ellipse) the exported cube will be converted to a floating-point data type, so that pixels not belonging to the selection can be set to NaN.

    When storing as intensities, the references of the cube will also be cropped accordingly so they match the exported cube, and the adjusted references will be stored anlongside the exported cube.

  • Use as new cube will perform the same cropping algorithm described in the Save as case, but instead of saving the cube to disk, the cropped cube will be added to the list of currently loaded cubes in the project.

  • Export average as spectrum will average all selected pixels into a single spectrum and save that in a format the user can select. As with Save as the user is shown the format selection window; but instead of cube formats the user will be able to choose from spectral formats.

Using either one of these buttons will close the window after the operation has completed.

On the right hand side of the window the user may select a cube and use this selection to replace the white reference of another cube that has already been loaded into the project. For this first select the target cube from the list of all cubes in the right, and then press the Use as white reference for button. Doing this will close the window. This feature is only available

If the user does not want to export the current selection after all, they may simple close the window.

Note

Only the raw data of the cube (at most converted to reflectances if chosen) will be saved when using this feature. If the user has stepped forward to a filter that displays data in a different manner, that will not be the data that will be exported.