Macro control over QuickTime Player window in ImageJ?

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

Macro control over QuickTime Player window in ImageJ?

Bill Mohler
Hi All:

I have been using the Import>QuickTime Player feature that Jeff
Hardin and Wayne added to recent versions of ImageJ.  It is extremely
useful for extracting and analyzing clips from the very large
QuickTimeVR movies that my lab uses.  Currently we do this extraction
using manual switching among windows and use of the "G" key to grab
images from the movie window.

I would like to use a macro to allow us to extract such clips more
automatically.  But in my experience, the macro recorder  does not
register anything I do within the QTplayer window.  Furthermore, the
movie window doesn't even appear on the list under the Window menu.
But I can toggle to the QTplayer window using "command-`" on the Mac.

I am imagining that I could create a macro that uses the "command-`"
and "G" and "arrow" keystrokes (just as I use them now manually) to
let a macro extract clips.  Browsing the Macro reference pdf,
however, I did not see a way to program keystroke events, per se,
into a macro.  Is this possible?

Many thanks for your help,
Bill

--
-----------------
William A. Mohler
Associate Professor
Dept. of Genetics and Developmental Biology
University of Connecticut Health Center
MC-3301
263 Farmington Ave.
Farmington, CT   06030-3301

[hidden email]
Office: (860) 679-1833, room E2056
Lab: (860) 679-1834, room E2052
Mobile: (860) 985-2719
Fax: (860) 760-6140
G&DB dept. ofc.: (860) 679-8350
G&DB dept. fax : (860) 679-8345
http://genetics.uchc.edu/Faculty/Mohler/Mohler.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

jmutterer
Bill,
you could try to use the IJ_Robot plugin by Gabriel Landini.
You can get it from Gabriel's webpage.
http://www.dentistry.bham.ac.uk/landinig/software/software.html

Jerome

On 5/21/07, Bill Mohler <[hidden email]> wrote:

>
> Hi All:
>
> I have been using the Import>QuickTime Player feature that Jeff
> Hardin and Wayne added to recent versions of ImageJ.  It is extremely
> useful for extracting and analyzing clips from the very large
> QuickTimeVR movies that my lab uses.  Currently we do this extraction
> using manual switching among windows and use of the "G" key to grab
> images from the movie window.
>
> I would like to use a macro to allow us to extract such clips more
> automatically.  But in my experience, the macro recorder  does not
> register anything I do within the QTplayer window.  Furthermore, the
> movie window doesn't even appear on the list under the Window menu.
> But I can toggle to the QTplayer window using "command-`" on the Mac.
>
> I am imagining that I could create a macro that uses the "command-`"
> and "G" and "arrow" keystrokes (just as I use them now manually) to
> let a macro extract clips.  Browsing the Macro reference pdf,
> however, I did not see a way to program keystroke events, per se,
> into a macro.  Is this possible?
>
> Many thanks for your help,
> Bill
>
> --
> -----------------
> William A. Mohler
> Associate Professor
> Dept. of Genetics and Developmental Biology
> University of Connecticut Health Center
> MC-3301
> 263 Farmington Ave.
> Farmington, CT   06030-3301
>
> [hidden email]
> Office: (860) 679-1833, room E2056
> Lab: (860) 679-1834, room E2052
> Mobile: (860) 985-2719
> Fax: (860) 760-6140
> G&DB dept. ofc.: (860) 679-8350
> G&DB dept. fax : (860) 679-8345
> http://genetics.uchc.edu/Faculty/Mohler/Mohler.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

Bill Mohler
Thanks, Jerome (and to you Gabriel).

This looks like it could be quite helpful.  But in looking at the
online documentation, am I right in thinking that the
up,down,right,left-arrow keys are not emulatable using the KeyPress
command?  I would love to be able to script them for this task.
Also, I'm a bit unclear whether IJ_Robot will emulate modified
keystrokes (like "cmd-`").

Bill

At 8:37 AM +0200 5/22/07, jerome mutterer wrote:

>Bill,
>you could try to use the IJ_Robot plugin by Gabriel Landini.
>You can get it from Gabriel's webpage.
>http://www.dentistry.bham.ac.uk/landinig/software/software.html
>
>Jerome
>
>On 5/21/07, Bill Mohler <[hidden email]> wrote:
>>
>>Hi All:
>>
>>I have been using the Import>QuickTime Player feature that Jeff
>>Hardin and Wayne added to recent versions of ImageJ.  It is extremely
>>useful for extracting and analyzing clips from the very large
>>QuickTimeVR movies that my lab uses.  Currently we do this extraction
>>using manual switching among windows and use of the "G" key to grab
>>images from the movie window.
>>
>>I would like to use a macro to allow us to extract such clips more
>>automatically.  But in my experience, the macro recorder  does not
>>register anything I do within the QTplayer window.  Furthermore, the
>>movie window doesn't even appear on the list under the Window menu.
>>But I can toggle to the QTplayer window using "command-`" on the Mac.
>>
>>I am imagining that I could create a macro that uses the "command-`"
>>and "G" and "arrow" keystrokes (just as I use them now manually) to
>>let a macro extract clips.  Browsing the Macro reference pdf,
>>however, I did not see a way to program keystroke events, per se,
>>into a macro.  Is this possible?
>>
>>Many thanks for your help,
>>Bill
>>
>>--
>>-----------------
>>William A. Mohler
>>Associate Professor
>>Dept. of Genetics and Developmental Biology
>>University of Connecticut Health Center
>>MC-3301
>>263 Farmington Ave.
>>Farmington, CT   06030-3301
>>
>>[hidden email]
>>Office: (860) 679-1833, room E2056
>>Lab: (860) 679-1834, room E2052
>>Mobile: (860) 985-2719
>>Fax: (860) 760-6140
>>G&DB dept. ofc.: (860) 679-8350
>>G&DB dept. fax : (860) 679-8345
>>http://genetics.uchc.edu/Faculty/Mohler/Mohler.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

Gabriel Landini
In reply to this post by Bill Mohler
On Tuesday 22 May 2007, you wrote:
> I also just found this note on the documentation for IJ_Robot:
> Note that in Mac OSX with an AZERTY keyboard, the typed string does
> not get interpreted correctly.

Yes, there is something strange in the way that the keys are reported using
different keyboards. A string does not necessarily correspond to a key event
or to a character value, apparently. It seems to depend on the keyboard one
is using. But I am not sure.

I am sorry but I do not have a solution to that at the moment. I would
appreciate if anybody can clarify what is the relation between keyboard,
string, character and key event.

> Does this mean that KeyPress will not work on any of my Macs running OSX?

You could do some test runs to male sure what string sends what key press. If
one positions  the cursor in a text editor and sends the commands there, one
can see what comes out.
I know that this is not ideal, but I hope it helps anyway.

Regards,

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

jmutterer
Dear all,

You can find out which keyCode triggered by a specific key on a given
keyboard by running ImageJ in debug mode and pressing this key.
I have a patch to Gabriel's robot that allows to specify a given keycode in
a the robot's keyPress string, including for example arrow keys.
in the robotText parsing loop, add the following 4 lines

else if (c == '&') {
 kc = java.lang.Integer.parseInt(robotText.substring(i+1,robotText.indexOf
(";",i+1)));
 i=robotText.indexOf(";",i+1);
}

// just before :

else
 kc=KeyEvent.VK_PERIOD;
//

this way, you can use the following syntax to specify a keyCode in a string
:

ima&65;&71;eJ  should output 'imageJ'

on my keyboard:
left arrow is &37;
right arrow is &39;
up arrow is &38;
down arrow is &40;

Jerome

On 5/22/07, Gabriel Landini <[hidden email]> wrote:

>
> On Tuesday 22 May 2007, you wrote:
> > I also just found this note on the documentation for IJ_Robot:
> > Note that in Mac OSX with an AZERTY keyboard, the typed string does
> > not get interpreted correctly.
>
> Yes, there is something strange in the way that the keys are reported
> using
> different keyboards. A string does not necessarily correspond to a key
> event
> or to a character value, apparently. It seems to depend on the keyboard
> one
> is using. But I am not sure.
>
> I am sorry but I do not have a solution to that at the moment. I would
> appreciate if anybody can clarify what is the relation between keyboard,
> string, character and key event.
>
> > Does this mean that KeyPress will not work on any of my Macs running
> OSX?
>
> You could do some test runs to male sure what string sends what key press.
> If
> one positions  the cursor in a text editor and sends the commands there,
> one
> can see what comes out.
> I know that this is not ideal, but I hope it helps anyway.
>
> Regards,
>
> Gabriel
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

Bill Mohler
In reply to this post by Gabriel Landini
Thanks, Gabriel.  In fact, I am getting the command

run("IJ Robot", "order=KeyPress keypress=g");

to work now just fine.  I was just unclear on the syntax, until I
realized that I was supposed to create macro code by starting the
macro recorder, then running the ijrobot plugin to create properly
formatted robot orders.

Another interesting observation:  I can't run a macro via keyboard
shortcut when the QuickTime Player window is in foreground.  But I
can run the macro (with the QuickTime Player window in foreground)
from the Plugins>Macros menu when the macro is installed).

Bill

>On Tuesday 22 May 2007, you wrote:
>>  I also just found this note on the documentation for IJ_Robot:
>>  Note that in Mac OSX with an AZERTY keyboard, the typed string does
>>  not get interpreted correctly.
>
>Yes, there is something strange in the way that the keys are reported using
>different keyboards. A string does not necessarily correspond to a key event
>or to a character value, apparently. It seems to depend on the keyboard one
>is using. But I am not sure.
>
>I am sorry but I do not have a solution to that at the moment. I would
>appreciate if anybody can clarify what is the relation between keyboard,
>string, character and key event.
>
>>  Does this mean that KeyPress will not work on any of my Macs running OSX?
>
>You could do some test runs to male sure what string sends what key press. If
>one positions  the cursor in a text editor and sends the commands there, one
>can see what comes out.
>I know that this is not ideal, but I hope it helps anyway.
>
>Regards,
>
>Gabriel


