I'd like to share another script. This one is kind of a silly little script that may or may not end up being handy.
Sometime I want to apply a view's STF via a Histogram Transformation, ie, map a linear image to a nonlinear image using the view's current STF.
Doing this now seems a bit tedious to me: Open a HT instance, open a STF instance, make sure the STF instance reflects the target view, drag the STF's instance icon to the HT, reset the view's STF and then apply the HT.
If there is a faster way now to do this in PI, please let me know. :-)
If not, you can try this script. It attempts to do this with a single button click.
Do this once: Run the script, drag its instance icon to your workspace and rename it appropriately.
Then when you want to apply a STF drag the icon to the target view and click Apply. That's it.
You will see the view's STF blink to the reset state and then after a moment when HT completes you will see the original view, but now in its nonlinear and reset STF state.
Note: I think the script converts STF parameters to HT parameters properly. By trial and error I found I needed to twiddle the matrix. If it does not work correctly for you please let me know and I will try it again. The alpha channel (if any) is left unchanged, which I think is the right thing to do.
Update: 0.2 bug fix.
Update: 0.3 HT now ignores mask (if present) to match STF AutoStretch behavior.