Working with Null Results Table

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

Working with Null Results Table

Dan McDonald
Hello List,

 

I am using version 1.45h under Linux Ubuntu.

 

I have a macro that calls Analyze Particles.  If there are no particles I
get a Results Table with no entries on the screen. ImageJ does not appear to
"see" this Results Table.  I cannot "Close" it from within my macro.  I
tried to fill it with dummy values with the "SetResult" command and then
Update it.  I can see on the screen that the Results Table is updated but
the 'Close" command still doesn't see it.

 

Do I misunderstand something?  Does any one have a work around I might use?

 

Thank you,

 

Dan

 

Daniel W. McDonald, President

Phenotype Screening Corporation

4028 Papermill Rd, Suite 10

Knoxville, TN 37909

(865) 385-8641

 

Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as one of the
100 most technologically significant products introduced into the
marketplace in the prior year.

 
Reply | Threaded
Open this post in threaded view
|

Re: Working with Null Results Table

Michael Schmid
Hi Daniel,

this works for me:

if (isOpen("Results")) { //or if (nResults>0)
   selectWindow("Results");
   run("Close");
}

Note that close() only works for images.

Michael
________________________________________________________________

On 25 May 2011, at 15:22, Daniel W McDonald wrote:

> Hello List,
>
>
>
> I am using version 1.45h under Linux Ubuntu.
>
>
>
> I have a macro that calls Analyze Particles.  If there are no  
> particles I
> get a Results Table with no entries on the screen. ImageJ does not  
> appear to
> "see" this Results Table.  I cannot "Close" it from within my  
> macro.  I
> tried to fill it with dummy values with the "SetResult" command and  
> then
> Update it.  I can see on the screen that the Results Table is  
> updated but
> the 'Close" command still doesn't see it.
>
>
>
> Do I misunderstand something?  Does any one have a work around I  
> might use?
>
>
>
> Thank you,
>
>
>
> Dan
>
>
>
> Daniel W. McDonald, President
>
> Phenotype Screening Corporation
>
> 4028 Papermill Rd, Suite 10
>
> Knoxville, TN 37909
>
> (865) 385-8641
>
>
>
> Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as  
> one of the
> 100 most technologically significant products introduced into the
> marketplace in the prior year.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Working with Null Results Table

Dan McDonald
Hi Michael,

I am using run("Close".)

I think the problem is that if there are no particles nResults = 0.

I am currently running my macro on a large data set where I manually removed
all files that have the potential for a null Results Table.  Once that run
concludes I'll try to debug further.  I'll see what the "isOpen" reports
back.

What events set -Results Table Open- =true?  Apparently when it is opened
without values -Results Table Open- is false.  setResults, update and
getResult don't appear to change that.

Dan

Daniel W. McDonald, President
Phenotype Screening Corporation
4028 Papermill Rd, Suite 10
Knoxville, TN 37909
(865) 385-8641
 
Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as one of the
100 most technologically significant products introduced into the
marketplace in the prior year.

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Michael Schmid
Sent: Wednesday, May 25, 2011 9:32 AM
To: [hidden email]
Subject: Re: Working with Null Results Table

Hi Daniel,

this works for me:

if (isOpen("Results")) { //or if (nResults>0)
   selectWindow("Results");
   run("Close");
}

Note that close() only works for images.

Michael
________________________________________________________________

On 25 May 2011, at 15:22, Daniel W McDonald wrote:

> Hello List,
>
>
>
> I am using version 1.45h under Linux Ubuntu.
>
>
>
> I have a macro that calls Analyze Particles.  If there are no  
> particles I
> get a Results Table with no entries on the screen. ImageJ does not  
> appear to
> "see" this Results Table.  I cannot "Close" it from within my  
> macro.  I
> tried to fill it with dummy values with the "SetResult" command and  
> then
> Update it.  I can see on the screen that the Results Table is  
> updated but
> the 'Close" command still doesn't see it.
>
>
>
> Do I misunderstand something?  Does any one have a work around I  
> might use?
>
>
>
> Thank you,
>
>
>
> Dan
>
>
>
> Daniel W. McDonald, President
>
> Phenotype Screening Corporation
>
> 4028 Papermill Rd, Suite 10
>
> Knoxville, TN 37909
>
> (865) 385-8641
>
>
>
> Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as  
> one of the
> 100 most technologically significant products introduced into the
> marketplace in the prior year.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Working with Null Results Table

