The idea of my program is similar to the adjust brightness/contrast built-in plugin. I want to have the image in one window where you can see it with varying b/c values.
The original image should be saved before I make any changes to it so that I can go back to the original and make more changes to that instead of the new image created after using the setDisplayRange(), which revert the b/c settings back to how they were in the original. This should all happen in the same window. I don't want to create a new window each time to display the changes I make.
ImagePlus imp = WindowManager.getCurrentImage();
ImageProcessor ip = imp.getProcessor();
ip.snapshot();
imp.setDisplayRange(10, 30);
Thread.sleep(1000);
ip.reset();
Reading the API, I believe this should work and do what I want but it only changes the b/c without going back to what the original image was. I looked at the b/c code and this is seems to be what they did there too so I'm not sure what's really wrong here unless I am making a stupid mistake, misunderstanding what the snapshot and reset methods do?
Any help would be appreciated, thank you in advance.