ImageJ "Make Binary "

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageJ "Make Binary "

kataner
HI there,
i hope you can help me. I'm new too ImageJ and trying to use some of the functions in a program i have to write. I tried to find a good way to run the "make binary" command but couldn't find a way. Maybe i ask too early but it would be great if someone could help me with this. Nice would be Java-Code.

Greetings kataner

P.S.: Excuse my bad english
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ "Make Binary "

Mathias Zech
Hi,

I use that functionality in the following way:

private ImagePlus createBinary(ImagePlus img, boolean scale) {
        log.log(Level.FINEST, "Creating Binary Image");
        BinaryProcessor proc = new BinaryProcessor(new
ByteProcessor(img.getImage()));
        proc.autoThreshold();
       
        log.log(Level.FINEST, "Created Binary Image");
        return new ImagePlus(img.getTitle(), proc);
    } //createBinary

There might be an easier way to do this but this works for me!

Greetings,
Mathias

kataner wrote:

> HI there,
> i hope you can help me. I'm new too ImageJ and trying to use some of the
> functions in a program i have to write. I tried to find a good way to run
> the "make binary" command but couldn't find a way. Maybe i ask too early but
> it would be great if someone could help me with this. Nice would be
> Java-Code.
>
> Greetings kataner
>
> P.S.: Excuse my bad english
>  
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ "Make Binary "

Michael Doube
In reply to this post by kataner
Kataner,

You can run any ImageJ menu command within your plugin code with:

IJ.run("A Plugin");

In your case it is:

IJ.run("Make Binary", "calculate");

(if you want to use the calculate option...)

To find out what to put in the run("") string, use the macro recorder
Plugins->Macros->Record... while running the menu command you want to use.

Cheers

Mike

kataner wrote:

> HI there,
> i hope you can help me. I'm new too ImageJ and trying to use some of the
> functions in a program i have to write. I tried to find a good way to run
> the "make binary" command but couldn't find a way. Maybe i ask too early but
> it would be great if someone could help me with this. Nice would be
> Java-Code.
>
> Greetings kataner
>
> P.S.: Excuse my bad english
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ "Make Binary "

Poojith Jain
In reply to this post by kataner
IJ.run("Make Binary");

On Thu, May 14, 2009 at 11:35 AM, kataner <[hidden email]> wrote:

> HI there,
> i hope you can help me. I'm new too ImageJ and trying to use some of the
> functions in a program i have to write. I tried to find a good way to run
> the "make binary" command but couldn't find a way. Maybe i ask too early but
> it would be great if someone could help me with this. Nice would be
> Java-Code.
>
> Greetings kataner
>
> P.S.: Excuse my bad english
> --
> View this message in context: http://n2.nabble.com/ImageJ-%22Make-Binary-%22-tp2889103p2889103.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>