This script is an extension to the regular profile tool.
The standard profile tool extracts a 1D profile from a 2D image (or of the 2D displayed slice of a 3D/4D/5D data set)
This tool works only on 3D data (i.e. Spectrum-Images) and extracts 2D data from the selected area, effectively creating a 'line-scan' SI data out of a 3D SI.
Similar to the standard tool, the 2D line-scan profile stays linked with the source-data marker and updates if the marker is moved, or resized; or if the averaging is changed; or if the source data is changed.
On a 3D data set (SI) either draw a ROI line or extract a line profile with the standard line profile tool. Then run the script to convert The ROI or LineProfile into a 3D LineProfile. Use the marker the same way as for the standard lineprofile (i.e. move/resize/double-click to change properties, or use +/- key to change averaging.) Use the extracted SI profile exactly as an acquired SI line scan.
Optional: If a standard profile is converted, launching the script with the SHIFT key pressed will keep linkage to the 1D profile, too.