enh(viz): enhance transfer function editor
Description
- The transfer function editor currently requires the user to manually define the limits on the X axis in the configuration. That's not really user friendly. Because of that, it's possible to completely lose a point outside the range by moving it too far away. Note that here, I do not mean " initial extrema " but the " true " maximum range of the widget.
- Zooming on a specific part of the data is not properly handled. When scrolling up or down using the mouse wheel, the curve is deformed indeed, but the points of the transfer function are not, and neither is the horizontal axis.
Base | Scrolled up | Scrolled down |
---|---|---|
- Right-clicking on negato (2D or 3D) changes the transfer function, but does not update the widget in its integrity. Only the " bottom " part changes, not the editable points.
-
Closing the transfer function window and reopening it resets the transfer function (also shown above).
-
Changing a point colour sets its opacity to
1
. Honestly, I don't know if it's a bug or a feature but it's not ergonomic. -
Finally, the flag
STAY_ON_TOP
should probably not be applied. It makes other dialogues (file input etc.) go wild. -
Edit FB: when an image with many zeros are present, or any over-represented pixel value class, the
SCurveHistogram
fails to fit actual values, and in this precise example, negative values can be shown whereas there is no negative value. -
When resetting a custom-made TF which originates from an built-in one, the points are set to the ones of the built-in TF.
Proposal
Add axis on the right side of the window (similar to what's on the left, but range from -min value to -max value).
Functional specifications
Other dialogues should not be affected by the absence or presence of the transfer editor, especially their focus. See also #726.Re-opening the editor should not reset the current transfer function.- Move the TF editor to the right panel, like other settings. This will solve "by design" the two issues above.
- Value range should be dynamically computed.
- It should not be possible to move transfer function points outside the value range.
- Histogram should have a scale indicated somewhere.
- Changing a point colour should not change its opacity.
-
Editing the transfer function in a negato widget should properly update the editor.Edit FB: This has to be addressed in #877 (closed), the bug comes from the TF piecewise design. - Resetting a user-made TF should reset to the points saved, not the base " built-in " function.
Technical specifications
-
Move the TF editor to the right panel, like other settings. However, there might be some changes to bring to the layout features that do not provide a maximum size. -
Compute the range dynamically in SScaleValues. -
Block the move of points outside the value range. -
Keep the opacity from the previous color when editing point colors in SMultipleTF
(andSTransferFunction
) -
Displays the scale of the histogram with another axis -
Remove SCurveHistogram
adaptor. It is buggy and actually, it does not seem to be a good idea to smooth the values of an image histogram. We will use the classicalSHistogram
instead. -
We could take the opportunity to gather Histogram adaptors together, this might simplify stuff. There are no reason for them to be separated, STransferFunction
does the same thing in only one adaptor.
Test plan
- If the UI macro recorder is ready, implement some tests.
- If not, do manual testing.