Grabbing output from 'GLCM_Texture'?

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

Grabbing output from 'GLCM_Texture'?

Weller Andrew Francis
Dear all,

I am trying to save the output from the 'GLCM_Texture' plugin as a
variable but can't seem to do it!? It outputs results to the Results
table as:

Angular Second Moment         0.03393919269384904
Contrast                      35.74723277177291
etc...

but if I:

run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
correlation inverse entropy");
asm = getResult("Angular Second Moment");
etc...

nothing is saved and there's a problem?! I've seen in the code that the
Angular Second Moment is stored as "asm", so I've changed my macro
accordingly:

run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
correlation inverse entropy");
asm = getResult(asm);
etc...

but still nothing is saved?!

How can I grab and store these results as a variable?

Many thanks, Andy
Reply | Threaded
Open this post in threaded view
|

Re: Grabbing output from 'GLCM_Texture'?

leo durosemont
You should use the getResult() macro function with two parameters as documented in the BuiltIn Macro Functions web page like this :
getResult("Column", row);

Unfortunately, the GLCM_Texture plugin uses the IJ.write function which adds plain lines to the results table, and these data are not grabbable by the getResults() function. You could edit this plugin to have these values either printed to the Log window where you can later get them by getInfo() or put in additionnal columns in the results table itself (better). Then they can be accessed by getResult("col",row);

Leo.


Andy Weller <[hidden email]> wrote: Dear all,

I am trying to save the output from the 'GLCM_Texture' plugin as a
variable but can't seem to do it!? It outputs results to the Results
table as:

Angular Second Moment         0.03393919269384904
Contrast                      35.74723277177291
etc...

but if I:

run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
correlation inverse entropy");
asm = getResult("Angular Second Moment");
etc...

nothing is saved and there's a problem?! I've seen in the code that the
Angular Second Moment is stored as "asm", so I've changed my macro
accordingly:

run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
correlation inverse entropy");
asm = getResult(asm);
etc...

but still nothing is saved?!

How can I grab and store these results as a variable?

Many thanks, Andy


 
---------------------------------
Want to be your own boss? Learn how on  Yahoo! Small Business.
Reply | Threaded
Open this post in threaded view
|

Re: Grabbing output from 'GLCM_Texture'?

Cabrera, Julio (NIH/NCI) [E]
In reply to this post by Weller Andrew Francis
Andy,
I had a similar problem when calling the plugin from a macro. In my case the plugin doesn't even run when called from a macro.
Can you run the plugin from a macro?
If you could figure it out I will appreciate it so I can change the plugin accordingly.


Julio Cabrera, Ph.D.
National Cancer Institute-Frederick
Gene Regulation and Chromosome Biology Lab.
Building 469/127
PO Box B, Frederick, MD 21702
USA
Phone: 301-846-1976
Fax:     301-846-1456



> ----------
> From: Andy Weller
> Reply To: List IMAGEJ
> Sent: Friday, July 7, 2006 9:21 AM
> To: List IMAGEJ
> Subject: Grabbing output from 'GLCM_Texture'?
>
> Dear all,
>
> I am trying to save the output from the 'GLCM_Texture' plugin as a
> variable but can't seem to do it!? It outputs results to the Results
> table as:
>
> Angular Second Moment         0.03393919269384904
> Contrast                      35.74723277177291
> etc...
>
> but if I:
>
> run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
> correlation inverse entropy");
> asm = getResult("Angular Second Moment");
> etc...
>
> nothing is saved and there's a problem?! I've seen in the code that the
> Angular Second Moment is stored as "asm", so I've changed my macro
> accordingly:
>
> run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
> correlation inverse entropy");
> asm = getResult(asm);
> etc...
>
> but still nothing is saved?!
>
> How can I grab and store these results as a variable?
>
> Many thanks, Andy
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Grabbing output from 'GLCM_Texture'?

Wayne Rasband
In reply to this post by Weller Andrew Francis
There is an updated version of the "GLCM Texture" plugin (v0.4) that
works with macros and stacks.

       http://rsb.info.nih.gov/ij/plugins/texture.html

-wayne

On Jul 7, 2006, at 9:21 AM, Andy Weller wrote:

