Hello, I'm developing a plugin, and I need to use the method Huang for thresholding. But when I try doing:
IJ.run("Threshold...", "Huang Apply") nothing, the window is open but the method it isn't runned. I have tried with: IJ.run("Threshold...", "method='Huang'") IJ.run("Threshold...", "threshold='Huang'") and IJ.run("Threshold","Huang'") too, but nothing. I hope you can help me. Thanks in advance! Gadea |
Hello,
try setAutoThreshold("Huang"); run("Convert to Mask"); You can use the macro recorder to find out how to apply macro commands (menu Plugins>Macros>Record) Volker On 26/06/12 16:06, gadea wrote: > Hello, I'm developing a plugin, and I need to use the method Huang for > thresholding. But when I try doing: > > IJ.run("Threshold...", "Huang Apply") > > nothing, the window is open but the method it isn't runned. > > I have tried with: > > IJ.run("Threshold...", "method='Huang'") > IJ.run("Threshold...", "threshold='Huang'") > and IJ.run("Threshold","Huang'") too, but nothing. > > I hope you can help me. > > Thanks in advance! > > Gadea > > > -- > View this message in context: http://imagej.1557.n6.nabble.com/Problem-with-IJ-run-Threshold-tp4999217.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 |
In reply to this post by gadea
Hi Gadea,
using the Macro recorder (Plugins>Macros>Record...), switching to 'Record: Plugin' and then executing Image>Adjust>Threshold, I got the following code that should do what you expect: IJ.setAutoThreshold(imp, "Huang"); Hth, Jan On 26.06.2012 4:06 PM, gadea wrote: > Hello, I'm developing a plugin, and I need to use the method Huang for > thresholding. But when I try doing: > > IJ.run("Threshold...", "Huang Apply") > > nothing, the window is open but the method it isn't runned. > > I have tried with: > > IJ.run("Threshold...", "method='Huang'") > IJ.run("Threshold...", "threshold='Huang'") > and IJ.run("Threshold","Huang'") too, but nothing. > > I hope you can help me. > > Thanks in advance! > > Gadea > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by gadea
Dear Gadea,
On 26.06.2012 16:06, gadea wrote: > Hello, I'm developing a plugin, and I need to use the method Huang for > thresholding. But when I try doing: > > IJ.run("Threshold...", "Huang Apply") > > nothing, the window is open but the method it isn't runned. > > I have tried with: > > IJ.run("Threshold...", "method='Huang'") > IJ.run("Threshold...", "threshold='Huang'") > and IJ.run("Threshold","Huang'") too, but nothing. to solve issues like this, just use the built-in macro recorder: 1) open your image 2) record a new macro (Plugins -> Macros -> Record) 3) switch from "Macro" to "Plugin" in the recorder window 4) open the Threshold dialog (Shift-Ctrl-T) and select your values 5) click Apply The corresponding Java commands are now shown in the recorder window. Cheers ~Niko -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hello!
it's perfect! thanks to all! Sincerely, Gadea |
In reply to this post by Volker Baecker
Hi Gadea,
You can set the macro recorder to record as plugin. Please see attached image. Below are the output from the recorder when it was set to record "Plugin": IJ.setAutoThreshold(imp,"Huang"); IJ.run(imp, "Convert to Mask", ""); Best Regards, John ________________________________________ From: ImageJ Interest Group [[hidden email]] On Behalf Of Volker Baecker [[hidden email]] Sent: Tuesday, June 26, 2012 10:31 PM To: [hidden email] Subject: Re: Problem with IJ.run("Threshold...") Hello, try setAutoThreshold("Huang"); run("Convert to Mask"); You can use the macro recorder to find out how to apply macro commands (menu Plugins>Macros>Record) Volker On 26/06/12 16:06, gadea wrote: > Hello, I'm developing a plugin, and I need to use the method Huang for > thresholding. But when I try doing: > > IJ.run("Threshold...", "Huang Apply") > > nothing, the window is open but the method it isn't runned. > > I have tried with: > > IJ.run("Threshold...", "method='Huang'") > IJ.run("Threshold...", "threshold='Huang'") > and IJ.run("Threshold","Huang'") too, but nothing. > > I hope you can help me. > > Thanks in advance! > > Gadea > > > -- > View this message in context: http://imagej.1557.n6.nabble.com/Problem-with-IJ-run-Threshold-tp4999217.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 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |