Hello ImageJ folks,
I've been using ImageJ for several months now, developing aspects of Micromanager, especially camera and color image support. It's a crucial part of our system, of course.
I am having trouble setting brightness and contrast of color images; essentially, the max value can be decreased, making the image look saturated, but the only way to restore the full dynamic range seems to be to reload the image from the disk or the camera.
I know that ImageJ does have a Brightness and Contrast control which seems to work just fine, but I can't see what that is doing differently from our Micromanager Contrast Panel
It seems as though Micromanager is somehow inadvertantly calling the "Set" or "Apply" functionality, but of course I've checked that we're not.
I have been able to duplicate a similar problem entirely outside of Micromanager as follows:
(It does use the BeanShell interpreter, however)
0. identify an RGB [0,255] tiff, e.g. download the following:
http://upload.wikimedia.org/wikipedia/commons/f/fa/TIFF_file_format_test.tif1. put ij.jar, bsh-2.0b4.jar into the same directory.
2. at a command prompt issue the following command:
java -cp bsh-2.0b4.jar;ij.jar; bsh.Interpreter ////// Windows
java -cp bsh-2.0b4.jar:ij.jar: bsh.Interpreter ////// Unix / OS X
3. enter the following commands:
import ij.*;
import ij.ImagePlus;
show();
ij1 = new ImageJ();
5. This will launch ImageJ; From ImageJ's File menu open the RGB TIFF image
6. Verify that it's displayed correctly.
7. Then issue the follow commands in the beanshell workspace:
imageplus = IJ.getImage();
imageplus.setDisplayRange(0.,255.);
imageplus.updateAndRepaintWindow(); // all okay here
imageplus.setDisplayRange(0.,25.);
imageplus.updateAndRepaintWindow(); // now image looks saturated
imageplus.setDisplayRange(0.,255.);
imageplus.updateAndRepaintWindow(); // image data has been lost at this point, only way
// i've found is to reload from the disk
(before step 3. you could also issue the " desktop(); " command to use the beanshell workspace - command editing is better there.)
Best Regards,
Karl Hoover