Hello,
I want to add a button to the wait_for_user dialog. My macro processes a large number of images with a single user interaction for each image, and once in a while an image comes up that is inappropriate for analysis. It is not always easy to detect which images can't be analyzed automatically. Does anyone know if you can put a 'skip' button with programmable functionality (i.e., close active window and move on to the next) in the dialog? Thanks, Tim Timothy Feinstein, Ph.D. Research Scientist University of Pittsburgh Department of Developmental Biology -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
What about an if statement to skip a whole block of code if a condition is or is not met?
========================================================================= Michael Cammer, Microscopy Core & Skirball Institute, NYU Langone Medical Center Cell: 914-309-3270 Office: Skirball 2nd Floor main office, back right http://ocs.med.nyu.edu/microscopy & http://microscopynotes.com/ -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Feinstein, Timothy N Sent: Monday, October 03, 2016 5:33 PM To: [hidden email] Subject: Add a skip button to wait_for_user? Hello, I want to add a button to the wait_for_user dialog. My macro processes a large number of images with a single user interaction for each image, and once in a while an image comes up that is inappropriate for analysis. It is not always easy to detect which images can't be analyzed automatically. Does anyone know if you can put a 'skip' button with programmable functionality (i.e., close active window and move on to the next) in the dialog? Thanks, Tim Timothy Feinstein, Ph.D. Research Scientist University of Pittsburgh Department of Developmental Biology -- ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DQIFAg&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=qOrEq2bPnzHPIWvKCg1Z9myQNtcRfZOdJYbTNXDi12w&s=Zjtzw-fB6r35CUPJAw05KODIDE5_zcJNthIPJBgozUc&e= ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by TimFeinstein
Hi Tim,
I've never been able to add buttons to wait for user or dialogs actually but you could have an extra dialog with two radio buttons or checkboxes to process the current image or not. This should only add one more click for the user. I always think non-modal dialogs would be very useful in the macro language too. Thanks, Matt -------- Original message -------- From: "Feinstein, Timothy N" <[hidden email]> Date: 03/10/2016 22:36 (GMT+00:00) To: [hidden email] Subject: Add a skip button to wait_for_user? Hello, I want to add a button to the wait_for_user dialog. My macro processes a large number of images with a single user interaction for each image, and once in a while an image comes up that is inappropriate for analysis. It is not always easy to detect which images can't be analyzed automatically. Does anyone know if you can put a 'skip' button with programmable functionality (i.e., close active window and move on to the next) in the dialog? Thanks, Tim Timothy Feinstein, Ph.D. Research Scientist University of Pittsburgh Department of Developmental Biology -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by TimFeinstein
Or, instead of a dialog box, you could also use getBoolean("Skip image?") right after the waitforuser command...
Ved ___________________________________ Ved Sharma, PhD Department of Anatomy and Structural Biology Albert Einstein College of Medicine Bronx, New York -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by TimFeinstein
Hi Tim,
what about asking the user to close inappropriate images? You could have id=getImageID(); before waitForUser, and afterwards check with isOpen(id) whether the image has been closed during the 'Wait For User' phase. Michael ________________________________________________________________ On 2016-10-03 23:32, Feinstein, Timothy N wrote: > Hello, > > I want to add a button to the wait_for_user dialog. My macro processes a > large number of images with a single user interaction for each image, and > once in a while an image comes up that is inappropriate for analysis. It > is not always easy to detect which images can't be analyzed automatically. > Does anyone know if you can put a 'skip' button with programmable > functionality (i.e., close active window and move on to the next) in the > dialog? > > Thanks, > > > Tim > > Timothy Feinstein, Ph.D. > Research Scientist > University of Pittsburgh Department of Developmental Biology > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi folks,
After reading through some related threads, I came across a great way to add functionality to the waitForUser dialog - right after the waitForUser(); line, add one or more if() statements detecting whether shift or ctrl is down. These essentially give branching options from the one OK button. I found that this works perfectly for skipping a section in a repeated analysis without exiting the macro. It looks like this: waitForUser("Select the cilia, or Shift+click to skip"); if (isKeyDown("Shift") == true) { selectWindow(name); Run("Close); } else { //all the analysis steps } Best, Tim Timothy Feinstein, Ph.D. Research Scientist University of Pittsburgh Department of Developmental Biology On 10/5/16, 4:52 AM, "ImageJ Interest Group on behalf of Michael Schmid" <[hidden email] on behalf of [hidden email]> wrote: >Hi Tim, > >what about asking the user to close inappropriate images? > >You could have > id=getImageID(); >before waitForUser, and afterwards check with > isOpen(id) >whether the image has been closed during the 'Wait For User' phase. > >Michael >________________________________________________________________ >On 2016-10-03 23:32, Feinstein, Timothy N wrote: >> Hello, >> >> I want to add a button to the wait_for_user dialog. My macro processes >>a >> large number of images with a single user interaction for each image, >>and >> once in a while an image comes up that is inappropriate for analysis. >>It >> is not always easy to detect which images can't be analyzed >>automatically. >> Does anyone know if you can put a 'skip' button with programmable >> functionality (i.e., close active window and move on to the next) in the >> dialog? >> >> Thanks, >> >> >> Tim >> >> Timothy Feinstein, Ph.D. >> Research Scientist >> University of Pittsburgh Department of Developmental Biology >> >> -- >> ImageJ mailing list: >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.ni >>h.gov%2Fij%2Flist.html&data=01%7C01%7Ctnf8%40pitt.edu%7Cfbab6c8a12e64c4ba >>de608d3ecfd0e7b%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=Dx8uyu9L8Qyr >>gFqpZtabXPxq9by7w6%2FgUxf1Sj%2BiLL8%3D&reserved=0 >> > >-- >ImageJ mailing list: >https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih >.gov%2Fij%2Flist.html&data=01%7C01%7Ctnf8%40pitt.edu%7Cfbab6c8a12e64c4bade >608d3ecfd0e7b%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=Dx8uyu9L8QyrgFq >pZtabXPxq9by7w6%2FgUxf1Sj%2BiLL8%3D&reserved=0 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi.
Good solution. Just do not forget to release shift key with setKeyDown("none"); ;) Best, Ondřej Dne 6.10.2016 22:27 "Feinstein, Timothy N" <[hidden email]> napsal(a): > Hi folks, > > After reading through some related threads, I came across a great way to > add functionality to the waitForUser dialog - right after the > waitForUser(); line, add one or more if() statements detecting whether > shift or ctrl is down. These essentially give branching options from the > one OK button. I found that this works perfectly for skipping a section > in a repeated analysis without exiting the macro. > > It looks like this: > > waitForUser("Select the cilia, or Shift+click to skip"); > if (isKeyDown("Shift") == true) { > selectWindow(name); > Run("Close); > } > else { > //all the analysis steps > } > > Best, > > > Tim > > > > Timothy Feinstein, Ph.D. > Research Scientist > University of Pittsburgh Department of Developmental Biology > > > > > > On 10/5/16, 4:52 AM, "ImageJ Interest Group on behalf of Michael Schmid" > <[hidden email] on behalf of [hidden email]> wrote: > > >Hi Tim, > > > >what about asking the user to close inappropriate images? > > > >You could have > > id=getImageID(); > >before waitForUser, and afterwards check with > > isOpen(id) > >whether the image has been closed during the 'Wait For User' phase. > > > >Michael > >________________________________________________________________ > >On 2016-10-03 23:32, Feinstein, Timothy N wrote: > >> Hello, > >> > >> I want to add a button to the wait_for_user dialog. My macro processes > >>a > >> large number of images with a single user interaction for each image, > >>and > >> once in a while an image comes up that is inappropriate for analysis. > >>It > >> is not always easy to detect which images can't be analyzed > >>automatically. > >> Does anyone know if you can put a 'skip' button with programmable > >> functionality (i.e., close active window and move on to the next) in the > >> dialog? > >> > >> Thanks, > >> > >> > >> Tim > >> > >> Timothy Feinstein, Ph.D. > >> Research Scientist > >> University of Pittsburgh Department of Developmental Biology > >> > >> -- > >> ImageJ mailing list: > >>https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fimagej.ni > >>h.gov%2Fij%2Flist.html&data=01%7C01%7Ctnf8%40pitt.edu% > 7Cfbab6c8a12e64c4ba > >>de608d3ecfd0e7b%7C9ef9f489e0a04eeb87cc3a526112 > fd0d%7C1&sdata=Dx8uyu9L8Qyr > >>gFqpZtabXPxq9by7w6%2FgUxf1Sj%2BiLL8%3D&reserved=0 > >> > > > >-- > >ImageJ mailing list: > >https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fimagej.nih > >.gov%2Fij%2Flist.html&data=01%7C01%7Ctnf8%40pitt.edu% > 7Cfbab6c8a12e64c4bade > >608d3ecfd0e7b%7C9ef9f489e0a04eeb87cc3a526112 > fd0d%7C1&sdata=Dx8uyu9L8QyrgFq > >pZtabXPxq9by7w6%2FgUxf1Sj%2BiLL8%3D&reserved=0 > > -- > 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 |