> Dear all,
>
> I am trying to save the output from the 'GLCM_Texture' plugin
> as a variable but can't seem to do it!? It outputs results to the
> Results table as:
>
> Angular Second Moment         0.03393919269384904
> Contrast                      35.74723277177291
> etc...
>
> but if I:
>
> run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
> correlation inverse entropy");
> asm = getResult("Angular Second Moment");
> etc...
>
> nothing is saved and there's a problem?! I've seen in the code that
> the Angular Second Moment is stored as "asm", so I've changed
> my macro accordingly:
>
> run("GLCM Texture", "enter=1 select=[0 degrees] angular contrast
> correlation inverse entropy");
> asm = getResult(asm);
> etc...
>
> but still nothing is saved?!
>
> How can I grab and store these results as a variable?
>
> Many thanks, Andy
>
Reply | Threaded
Open this post in threaded view
|

Moment Calculator

Weller Andrew Francis
Excellent - thanks for the updated "GLCM Texture" plugin.

Maybe a similar thing is happening with the "Moment Calculator" plugin.
On running manually it seems fine, but as a macro the results are empty.
I get either "0" or "NaN".

How can I change this to make it macro-able?

Thanks, Andy

On Fri, 2006-07-07 at 13:20 -0400, Wayne Rasband wrote:
> There is an updated version of the "GLCM Texture" plugin (v0.4) that
> works with macros and stacks.
>
>        http://rsb.info.nih.gov/ij/plugins/texture.html
>
> -wayne
Reply | Threaded
Open this post in threaded view
|

Re: Moment Calculator

Weller Andrew Francis
Dear all,

Maybe there is a problem due to "Duplicate keywords"?!

When I record this macro a "Recorder" dialog box comes up with:

-----
Duplicate keyword:
   Command: "Moment Calculator"
   Keyword: " centre"
   Value:
Add an underscore to the corresponding label in the dialog to make the
first word unique.
-----

This is the same for keywords: " variance", " skewness", " kurtosis" and
"enter" which has a value of "1.0000".

I have looked in source code to see if I can add an underscore to update
this plugin, but these variables aren't there?!

I am a little lost with this - any suggestions?

Thanks, Andy

On Mon, 2006-07-10 at 17:26 +0200, Andy Weller wrote:

> Excellent - thanks for the updated "GLCM Texture" plugin.
>
> Maybe a similar thing is happening with the "Moment Calculator" plugin.
> On running manually it seems fine, but as a macro the results are empty.
> I get either "0" or "NaN".
>
> How can I change this to make it macro-able?
>
> Thanks, Andy
>
> On Fri, 2006-07-07 at 13:20 -0400, Wayne Rasband wrote:
> > There is an updated version of the "GLCM Texture" plugin (v0.4) that
> > works with macros and stacks.
> >
> >        http://rsb.info.nih.gov/ij/plugins/texture.html
> >
> > -wayne

--
Dr. Andy Weller
ETH Zurich
Geological Institute
CAB E 64
Universitaetstrasse 6
8092 Zurich, Switzerland

[hidden email]
www.erdw.ethz.ch/Weller

+41 44 632 84 12 office
+41 44 632 36 82 lab
+41 76 426 36 99 mobile
+41 44 632 10 80 fax
Reply | Threaded
Open this post in threaded view
|

Re: Moment Calculator

Wayne Rasband
I added underscores to the dialog box labels used by the "Moment
Calculator" at

    http://rsb.info.nih.gov/ij/plugins/moments.html

and it it now works with macros.

-wayne

On Jul 11, 2006, at 9:43 AM, Andy Weller wrote:

> Dear all,
>
> Maybe there is a problem due to "Duplicate keywords"?!
>
> When I record this macro a "Recorder" dialog box comes up with:
>
> -----
> Duplicate keyword:
>    Command: "Moment Calculator"
>    Keyword: " centre"
>    Value:
> Add an underscore to the corresponding label in the dialog to make the
> first word unique.
> -----
>
> This is the same for keywords: " variance", " skewness", " kurtosis"
> and
> "enter" which has a value of "1.0000".
>
> I have looked in source code to see if I can add an underscore to
> update
> this plugin, but these variables aren't there?!
>
> I am a little lost with this - any suggestions?
>
> Thanks, Andy
>
> On Mon, 2006-07-10 at 17:26 +0200, Andy Weller wrote:
>> Excellent - thanks for the updated "GLCM Texture" plugin.
>>
>> Maybe a similar thing is happening with the "Moment Calculator"
>> plugin.
>> On running manually it seems fine, but as a macro the results are
>> empty.
>> I get either "0" or "NaN".
>>
>> How can I change this to make it macro-able?
>>
>> Thanks, Andy
>>
>> On Fri, 2006-07-07 at 13:20 -0400, Wayne Rasband wrote:
>>> There is an updated version of the "GLCM Texture" plugin (v0.4) that
>>> works with macros and stacks.
>>>
>>>        http://rsb.info.nih.gov/ij/plugins/texture.html
>>>
>>> -wayne
>
> --
> Dr. Andy Weller
> ETH Zurich
> Geological Institute
> CAB E 64
> Universitaetstrasse 6
> 8092 Zurich, Switzerland
>
> [hidden email]
> www.erdw.ethz.ch/Weller
>
> +41 44 632 84 12 office
> +41 44 632 36 82 lab
> +41 76 426 36 99 mobile
> +41 44 632 10 80 fax
>