Good evening everyone.
I'm trying to do a plugin which in one part changes the brightness level and the contrast of an image with the data that the user enters. The plugin (among other things) basically does this: On imageJ you open an image, then open the plugin and the plugin ask for 2 numbers, one for brightness and another for contrast and when the user presses OK, the image changes automatically to another image with the new brightness and contrast levels. I know there's a function on ImageJ where you can adjust the contrast and brightness but in my plugin I want to do it without the menu that appears, only with the 2 numbers that I ask. I also know that there's another function called "Enhance contrast" but in that case I can only change the contrast. Can anyone help me? Thank you so much :) |
Good day Danae,
did you consider writing an ImageJ-macro to perform the tasks or is there a reason for using an ImageJ-plugin? Best Herbie ::::::::::::::::::::::::::::::::::: Am 10.10.16 um 16:39 schrieb Danae: > Good evening everyone. > > I'm trying to do a plugin which in one part changes the brightness > level and the contrast of an image with the data that the user > enters. The plugin (among other things) basically does this: > > On imageJ you open an image, then open the plugin and the plugin ask > for 2 numbers, one for brightness and another for contrast and when > the user presses OK, the image changes automatically to another image > with the new brightness and contrast levels. > > I know there's a function on ImageJ where you can adjust the contrast > and brightness but in my plugin I want to do it without the menu that > appears, only with the 2 numbers that I ask. I also know that there's > another function called "Enhance contrast" but in that case I can > only change the contrast. > > Can anyone help me? > > Thank you so much :) > > > > -- View this message in context: > http://imagej.1557.x6.nabble.com/Custom-brightness-contrast-on-a-image-tp5017336.html > > > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Good day Herbie!
I'm just learning how to program plugins for ImageJ in JAVA with Eclipse from the simplest things to other more complicated, in order to help improving plugins and help new developers in the future. |
well Danae,
you may use the Recorder-functionality of ImageJ to get an idea of the relevant Java calls. Don't forget to select "Java" in the recorder. Here is what I get for example when I change the contrast of an 8bit ramp image: ////////////////////////////////// import ij.*; import ij.process.*; import ij.gui.*; import java.awt.*; import ij.plugin.*; public class My_Plugin implements PlugIn { public void run(String arg) { ImagePlus imp = IJ.getImage(); IJ.setMinAndMax(imp, 73, 181); } } ////////////////////////////////// Besides, you should have an idea of how you define contrast. There are at least three different and common ways of doing so. Furthermore, you must consider whether you want to deal with different image types (RGB, gray 8bit, 16bit, 32bit)... Good luck Herbie ::::::::::::::::::::::::::::::::::: Am 10.10.16 um 17:43 schrieb Danae: > Good day Herbie! > > I'm just learning how to program plugins for ImageJ in JAVA with Eclipse > from the simplest things to other more complicated, in order to help > improving plugins and help new developers in the future. > > > > -- > View this message in context: http://imagej.1557.x6.nabble.com/Custom-brightness-contrast-on-a-image-tp5017336p5017339.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |