Login  Register

How to auto adjust images in imageJ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

How to auto adjust images in imageJ?

Mohamed Tleis
Hello,

I would like to know How can I adjust the contrast and brightness in imageJ
using a Java application?
imageJ has

 ContrastAdjuster.java

and inside it an

 autoAdjust

function which is not public, so I cannot call it? any one has experience
with this?

Best Regards,
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to auto adjust images in imageJ?

Danny Misiak
Hello,

you can use the ImageProcessor's method resetMinAndMax() .

After calling this method, the image is auto adjustetd like the Image/Adjust in the ImageJ GUI.


Best regards.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to auto adjust images in imageJ?

Mohamed Tleis
Thank you Danny,

I just began developing in imageJ, and I only was able to open an image
through Opener.open(); But I am not succeeding in linking the opened image
with an image processor, I tried the following code:
[code]
ImagePlus imPlus = new ImagePlus();
ImageProcessor ip = imPlus.getChannelProcessor();
[/code]

In order to check, I printed the imPlus.height and it was zero.
So I understand that the function getChannelProcessor doen't get the opened
image.

Any help or tutorials about this topics?

Best Regards,


On Fri, Nov 4, 2011 at 10:45 AM, Danny Misiak <[hidden email]> wrote:

> Hello,
>
> you can use the ImageProcessor's method resetMinAndMax() .
>
> After calling this method, the image is auto adjustetd like the
> Image/Adjust in the ImageJ GUI.
>
>
> Best regards.
>
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to auto adjust images in imageJ?

Danny Misiak
In reply to this post by Mohamed Tleis
Hello Mohammed,

I remember that I used the ImagePlusReader or ImageProcessorReader from LOCI Tools / Bioformats. Take a look to this, maybe this will help you. I think there are several other ways to open a image.

http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/loci-plugins/utils/Read_Image.java


Best,
  Danny.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to auto adjust images in imageJ?

Mohamed Tleis
Thank you Danny,

Actually I did some search again, and I found that I have to use the
WindowManager.getCurrentImage() function as follows:

[code]
imPlus = WindowManager.getCurrentImage();
[/code]

Best Regards,
Moe Tleis

On Mon, Nov 7, 2011 at 9:28 AM, Danny Misiak <[hidden email]> wrote:

> Hello Mohammed,
>
> I remember that I used the ImagePlusReader or ImageProcessorReader from
> LOCI Tools / Bioformats. Take a look to this, maybe this will help you. I
> think there are several other ways to open a image.
>
>
> http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/loci-plugins/utils/Read_Image.java
>
>
> Best,
>  Danny.
>
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to auto adjust images in imageJ?

ctrueden
In reply to this post by Danny Misiak
Hi Danny,

I remember that I used the ImagePlusReader or ImageProcessorReader from
> LOCI Tools / Bioformats.
>

For those interested in using Bio-Formats to read images in an ImageJ
plugin, we added an easier API fairly recently: the loci.plugins.BF utility
class. For a simple example, see:

http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/loci-plugins/utils/Simple_Read.java

You can control which options the importer uses by constructing an
ImporterOptions object and passing that to the
BF.openImagePlus(ImporterOptions) method.

Regards,
Curtis


On Mon, Nov 7, 2011 at 2:28 AM, Danny Misiak <[hidden email]> wrote:

> Hello Mohammed,
>
> I remember that I used the ImagePlusReader or ImageProcessorReader from
> LOCI Tools / Bioformats. Take a look to this, maybe this will help you. I
> think there are several other ways to open a image.
>
>
> http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/loci-plugins/utils/Read_Image.java
>
>
> Best,
>   Danny.
>