ImageProcessor.getForegroundValue()??

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageProcessor.getForegroundValue()??

Kenneth Sloan-2
Is it possible to get the current foreground value from an ImageProcessor?

I'm writing a small utility class to do graphics on an ImageProcessor, using an associated calibration.  For almost all of the methods, I depend on the user to use ip.setValue() or the like, and draw with the established foreground value.  But, one of my methods is "drawShadedTriangle", which necessarily changes the foreground value.  I'd like to fetch the existing foreground value and re-establish it when done.

I see setValue() and getBackgroundValue(), but I can't find getForegroundValue().  This time, I checked the field summary, but didn't find any help there.

Any help?

For the time being, I'm simply going to document that "drawShadedTriangle() changes the foreground value to an indeterminate value".  But, that seems ugly.

Oh...BTW - I can't access the NIH site - is this a known problem that is being fixed?

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ImageProcessor.getForegroundValue()??

Wayne Rasband-2
> On Apr 23, 2020, at 4:51 PM, Kenneth Sloan <[hidden email]> wrote:
>
> Is it possible to get the current foreground value from an ImageProcessor?

The ImageJ 1.53a13 daily build adds an ImageProcessor.getForegroundValue() method.

> I'm writing a small utility class to do graphics on an ImageProcessor, using an associated calibration.  For almost all of the methods, I depend on the user to use ip.setValue() or the like, and draw with the established foreground value.  But, one of my methods is "drawShadedTriangle", which necessarily changes the foreground value.  I'd like to fetch the existing foreground value and re-establish it when done.
>
> I see setValue() and getBackgroundValue(), but I can't find getForegroundValue().  This time, I checked the field summary, but didn't find any help there.
>
> Any help?
>
> For the time being, I'm simply going to document that "drawShadedTriangle() changes the foreground value to an indeterminate value".  But, that seems ugly.
>
> Oh...BTW - I can't access the NIH site - is this a known problem that is being fixed?

This is a known problem. In the meantime, use the mirror at <http://mirror.imagej.net/>.

-wayne
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html