Re: Issues with real-time display in ImageJ

Posted by MRivers on
URL: http://imagej.273.s1.nabble.com/Issues-with-real-time-display-in-ImageJ-tp5022793p5022801.html

Hi Christian,

Thanks for the comment.  I have changed my code to do the following when displaying RGB images:

- Call ImagePlus::getDisplayRangeMin() and ImagePlus::getDisplayRangeMax().
- That returns the current setting of the range in the Image/Contrast control
- If those are 0 and 255 it does nothing and leaves the image pixels unchanged
- If these are not 0 and 255 then it does the following:
   - Constructs a 256 entry lookup table (LUT) that goes from the min to the max
   - Translates every pixel in the image through this LUT
 
For efficiency it only creates a new LUT if the min and max have changed from the previous time it created the LUT.

Contrary to your expectation this has no measureable impact on the frame rate.  Without the LUT my plugin displays 90 frames/s of 1024x1024 RGB images.  With the LUT it also displays 90 frames/s.  This rate means I can run GigE cameras at their full frame rate (that saturates the GigE network) and ImageJ can keep up displaying every image.

Thanks for your hint about the lookup table, it allowed me to solve that problem.

Mark

-----Original Message-----
From: Phase GmbH <[hidden email]>
Sent: Thursday, December 19, 2019 10:51 AM
To: Mark Rivers <[hidden email]>
Subject: Issues with real-time display in ImageJ

Dear Mark,

Image/Ajustment ... of monochrome images is performed in ImageJ by adjusting the look-up table associated with the image. The pixel values remain unchanged, only the display is changed. The look-up table is an array consisting of 256 elements for each RGB channel. You may also use look-up tables to psycho-colourize a monochrome image or image stream.
There are lot of predefined look-up table in ImageJ.

RGB images do not have a  look-up table so any pixel is recalculated according to the actual adjustment setting. Any new image would over-write the previous one. If you want to preserve some settings you have to apply it to any new frame. This is a time-consuming operation which will drop your frame rate seriously.


Regards

Christian Kreutzfeldt

--

+++++++++++++++++++++++++++++
PHASE GmbH
Bluecherstr. 2 , 23564 Luebeck, Germany
Tel. 0451-792744, Fax 792644
www.phase-hl.com
[hidden email]
--------------------------------------------------
Amtsgericht Lübeck, HRB 2484
Geschäftsführer Dr. Christian Kreutzfeldt

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