Michael Schmid
Hi Daniel,

well, I see no reason to artificially open the ResultsTable if there  
are no results from the Particle Analyzer. Just don't close it if it  
is not open.

Nevertheless, the following macro works for me (OS X 10.4, Java 1.5).  
The results table briefly flickers and then disappears:

//starting condition: no "Results" window
updateResults();
selectWindow("Results");
run("Close");

updateResults calls ResultsTable.show(String) with argument  
"Results"; this eventually issues a call to IJ.showResults, which  
creates the new TextWindow named "Results".

I could imagine that on some operating systems a race condition could  
happen, with a delay when opening the TextWindow in a separate  
thread, but the run("Close"") command from the Macro thread being  
issued earlier. There have been problems like this in ImageJ in the  
past, but I did not hear of any of these since quite some time, so I  
would not expect to see such a problem.

You can check whether you have a race condition by inserting a line  
"wait(200);" before "selectWindow". If there is a race condition, the  
macro should work with that "wait" statement, but not (or only  
occasionally) without. In this case, let us know.


Michael
________________________________________________________________

On 25 May 2011, at 15:48, Daniel W McDonald wrote:

> Hi Michael,
>
> I am using run("Close".)
>
> I think the problem is that if there are no particles nResults = 0.
>
> I am currently running my macro on a large data set where I  
> manually removed
> all files that have the potential for a null Results Table.  Once  
> that run
> concludes I'll try to debug further.  I'll see what the "isOpen"  
> reports
> back.
>
> What events set -Results Table Open- =true?  Apparently when it is  
> opened
> without values -Results Table Open- is false.  setResults, update and
> getResult don't appear to change that.
>
> Dan
>
> Daniel W. McDonald, President
> Phenotype Screening Corporation
> 4028 Papermill Rd, Suite 10
> Knoxville, TN 37909
> (865) 385-8641
>
> Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as  
> one of the
> 100 most technologically significant products introduced into the
> marketplace in the prior year.
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Michael Schmid
> Sent: Wednesday, May 25, 2011 9:32 AM
> To: [hidden email]
> Subject: Re: Working with Null Results Table
>
> Hi Daniel,
>
> this works for me:
>
> if (isOpen("Results")) { //or if (nResults>0)
>    selectWindow("Results");
>    run("Close");
> }
>
> Note that close() only works for images.
>
> Michael
> ________________________________________________________________
>
> On 25 May 2011, at 15:22, Daniel W McDonald wrote:
>
>> Hello List,
>>
>>
>>
>> I am using version 1.45h under Linux Ubuntu.
>>
>>
>>
>> I have a macro that calls Analyze Particles.  If there are no
>> particles I
>> get a Results Table with no entries on the screen. ImageJ does not
>> appear to
>> "see" this Results Table.  I cannot "Close" it from within my
>> macro.  I
>> tried to fill it with dummy values with the "SetResult" command and
>> then
>> Update it.  I can see on the screen that the Results Table is
>> updated but
>> the 'Close" command still doesn't see it.
>>
>>
>>
>> Do I misunderstand something?  Does any one have a work around I
>> might use?
>>
>>
>>
>> Thank you,
>>
>>
>>
>> Dan
>>
>>
>>
>> Daniel W. McDonald, President
>>
>> Phenotype Screening Corporation
>>
>> 4028 Papermill Rd, Suite 10
>>
>> Knoxville, TN 37909
>>
>> (865) 385-8641
>>
>>
>>
>> Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as
>> one of the
>> 100 most technologically significant products introduced into the
>> marketplace in the prior year.
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Working with Null Results Table

Dan McDonald
Hi Michael,

I do not OPEN a null Results Table, one is opened for me when I run "Analyze
Particles."  I generally do not know a-priori which files may have particles
and which won't after my filtering.

Several weeks ago I had a similar mysterious problem and I believe you
recommended that I use the wait command.  I then began to insert waits
throughout my code when I used certain specific commands.  That was very
useful feedback back then.  Thank you.

The problem then became that I was running large macros through large sets
of files and all those waits were adding up.  So I began adding dummy
commands after commands that might have racing conditions, mostly
assignments.  They seem to add enough delay for my code to run without
slowing things way down.

I have inserted some dummy code into this macro and it appears to be enough
to give the system time to update the -Results Table Open- = True flag.

Thank you again for your feedback.  This work around is not elegant but it
does allow my code to run.

Dan

Daniel W. McDonald, President
Phenotype Screening Corporation
4028 Papermill Rd, Suite 10
Knoxville, TN 37909
(865) 385-8641
 
Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as one of the
100 most technologically significant products introduced into the
marketplace in the prior year.

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Michael Schmid
Sent: Wednesday, May 25, 2011 10:20 AM
To: [hidden email]
Subject: Re: Working with Null Results Table

Hi Daniel,

well, I see no reason to artificially open the ResultsTable if there  
are no results from the Particle Analyzer. Just don't close it if it  
is not open.

Nevertheless, the following macro works for me (OS X 10.4, Java 1.5).  
The results table briefly flickers and then disappears:

//starting condition: no "Results" window
updateResults();
selectWindow("Results");
run("Close");

updateResults calls ResultsTable.show(String) with argument  
"Results"; this eventually issues a call to IJ.showResults, which  
creates the new TextWindow named "Results".

I could imagine that on some operating systems a race condition could  
happen, with a delay when opening the TextWindow in a separate  
thread, but the run("Close"") command from the Macro thread being  
issued earlier. There have been problems like this in ImageJ in the  
past, but I did not hear of any of these since quite some time, so I  
would not expect to see such a problem.

You can check whether you have a race condition by inserting a line  
"wait(200);" before "selectWindow". If there is a race condition, the  
macro should work with that "wait" statement, but not (or only  
occasionally) without. In this case, let us know.


Michael
________________________________________________________________

On 25 May 2011, at 15:48, Daniel W McDonald wrote:

> Hi Michael,
>
> I am using run("Close".)
>
> I think the problem is that if there are no particles nResults = 0.
>
> I am currently running my macro on a large data set where I  
> manually removed
> all files that have the potential for a null Results Table.  Once  
> that run
> concludes I'll try to debug further.  I'll see what the "isOpen"  
> reports
> back.
>
> What events set -Results Table Open- =true?  Apparently when it is  
> opened
> without values -Results Table Open- is false.  setResults, update and
> getResult don't appear to change that.
>
> Dan
>
> Daniel W. McDonald, President
> Phenotype Screening Corporation
> 4028 Papermill Rd, Suite 10
> Knoxville, TN 37909
> (865) 385-8641
>
> Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as  
> one of the
> 100 most technologically significant products introduced into the
> marketplace in the prior year.
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Michael Schmid
> Sent: Wednesday, May 25, 2011 9:32 AM
> To: [hidden email]
> Subject: Re: Working with Null Results Table
>
> Hi Daniel,
>
> this works for me:
>
> if (isOpen("Results")) { //or if (nResults>0)
>    selectWindow("Results");
>    run("Close");
> }
>
> Note that close() only works for images.
>
> Michael
> ________________________________________________________________
>
> On 25 May 2011, at 15:22, Daniel W McDonald wrote:
>
>> Hello List,
>>
>>
>>
>> I am using version 1.45h under Linux Ubuntu.
>>
>>
>>
>> I have a macro that calls Analyze Particles.  If there are no
>> particles I
>> get a Results Table with no entries on the screen. ImageJ does not
>> appear to
>> "see" this Results Table.  I cannot "Close" it from within my
>> macro.  I
>> tried to fill it with dummy values with the "SetResult" command and
>> then
>> Update it.  I can see on the screen that the Results Table is
>> updated but
>> the 'Close" command still doesn't see it.
>>
>>
>>
>> Do I misunderstand something?  Does any one have a work around I
>> might use?
>>
>>
>>
>> Thank you,
>>
>>
>>
>> Dan
>>
>>
>>
>> Daniel W. McDonald, President
>>
>> Phenotype Screening Corporation
>>
>> 4028 Papermill Rd, Suite 10
>>
>> Knoxville, TN 37909
>>
>> (865) 385-8641
>>
>>
>>
>> Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as
>> one of the
>> 100 most technologically significant products introduced into the
>> marketplace in the prior year.
>>
>>