Can you retrieve values from the Log window in a macro?

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

Can you retrieve values from the Log window in a macro?

HoweLab
Hi.

I am writing a macro that uses a number of plugins (right now, I'm using Gabriel Landini's Convex Hull Plus extensively), all of which return values into the Log window. Is there some way of reading those values so the macro can use them for later steps? If not, is there a way for a macro to directly retrieve the value of a variable directly from the plugin code? I do not know how to program in Java, otherwise I would just make my own plugin and borrow the relevant bits of code.

Thanks, in advance, for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Can you retrieve values from the Log window in a macro?

Mario Faretta
Hi,
I solved the problem just printing to a text file to be saved (or to
save the Log Window) and retrieve the values opening it and splitting
using the split(string, delimiter) function.
Another possibility is to update a string with delimiters that you can
use later to separate the different info.
Hope it helps
Mario

HoweLab wrote:

> Hi.
>
> I am writing a macro that uses a number of plugins (right now, I'm using
> Gabriel Landini's Convex Hull Plus extensively), all of which return values
> into the Log window. Is there some way of reading those values so the macro
> can use them for later steps? If not, is there a way for a macro to directly
> retrieve the value of a variable directly from the plugin code? I do not
> know how to program in Java, otherwise I would just make my own plugin and
> borrow the relevant bits of code.
>
> Thanks, in advance, for your help.
>  


--
Mario Faretta
Department of Experimental Oncology
European Institute of Oncology
c/o IFOM-IEO Campus for Oncogenomics
via Adamello 16
20139 Milan
Italy
Phone: ++39-02574303054
email: [hidden email]
http://www.ifom-ieo-campus.it
Reply | Threaded
Open this post in threaded view
|

Re: Can you retrieve values from the Log window in a macro?

Gabriel Landini
In reply to this post by HoweLab
On Wednesday 14 October 2009  11:53:06 HoweLab wrote:
> I am writing a macro that uses a number of plugins (right now, I'm using
> Gabriel Landini's Convex Hull Plus extensively), all of which return values
> into the Log window. Is there some way of reading those values so the macro
> can use them for later steps?
Hi,
which values do you want to retrieve? Maybe the Particles8 plugin returns
these into the ResultsTable.

CHull: Convex Hull or convex polygon calculated from pixel centres. (This
value is the same as the perimeter only for rectangular particles),
CArea: Area of the Convex Hull polygon,

and some other.

Although thinking about it, that would not work only if you are analysing the
convex disconnected components.
Regards

G.
Reply | Threaded
Open this post in threaded view
|

Re: Can you retrieve values from the Log window in a macro?

HoweLab
Hi Gabriel.

We're specifically interested in getting the 3-point data (x, y, r) for the minimum bounding circle (MBC) generated by your plugin, then having the macro do a whole host of downstream functions with those parameters.

I was up until ~3am last night playing around. At first, I just opened up a dialog box so the user could enter the values manually. This works fine, but obviously limits the automation of the process. I finally came up with what appears to be a reasonable solution, in that I simply add the MBC to the ROI manager, then pulled the relevant numbers, with a few calculations, from there. Seems to work fine, but I'm sure there are better ways to do it.

Thanks for your help (& your contributions to the community).
-Alan

P.S. Thanks to the other users that responded - always very good advice.

Gabriel Landini wrote
On Wednesday 14 October 2009  11:53:06 HoweLab wrote:
> I am writing a macro that uses a number of plugins (right now, I'm using
> Gabriel Landini's Convex Hull Plus extensively), all of which return values
> into the Log window. Is there some way of reading those values so the macro
> can use them for later steps?
Hi,
which values do you want to retrieve? Maybe the Particles8 plugin returns
these into the ResultsTable.

CHull: Convex Hull or convex polygon calculated from pixel centres. (This
value is the same as the perimeter only for rectangular particles),
CArea: Area of the Convex Hull polygon,

and some other.

Although thinking about it, that would not work only if you are analysing the
convex disconnected components.
Regards

G.
Reply | Threaded
Open this post in threaded view
|

Re: Can you retrieve values from the Log window in a macro?

Gabriel Landini
On Wednesday 14 October 2009  14:32:56 HoweLab wrote:
> We're specifically interested in getting the 3-point data (x, y, r) for the
> minimum bounding circle (MBC) generated by your plugin, then having the
> macro do a whole host of downstream functions with those parameters.

You can get those in a table from the Particles8 plugin (click on the
morhology option),  if your set is all connected (i.e. if the object is only 1
particle, rather than many particles).
Those parameters are returned as MBCX, MBCY and MBCRadius.

Does that help?

G