--
-----------------
William A. Mohler
Associate Professor
Dept. of Genetics and Developmental Biology
University of Connecticut Health Center
MC-3301
263 Farmington Ave.
Farmington, CT   06030-3301

[hidden email]
Office: (860) 679-1833, room E2056
Lab: (860) 679-1834, room E2052
Mobile: (860) 985-2719
Fax: (860) 760-6140
G&DB dept. ofc.: (860) 679-8350
G&DB dept. fax : (860) 679-8345
http://genetics.uchc.edu/Faculty/Mohler/Mohler.html
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

jmutterer
In reply to this post by jmutterer
Ok, I just tested the patch on an AZERTY keyboard, and it won't work as
expected for letters. However, the arrows are working fine.

Jerome


On 5/22/07, jerome mutterer <[hidden email]> wrote:

>
> Dear all,
>
> You can find out which keyCode triggered by a specific key on a given
> keyboard by running ImageJ in debug mode and pressing this key.
> I have a patch to Gabriel's robot that allows to specify a given keycode
> in a the robot's keyPress string, including for example arrow keys.
> in the robotText parsing loop, add the following 4 lines
>
> else if (c == '&') {
>  kc = java.lang.Integer.parseInt(robotText.substring(i+1,robotText.indexOf
> (";",i+1)));
>  i=robotText.indexOf (";",i+1);
> }
>
> // just before :
>
> else
>  kc=KeyEvent.VK_PERIOD;
> //
>
> this way, you can use the following syntax to specify a keyCode in a
> string :
>
> ima&65;&71;eJ  should output 'imageJ'
>
> on my keyboard:
> left arrow is &37;
> right arrow is &39;
> up arrow is &38;
> down arrow is &40;
>
> Jerome
>
> On 5/22/07, Gabriel Landini <[hidden email]> wrote:
> >
> > On Tuesday 22 May 2007, you wrote:
> > > I also just found this note on the documentation for IJ_Robot:
> > > Note that in Mac OSX with an AZERTY keyboard, the typed string does
> > > not get interpreted correctly.
> >
> > Yes, there is something strange in the way that the keys are reported
> > using
> > different keyboards. A string does not necessarily correspond to a key
> > event
> > or to a character value, apparently. It seems to depend on the keyboard
> > one
> > is using. But I am not sure.
> >
> > I am sorry but I do not have a solution to that at the moment. I would
> > appreciate if anybody can clarify what is the relation between keyboard,
> > string, character and key event.
> >
> > > Does this mean that KeyPress will not work on any of my Macs running
> > OSX?
> >
> > You could do some test runs to male sure what string sends what key
> > press. If
> > one positions  the cursor in a text editor and sends the commands there,
> > one
> > can see what comes out.
> > I know that this is not ideal, but I hope it helps anyway.
> >
> > Regards,
> >
> > Gabriel
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

Gabriel Landini
On Tuesday 22 May 2007, jerome mutterer wrote:
> Ok, I just tested the patch on an AZERTY keyboard, and it won't work as
> expected for letters. However, the arrows are working fine.

Is there a way to get which string is necessary to output which key event in
an azerty kbd?
If so, then one could make a selection option of qwerty or azerty and then
create a (yes, it is ugly, I know) look up table of events rather than the
way it is done now?


Cheers,

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Macro control over QuickTime Player window in ImageJ?

Gabriel Landini
In reply to this post by jmutterer
I just noted that the demo file for the IJ_Robot did not work as intended
anymore (something to do with the initial image window positioning, I think).
I updated it so the image is positioned in the correct place and it shows a
few things that can be done (draw, click, add text to the image and move a
window).

http://www.dentistry.bham.ac.uk/landinig/software/ijrobot.zip

I haven't included Jerome's patch yet as I am not sure it solves the problem
with non-qwerty keyboards.

Cheers,

Gabriel
Reply | Threaded
Open this post in threaded view
|

Open .raw format time series image in ImageJ?

Liu, Dongfang (NIH/NIAID) [F]
In reply to this post by Bill Mohler
Dear All,

I saved time-series image as .raw format. However, I want to re-open the format of .raw time-series image to check it! It seems IJ cannot open it? Any suggestions would be appreciated!

Best regards,
Don
Reply | Threaded
Open this post in threaded view
|

Re: Open .raw format time series image in ImageJ?

Wayne Rasband
Use the File>Import>Raw command and check "Open all Files in Folder" in
the dialog box.

-wayne

On May 23, 2007, at 1:56 PM, Liu, Dongfang (NIH/NIAID) [F] wrote:

> Dear All,
>
> I saved time-series image as .raw format. However, I want to re-open
> the format of .raw time-series image to check it! It seems IJ cannot
> open it? Any suggestions would be appreciated!
>
> Best regards,
> Don
>