Using occurrences seems a little complicated, but if it works it won't hurt anything.
You aren't using HSL or RGB images. Those are both color images. You are only dealing with grayscale and binary images.
What you need to do is create a second image using IMAQ create, and use it as the destination image when you threshold. This will keep the original grayscale image separate from the new binary image. If you don't do this, the binary image replaces the original grayscale. When you try to display a binary image using the grayscale palette, it looks all black because it is only 1s and 0s, instead of values up to 255.
Subtracting the binary image from the grayscale will not do much, since the values will only change
by 1 at most. Instead, you might want to look at masks or overlays. Another option would be to use the comparison operator to clear all values less than your threshold value.
Bruce
Bruce Ammons
Ammons Engineering